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

1 visualización (últimos 30 días)
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?

Respuesta aceptada

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

Más respuestas (2)

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

Iniciar sesión para comentar.


Image Analyst
Image Analyst el 10 de Jul. de 2013
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);
  2 comentarios
Image Analyst
Image Analyst el 10 de Jul. de 2013
Replace handles.axes2 with whatever the handle to your axes is - the one you got from uicontrol() when you called that.

Iniciar sesión para comentar.

Categorías

Más información sobre Migrate GUIDE Apps en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by