1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45
| handles.tochanged=BW;
handles.notchanged=BW;
function Untitled_1_Callback(hObject, eventdata, handles)
% Undo
axes(handles.axesorig)
handles.tochanged=handles.notchanged;
guidata(hObject,handles);
imshow(handles.tochanged);
% hObject handle to Untitled_1 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% --------------------------------------------------------------------
function Untitled_3_Callback(hObject, eventdata, handles)
%Redo
handles.notchanged=handles.tochanged;
axes(handles.axesorig);
imshow(handles.notchanged);
% hObject handle to Untitled_3 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% --------------------------------------------------------------------
function Untitled_5_Callback(hObject, eventdata, handles)
%Select
axes(handles.axesorig);
RI=handles.tochanged;
rect=getrect; % selectioner rectangle
ISelect=imcrop(RI,rect); % utiliser la fonction imcrop pour selectionner une partie
Isx=rect(1);
Isy=rect(2);
Iswidth=rect(3);
Isheight=rect(4);
rectangle('Position',[Isx,Isy,Iswidth,Isheight],'EdgeColor','r'); %faire une rectangle pour chaque partie sélectionenr
handles.tochanged=ISelect;
guidata(hObject,handles);
%figure('Toolbar','none','Name','Selected image','NumberTitle','off'),
imshow(ISelect); |
Partager