フィルターのクリア

crop the image and after cropping display the cropped image on axes

1 回表示 (過去 30 日間)
ayushi
ayushi 2016 年 5 月 22 日
コメント済み: ayushi 2016 年 6 月 14 日
i have an image and i want to crop it i applied this code but its only cropping the image but not showing the cropped image on the axes :
I=imcrop(Iedge2);
pause(2)
imshow(I,'Parent',handles.axes2);
title('cropped image')
i want to show the message on the top of the axes area that "crop the image" when the crop process occurs and after selection of the area the cropped area will be shown to the `axes2 .some body please tell me is there is any function or method to do so?
thanks and regards`

回答 (1 件)

Image Analyst
Image Analyst 2016 年 5 月 22 日
imshow() does not change the current axes if you specify a Parent axes, therefore title will display over the current axes, which might not be axes2. To avoid confusion, I always call axes() before doing anything with an axes. This will change the current axes and everything you do from then on (without specifically referring to an axes) will happen at the axes you just passed in to axes():
axes(handles.axes2); % Change current axes, gca, to handles.axes2
imshow(I, []); % No need to specify 'Parent' now.
title('Cropped Image', 'FontSize', 20);
  8 件のコメント
Image Analyst
Image Analyst 2016 年 6 月 12 日
I think you're right. Now I seem to remember running across this before and I called the Mathworks about it. I think they might have given me some work around but I don't remember what it might have been. Try calling them. Alternatively you could just use text() to put some text into the overlay - see if that will remain after imcrop is called. Or (this I'm pretty sure will definitely work), just use GUIDE or uicontrol() to place a static text label somewhere on the figure window.
ayushi
ayushi 2016 年 6 月 14 日
ok thank you sir :) i will try this

サインインしてコメントする。

Community Treasure Hunt

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

Start Hunting!

Translated by