数字图像处理MATLAB函数源代码Word下载.docx
- 文档编号:20495539
- 上传时间:2023-01-23
- 格式:DOCX
- 页数:21
- 大小:17.73KB
数字图像处理MATLAB函数源代码Word下载.docx
《数字图像处理MATLAB函数源代码Word下载.docx》由会员分享,可在线阅读,更多相关《数字图像处理MATLAB函数源代码Word下载.docx(21页珍藏版)》请在冰豆网上搜索。
gui_OpeningFcn'
@DIP_OpeningFcn,...
gui_OutputFcn'
@DIP_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{:
%Endinitializationcode-DONOTEDIT
%---ExecutesjustbeforeDIPismadevisible.
functionDIP_OpeningFcn(hObject,eventdata,handles,varargin)
%Thisfunctionhasnooutputargs,seeOutputFcn.
%hObjecthandletofigure
%eventdatareserved-tobedefinedinafutureversionofMATLAB
%handlesstructurewithhandlesanduserdata(seeGUIDATA)
%varargincommandlineargumentstoDIP(seeVARARGIN)
%ChoosedefaultcommandlineoutputforDIP
handles.output=hObject;
%Updatehandlesstructure
guidata(hObject,handles);
%UIWAITmakesDIPwaitforuserresponse(seeUIRESUME)
%uiwait(handles.DIP);
set(handles.Menu2,'
Enable'
'
off'
);
%在打开图片前其他下拉菜单不可用
set(handles.Menu3,'
set(handles.Menu4,'
set(handles.Menu5,'
set(handles.Menu6,'
set(handles.Menu7,'
set(handles.Menu8,'
set(handles.Menu9,'
setappdata(handles.DIP,'
IM'
0);
%---Outputsfromthisfunctionarereturnedtothecommandline.
functionvarargout=DIP_OutputFcn(hObject,eventdata,handles)
%varargoutcellarrayforreturningoutputargs(seeVARARGOUT);
%Getdefaultcommandlineoutputfromhandlesstructure
varargout{1}=handles.output;
%---Executesonbuttonpressinfile_open.
functionfile_open_Callback(hObject,eventdata,handles)
%hObjecthandletofile_open(seeGCBO)
globalIM%定义一个全局变量im
[filename,pathname]=uigetfile({'
*.bmp'
;
'
*.tif'
*.png'
*.jpg'
},'
selectpicture'
%选择图片路径
ifisequal(filename,0)||isequal(pathname,0),
return;
str=[pathnamefilename];
%合成路径+文件名
IM=imread(str);
%读取图片
axes(handles.axes1);
%使用第一个axes
imshow(IM);
%显示图片
%axes(handles.axes2);
%clareset;
on'
%在打开图片后其他下拉菜单可用set(handles.Menu3,'
IM);
%--------------------------------------------------------------------
functionMenu1_Callback(hObject,eventdata,handles)
%hObjecthandletoMenu1(seeGCBO)
functionMenu1_1_Callback(hObject,eventdata,handles)
%hObjecthandletoMenu1_1(seeGCBO)
globalIM%定义一个全局变量IM
[filename,pathname]=uigetfile({'
ifisequal(filename,0)||isequal(pathname,0),
functionMenu1_2_Callback(hObject,eventdata,handles)
%hObjecthandletoMenu1_2(seeGCBO)
globalBW%定义处理后的图片BW这个全局变量[filename,pathname,filterindex]=...
uiputfile({'
savepicture'
%存储图片路径
iffilterindex==0
return%如果取消操作,返回
str=[pathnamefilename];
axes(handles.axes2);
%使用第二个axesimwrite(BW,str);
%写入图片信息,即保存图片
functionMenu1_3_Callback(hObject,eventdata,handles)
%hObjecthandletoMenu1_3(seeGCBO)
close(gcf)%关闭当前Figure窗口句柄
functionMenu1_4_Callback(hObject,eventdata,handles)
%hObjecthandletoMenu1_4(seeGCBO)
globalIM;
[filename,pathname,filterindex]=...
return
axes(handles.axes2);
imwrite(IM,str);
functionMenu2_Callback(hObject,eventdata,handles)
%hObjecthandletoMenu4(seeGCBO)
functionMenu2_1_Callback(hObject,eventdata,handles)
%hObjecthandletoMenu2_1(seeGCBO)
functionMenu2_1_1_Callback(hObject,eventdata,handles)
%hObjecthandletoMenu2_1_1(seeGCBO)
globalBW;
BW=imresize(IM,0.3,'
nearest'
imshow(BW,[]);
functionMenu2_1_2_Callback(hObject,eventdata,handles)
%hObjecthandletoMenu2_1_2(seeGCBO)
BW=imresize(IM,0.1,'
bilinear'
functionMenu2_1_3_Callback(hObject,eventdata,handles)
%hObjecthandletoMenu2_1_3(seeGCBO)
bicubic'
functionMenu2_2_Callback(hObject,eventdata,handles)
%hObjecthandletoMenu2_2(seeGCBO)
H=rotate;
functionMenu2_3_Callback(hObject,eventdata,handles)
%hObjecthandletoMenu2_3(seeGCBO)
set(handles.main_txt,'
FontName'
'
宋体'
);
String'
请选择要裁剪的局域,并双击选定区域以显示!
waitforbuttonpress;
BW=imcrop(IM);
imshow(BW);
Calibri'
Welcome!
functionMenu2_4_Callback(hObject,eventdata,handles)
%hObjecthandletoMenu2_4(seeGCBO)
functionMenu2_4_1_Callback(hObject,eventdata,handles)
%hObjecthandletoMenu2_4_1(seeGCBO)
snoise=0.15*randn(size(IM));
BW=imadd(IM,im2uint8(snoise));
functionMenu2_4_2_Callback(hObject,eventdata,handles)
%hObjecthandletoMenu2_4_2(seeGCBO)
BW=imnoise(IM,'
salt&
pepper'
0.05);
functionMenu2_5_Callback(hObject,eventdata,handles)
%hObjecthandletoMenu2_5(seeGCBO)
%eventdatareserved-tob
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 数字图像 处理 MATLAB 函数 源代码
![提示](https://static.bdocx.com/images/bang_tan.gif)