MATLAB¿Î³ÌÉè¼Æ--GUIͼÏñ´¦Àí ÏÂÔر¾ÎÄ

ʵÏÖ³ÌÐòÈçÏ£º

function uipanel7_SelectionChangeFcn(hObject, eventdata, handles) %ͼÏñ·­×ª

% hObject handle to uipanel7 (see GCBO)

% eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) str=get(hObject,'string'); axes(handles.axes2); global T switch str

case '×óÓÒ·­×ª' T=handles.img; f=fliplr(handles.img); imshow(f); handles.img=f;

guidata(hObject,handles); case 'ÉÏÏ·­×ª' T=handles.img;

f=flipud(handles.img); imshow(f); handles.img=f;

guidata(hObject,handles);

29 / 52

end

³ÌÐò¹Ø¼ü²¿·Ö£ºÍ¨¹ýf=fliplr(handles.img); f=flipud(handles.img);·Ö±ðʵÏÖ×óÓÒ¾µÏñ·­×ªÓëÉÏϾµÏñ·­×ª¡£

£¨2£©Í¼ÏñÐýת¡£

ʵÏÖͼÏñµÄÄæʱÕëÐýתÈÎÒâ½Ç¶È¡£

ʵÏÖ³ÌÐò¶ÎÈçÏ£º

function pushbutton3_Callback(hObject, eventdata, handles) %ͼÏñ°®ÄǸöÐýת

% hObject handle to pushbutton3 (see GCBO)

% eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) global T

axes(handles.axes2); T=getimage;

prompt={'Ðýת½Ç¶È:'};

30 / 52

defans={'0'};

p=inputdlg(prompt,'input',1,defans); p1=str2num(p{1});

f=imrotate(handles.img,p1,'bilinear','crop'); imshow(f); handles.img=f;

guidata(hObject,handles);

¹Ø¼ü²¿·Ö£ºÍ¨¹ýp=inputdlg(prompt,'input',1,defans);p1=str2num(p{1}); À´ÊäÈëÐýת²ÎÊý¡£

ͨ¹ýº¯Êýf=imrotate(handles.img,p1,'bilinear','crop');ʵÏÖ·­×ª¡£

4.12ÌØÊâ´¦Àí

£¨1£©µ×ƬЧ¹û¡£½«Í¼Ïñ±äΪµ×Ƭ£¬²¢ÏÔʾ¡£

ʵÏÖ³ÌÐòÈçÏ£º

% --- Executes on button press in pushbutton12.

function pushbutton12_Callback(hObject, eventdata, handles) % hObject handle to pushbutton12 (see GCBO)

% eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) global T

axes (handles.axes2); T=getimage;

f=imcomplement(handles.img); %ͼÏñÈ¡·´¡ä

31 / 52

imshow(f); handles.img=f;

guidata(hObject,handles);

³ÌÐò¶Î¹Ø¼ü²¿·Ö£ºÍ¨¹ýf=imcomplement(handles.img);ʵÏÖͼÏñÈ¡·´£¬Ðγɵ×ƬЧ¹û¡£

£¨2£©±ßÔµÐÅÏ¢¡£²ÉȡͼÏñµÄ±ßÔµÐÅÏ¢¡£

ʵÏÖ³ÌÐò¶ÎÈçÏ£º

% --- Executes on button press in pushbutton16.

function pushbutton16_Callback(hObject, eventdata, handles) % hObject handle to pushbutton16 (see GCBO)

% eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) global T

axes(handles.axes2); T=getimage;

f=edge(handles.img,'canny'); imshow(f); handles.img=f;

guidata(hObject,handles);

³ÌÐò¹Ø¼ü²¿·Ö£ºÍ¨¹ýf=edge(handles.img,'canny');ÊÇʵÏÖ±ßÔµÐÅÏ¢µÄ»ñÈ¡¡£

32 / 52