matlab图像处理程序.docx
- 文档编号:4104249
- 上传时间:2023-05-06
- 格式:DOCX
- 页数:9
- 大小:15.56KB
matlab图像处理程序.docx
《matlab图像处理程序.docx》由会员分享,可在线阅读,更多相关《matlab图像处理程序.docx(9页珍藏版)》请在冰点文库上搜索。
matlab图像处理程序
functionvarargout=lee(varargin)
%LEEMATLABcodeforlee.fig
%LEE,byitself,createsanewLEEorraisestheexisting
%singleton*.
%
%H=LEEreturnsthehandletoanewLEEorthehandleto
%theexistingsingleton*.
%
%LEE('CALLBACK',hObject,eventData,handles,...)callsthelocal
%functionnamedCALLBACKinLEE.Mwiththegiveninputarguments.
%
%LEE('Property','Value',...)createsanewLEEorraisesthe
%existingsingleton*.Startingfromtheleft,propertyvaluepairsare
%appliedtotheGUIbeforelee_OpeningFcngetscalled.An
%unrecognizedpropertynameorinvalidvaluemakespropertyapplication
%stop.Allinputsarepassedtolee_OpeningFcnviavarargin.
%
%*SeeGUIOptionsonGUIDE'sToolsmenu.Choose"GUIallowsonlyone
%instancetorun(singleton)".
%
%Seealso:
GUIDE,GUIDATA,GUIHANDLES
%Edittheabovetexttomodifytheresponsetohelplee
%LastModifiedbyGUIDEv2.502-Sep-201212:
36:
56
%Begininitializationcode-DONOTEDIT
gui_Singleton=1;
gui_State=struct('gui_Name',mfilename,...
'gui_Singleton',gui_Singleton,...
'gui_OpeningFcn',@lee_OpeningFcn,...
'gui_OutputFcn',@lee_OutputFcn,...
'gui_LayoutFcn',[],...
'gui_Callback',[]);
ifnargin&&ischar(varargin{1})
gui_State.gui_Callback=str2func(varargin{1});
end
ifnargout
[varargout{1:
nargout}]=gui_mainfcn(gui_State,varargin{:
});
else
gui_mainfcn(gui_State,varargin{:
});
end
%Endinitializationcode-DONOTEDIT
%---Executesjustbeforeleeismadevisible.
functionlee_OpeningFcn(hObject,eventdata,handles,varargin)
%Thisfunctionhasnooutputargs,seeOutputFcn.
%hObjecthandletofigure
%eventdatareserved-tobedefinedinafutureversionofMATLAB
%handlesstructurewithhandlesanduserdata(seeGUIDATA)
%varargincommandlineargumentstolee(seeVARARGIN)
%Choosedefaultcommandlineoutputforlee
handles.output=hObject;
%Updatehandlesstructure
guidata(hObject,handles);
%UIWAITmakesleewaitforuserresponse(seeUIRESUME)
%uiwait(handles.figure1);
%---Outputsfromthisfunctionarereturnedtothecommandline.
functionvarargout=lee_OutputFcn(hObject,eventdata,handles)
%varargoutcellarrayforreturningoutputargs(seeVARARGOUT);
%hObjecthandletofigure
%eventdatareserved-tobedefinedinafutureversionofMATLAB
%handlesstructurewithhandlesanduserdata(seeGUIDATA)
%Getdefaultcommandlineoutputfromhandlesstructure
varargout{1}=handles.output;
%---Executesonbuttonpressinpushbutton1.
functionpushbutton1_Callback(hObject,eventdata,handles)
%hObjecthandletopushbutton1(seeGCBO)
%eventdatareserved-tobedefinedinafutureversionofMATLAB
%handlesstructurewithhandlesanduserdata(seeGUIDATA)
globalim1str;
[filename,pathname]=...
uigetfile({'*.jpg';'*.bmp';'*.png';'*.gif'},'选择图片');
str=[pathname,filename];
im1=imread(str);
axes(handles.axes1);
imshow(im1);
%---Executesonbuttonpressinpushbutton2.
functionpushbutton2_Callback(hObject,eventdata,handles)
%hObjecthandletopushbutton2(seeGCBO)
%eventdatareserved-tobedefinedinafutureversionofMATLAB
%handlesstructurewithhandlesanduserdata(seeGUIDATA)
%---Executesonbuttonpressinpushbutton3.
functionpushbutton3_Callback(hObject,eventdata,handles)
%hObjecthandletopushbutton3(seeGCBO)
%eventdatareserved-tobedefinedinafutureversionofMATLAB
%handlesstructurewithhandlesanduserdata(seeGUIDATA)
%---Executesonbuttonpressinpushbutton4.
functionpushbutton4_Callback(hObject,eventdata,handles)
%hObjecthandletopushbutton4(seeGCBO)
%eventdatareserved-tobedefinedinafutureversionofMATLAB
%handlesstructurewithhandlesanduserdata(seeGUIDATA)
%---Executesonbuttonpressinpushbutton5.
functionpushbutton5_Callback(hObject,eventdata,handles)
%hObjecthandletopushbutton5(seeGCBO)
%eventdatareserved-tobedefinedinafutureversionofMATLAB
%handlesstructurewithhandlesanduserdata(seeGUIDATA)
globalim1;
im2=im1;
%im2=im2bw(im2,0.5);
[No_dither,map]=rgb2ind(im2,8,'nodither');
axes(handles.axes2);
imshow(No_dither,map);
%imshow(im2);
%---Executesonbuttonpressinpushbutton6.
functionpushbutton6_Callback(hObject,eventdata,handles)
%hObjecthandletopushbutton6(seeGCBO)
%eventdatareserved-tobedefinedinafutureversionofMATLAB
%handlesstructurewithhandlesanduserdata(seeGUIDATA)
globalim1;
im2=im1;
im3=im2bw(im2,0.7);
im5=im2bw(im2,0.3);
mov1=cat(2,im3,im3);
mov2=cat(2,im5,im5);
mov3=cat(1,mov1,mov2);
axes(handles.axes2);
imshow(mov3);
%---Executesonbuttonpressinpushbutton7.
functionpushbutton7_Callback(hObject,eventdata,handles)
%hObjecthandletopushbutton7(seeGCBO)
%eventdatareserved-tobedefinedinafutureversionofMATLAB
%handlesstructurewithhandlesanduserdata(seeGUIDATA)
globalim1str;
im2=im1;
%[im3,map]=rgb2ind(im2,128);
%mov=immovie(im3,map);
%axes(handles.axes2);
%movie(mov,1);
mri=uint8(zeros(128,128,1,27));
forframe=1:
27
[mri(:
:
:
frame),map]=imread('mri.tif',frame);
end
mov=immovie(mri,map);
figure;
movie(mov);
%---Executesonbuttonpressinpushbutton8.
functionpushbutton8_Callback(hObject,eventdata,handles)
%hObjecthandletopushbutton8(seeGCBO)
%eventdatareserved-tobedefinedinafutureversionofMATLAB
%handlesstructurewithhandlesanduserdata(seeGUIDATA)
clearall;
close(gcf);
%---Executesonbuttonpressinpushbutton9.
functionpushbutton9_Callback(hObject,eventdata,handles)
%hObjecthandletopushbutton9(seeGCBO)
%eventdatareserved-tobedefinedinafutureversionofMATLAB
%handlesstructurewithhandlesanduserdata(seeGUIDATA)
mri=uint8(zeros(128,128,1,27));
forframe=1:
27
[mri(:
:
:
frame),map]=imread('mri.tif',frame);
end
axes(handles.axes2);
montage(mri,map);
%---Executesonbuttonpressinpushbutton10.
functionpushbutton10_Callback(hObject,eventdata,handles)
%hObjecthandletopushbutton10(seeGCBO)
%eventdatareserved-tobedefinedinafutureversionofMATLAB
%handlesstructurewithhandlesanduserdata(seeGUIDATA)
globalim1;
im2=im1;
[x,y,z]=sphere;
warp(x,y,z,im2);
%---Executesonbuttonpressinpushbutton12.
functionpushbutton12_Callback(hObject,eventdata,handles)
%hObjecthandletopushbutton12(seeGCBO)
%eventdatareserved-tobedefinedinafutureversionofMATLAB
%handlesstructurewithhandlesanduserdata(seeGUIDATA)
globalim1;
im2=im1;
im2=imrotate(im2,60,'bilinear');
axes(handles.axes2);
imshow(im2);
%---Executesonbuttonpressinpushbutton16.
functionpushbutton16_Callback(hObject,eventdata,handles)
%hObjecthandletopushbutton16(seeGCBO)
%eventdatareserved-tobedefinedinafutureversionofMATLAB
%handlesstructurewithhandlesanduserdata(seeGUIDATA)
globalim1;
im2=im1;
axes(handles.axes2);
imshow(im2);
im3=imcrop;
imshow(im3);
%---Executesonbuttonpressinpushbutton17.
functionpushbutton17_Callback(hObject,eventdata,handles)
%hObjecthandletopushbutton17(seeGCBO)
%eventdatareserved-tobedefinedinafutureversionofMATLAB
%handlesstructurewithhandlesanduserdata(seeGUIDATA)
im2=imread('tire.tif');
f=inline('max(x(:
))');
im3=nlfilter(im2,[3,3],f);
axes(handles.axes2);
imshow(im2);
imshow(im3);
%---Executesonbuttonpressinpushbutton18.
functionpushbutton18_Callback(hObject,eventdata,handles)
%hObjecthandletopushbutton18(seeGCBO)
%eventdatareserved-tobedefinedinafutureversionofMATLAB
%handlesstructurewithhandlesanduserdata(seeGUIDATA)
globalim1;
im2=im1;
im2=im2bw(im2);
%im2=imread('pout.tif');
axes(handles.axes2);
imshow(im2);
BW=roipoly;
h=fspecial('unsharp');
im3=roifilt2(h,im2,BW);
imshow(im2);
figure;imshow(im3);
%---Executesonbuttonpressinpushbutton19.
functionpushbutton19_Callback(hObject,eventdata,handles)
%hObjecthandletopushbutton19(seeGCBO)
%eventdatareserved-tobedefinedinafutureversionofMATLAB
%handlesstructurewithhandlesanduserdata(seeGUIDATA)
globalim1;
im2=im1;
im2=rgb2gray(im2);
%im3=ind2gray(X,map);
axes(handles.axes2);
imshow(im2);
im3=roifill;
imshow(im3);
%---Executesonbuttonpressinpushbutton20.
functionpushbutton20_Callback(hObject,eventdata,handles)
%hObjecthandletopushbutton20(seeGCBO)
%eventdatareserved-tobedefinedinafutureversionofMATLAB
%handlesstructurewithhandlesanduserdata(seeGUIDATA)
globalim1;
im2=im1;
im2=im2bw(im2);
%im2=mat2gray(im2);
im3=edge(im2);
axes(handles.axes2);
imshow(im3);
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- matlab 图像 处理 程序
![提示](https://static.bingdoc.com/images/bang_tan.gif)