Borrar filtros
Borrar filtros

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

1 visualización (últimos 30 días)
ayushi
ayushi el 22 de Mayo de 2016
Comentada: ayushi el 14 de Jun. de 2016
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`

Respuestas (1)

Image Analyst
Image Analyst el 22 de Mayo de 2016
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 comentarios
Image Analyst
Image Analyst el 12 de Jun. de 2016
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 el 14 de Jun. de 2016
ok thank you sir :) i will try this

Iniciar sesión para comentar.

Community Treasure Hunt

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

Start Hunting!

Translated by