필터 지우기
필터 지우기

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

조회 수: 1 (최근 30일)
Antonio
Antonio 2013년 7월 10일
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);
  댓글 수: 2
Antonio
Antonio 2013년 7월 10일
I'm not using GUIDE.
Image Analyst
Image Analyst 2013년 7월 10일
Replace handles.axes2 with whatever the handle to your axes is - the one you got from uicontrol() when you called that.

댓글을 달려면 로그인하십시오.

카테고리

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