From: Jessica on
Walter Roberson <roberson(a)hushmail.com> wrote in message <hsc97i$3be$1(a)canopus.cc.umanitoba.ca>...
> Jessica wrote:
>
> > Also, the rectangle that I drew with rectangle() seems to disappear when
> > I click forward to a new frame. Ideally, I would want the rectangle to
> > remain on the screen all the time.
>
> for K = 1 : numframe
> thisframe = mmreader(FileName, K, 1);
> if K == 1
> framehandle = image(thisframe);
> else
> set(framehandle, 'CData', thisframe);
> rectangle(Some Appropriate Parameters);
> end
> pause(1/24); %24 frames per second or so...
> end
>
>
> If you use this setup, you will not need "hold on", as rectangle() always adds
> to the current axis, and for each frame after the first you update the current
> image rather than replacing it.

Thanks for this detailed code. I had a little difficulty running it as a number of errors popped up. However, I think it may not actually work for my purposes anyway. When I am looking at the video, I need to use the forward and back buttons to look at different frames in the video. Sometimes I need to go back a few frames, sometimes forward. Any further insights? Thanks!
From: Walter Roberson on
Jessica wrote:

> Thanks for this detailed code. I had a little difficulty running it as a
> number of errors popped up. However, I think it may not actually work
> for my purposes anyway. When I am looking at the video, I need to use
> the forward and back buttons to look at different frames in the video.
> Sometimes I need to go back a few frames, sometimes forward. Any further
> insights? Thanks!

The basics remain the same -- if this is your very first image, then do a real
image() call and save the handle returned from it, and then rectangle() the
box into existence. If this is not your very first image, then instead of
using image() to display the frame, set() the CData property of the saved
handle to the new image, and if the rectangle is to be adjusted in position
then use set() to set the Position properties of the handle of the rectangle.

For efficiency, you should usually update the properties of an existing object
rather (implicitly) deleting the object and creating a new one of the same
type, as is happening in your existing code when you image() a new frame onto
the display.
From: Jessica on
Walter Roberson <roberson(a)hushmail.com> wrote in message <hscpm1$rgo$1(a)canopus.cc.umanitoba.ca>...
> Jessica wrote:
>
> > Thanks for this detailed code. I had a little difficulty running it as a
> > number of errors popped up. However, I think it may not actually work
> > for my purposes anyway. When I am looking at the video, I need to use
> > the forward and back buttons to look at different frames in the video.
> > Sometimes I need to go back a few frames, sometimes forward. Any further
> > insights? Thanks!
>
> The basics remain the same -- if this is your very first image, then do a real
> image() call and save the handle returned from it, and then rectangle() the
> box into existence. If this is not your very first image, then instead of
> using image() to display the frame, set() the CData property of the saved
> handle to the new image, and if the rectangle is to be adjusted in position
> then use set() to set the Position properties of the handle of the rectangle.
>
> For efficiency, you should usually update the properties of an existing object
> rather (implicitly) deleting the object and creating a new one of the same
> type, as is happening in your existing code when you image() a new frame onto
> the display.

I'm still having a little trouble with this. When I enter in the code for mmreader:

thisframe = mmreader('video.mov', K, 1);

I get the error:

??? Error using ==> set
Invalid parameter/value pair arguments.

Error in ==> mmreader.mmreader>mmreader.mmreader at 137
set(obj, varargin{:});

Based on above, I'm also not sure how to make it so that I can use the keyboard forward/back to step through the video frame-by-frame AND have the rectangle appear. A few more specific details would be extremely helpful. Thanks!