From: Nuri on
Hi everyone
I am trying to do object tracking on a live video stream taken from a camera. I want the user to select the target in the frame by clicking the mouse on it.This creates a fixed rectangle around the click point. however if user wants to change target and clicks again somewhere on the video stream, I need this rectangle to be deleted and a new rectangle to be drawn. Problem is I can do everything except deleting the old rectangle. Tried to use erasemode but no success. Can you pls give me some tips to manage this?

Thanks in advance
From: Mark Jones on
Nuri wrote:
> Hi everyone
> I am trying to do object tracking on a live video stream taken from a
> camera. I want the user to select the target in the frame by clicking
> the mouse on it.This creates a fixed rectangle around the click point.
> however if user wants to change target and clicks again somewhere on the
> video stream, I need this rectangle to be deleted and a new rectangle to
> be drawn. Problem is I can do everything except deleting the old
> rectangle. Tried to use erasemode but no success. Can you pls give me
> some tips to manage this?
>
> Thanks in advance

Hi Nuri,

I would encourage you to look at how our ROI selection in IMAQTOOL was
implemented. These files are in matlab\toolbox\imaq\imaq\+iatbrowser
and the main file to look at is ROIRect.m

You don't necessarily need to do anything so complex, but you should
look at how we worked with IMRECT.

Mark