From: Adhi on
Hello Everyone,

I little bit confuse using Regionprops command + rectangle to mark the area if there are some plot of figure.
Here the detail
I create a GUI contain 3 axes to plot 3 images on them. Then I wish to apply regionprops + rectangle in one of them. But the marker from rectangle apply in wrong image. I use imshow(images that i wish to mark is written in the last) before the regionprops command + rectangle then hold on then in the end of the iteration i use hold off

Please, maybe this is easy for you but i am just a newbie, so i really need your help soon

thanks
Adhi
From: Walter Roberson on
"Adhi " <adhi_blackmage(a)yahoo.co.id> wrote in message <ht41ob$t1l$1(a)fred.mathworks.com>...

> I create a GUI contain 3 axes to plot 3 images on them. Then I wish to apply regionprops + rectangle in one of them. But the marker from rectangle apply in wrong image.

When you use rect() or imrect() to create the rectangle, tell the routine exactly which axis the rectangle is to be written on.

Something like,

Thisimage = imshow('lena.tif');
Imaxis = ancestor(Thisimage,'axis');
rectangle('Position',[0.59,0.35,3.75,1.37],...
'Curvature',[0.8,0.4],...
'LineWidth',2,'LineStyle','--', ...
'Parent', Imaxis);
From: ImageAnalyst on
Adhi  :
I'm not sure I understand what you're saying. regionprops is the
final step in a series of things you do to measure objects in an
image. In general it has nothing to do with rectangle. The general
sequence for image processing typically goes like this:

process or filter your image to make it suitable for thresholding.
do the thresholding.
label the image
call regionprops

Here's a demo if you need instruction:
http://www.mathworks.com/matlabcentral/fileexchange/25157

If you have sample code you want us to look at, go ahead and post it.
From: Adhi on
Thanks Mr.Roberson and ImageAnalyst
I have solved the problem using ...'Parent',ax)
I have one more question
How to play video in an axes?
All this time i use method like this
for k = 1 : numFrames
movie(k).cdata = vidFrames(:,:,:,k);
movie(k).colormap = [];
imshow(movie(k).cdata,'Parent',handles.ax);
pause(0.03) % for fps 30
end
anyone know the easier way than this?