How can I change the figure in which I'm drawing with imfreehand?

1 次查看(过去 30 天)
I segment an image after specifying some segmentation seeds via imfreehand, then I get the segmented image on a new figure and I want to redraw some seeds on this new figure. How can I make the new calls to imfreehand be directed to the new figure and not the previous one?

采纳的回答

Antonio
Antonio 2013-7-10
I used this:
figure('name', 'image to segment'), imshow(imdata,[]);
h = gcf
%...
%do segmentation
figure(h), imshow(segmented_foreground, []);

更多回答(2 个)

Jan
Jan 2013-7-10
The documentation of imfreehand reveals, that the handle of axes to operate in can be specified as first input.
  1 个评论
Antonio
Antonio 2013-7-10
The documentation is insufficient for me. It doesn't specify how one gets the hparent that points to a figure.

请先登录,再进行评论。


Image Analyst
Image Analyst 2013-7-10
Let's say that you're using GUIDE and you have two "axes" controls on your GUI called axes1 and axes2 - this means that the "tag" property for those controls is axes1 and axes2. Then before you call imfreehand, simply call axes to switch focus (switch the gca which is the current axes):
axes(handles.axes2);
handleToDrawing = imfreehand();
Or pass it in
handleToDrawing = imfreehand(handles.axes2);

类别

Help CenterFile Exchange 中查找有关 Migrate GUIDE Apps 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by