How to crop image from axes?

3 Ansichten (letzte 30 Tage)
mbok
mbok am 7 Dez. 2014
Beantwortet: Sajjad Ali am 8 Jul. 2017
I want to crop an image from axes, and the result also was show in same axes, but when i click the button nothing happened, what's wrong?
I1 = getimage(handles.axes1);
[I1c rect] = imcrop(I1);
axes(handles.axes1)
imshow(I1c);
guidata(hObject, handles);
thanks before, sorry for my bad english
  1 Kommentar
Geoff Hayes
Geoff Hayes am 7 Dez. 2014
mbok - what button are you pressing? Given that you are calling guidata, you must have this code in a push button callback of your GUI. Is this correct? What happens if you put a breakpoint at the line
[I1c rect] = imcrop(I1);
and then launch your GUI? Does the debugger pause at this line?
Please include more information including all of the code in your callback function.
As an aside, it is unclear why you are calling guidata since you aren't making any changes to the handles structure.

Melden Sie sich an, um zu kommentieren.

Antworten (1)

Sajjad Ali
Sajjad Ali am 8 Jul. 2017
I tried this code in push button although neither it showing any warning nor any error. when I am clicking button it shows rectangle. When I am clicking next time rectangle gets invisible.
This code is not cropping image

Kategorien

Mehr zu Labels and Annotations finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by