已阅读5页,还剩3页未读, 继续免费阅读
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
图像增强GUI的fig界面图像增强GUI的结果界面其m文件见txt文件:图像增强GUI的m文件:function varargout = imageenhance(varargin)% IMAGEENHANCE MATLAB code for imageenhance.fig% IMAGEENHANCE, by itself, creates a new IMAGEENHANCE or raises the existing% singleton*.% H = IMAGEENHANCE returns the handle to a new IMAGEENHANCE or the handle to% the existing singleton*.% IMAGEENHANCE(CALLBACK,hObject,eventData,handles,.) calls the local% function named CALLBACK in IMAGEENHANCE.M with the given input arguments.% IMAGEENHANCE(Property,Value,.) creates a new IMAGEENHANCE or raises the% existing singleton*. Starting from the left, property value pairs are% applied to the GUI before imageenhance_OpeningFcn gets called. An% unrecognized property name or invalid value makes property application% stop. All inputs are passed to imageenhance_OpeningFcn via varargin.% *See GUI Options on GUIDEs Tools menu. Choose GUI allows only one% instance to run (singleton).% See also: GUIDE, GUIDATA, GUIHANDLES % Edit the above text to modify the response to help imageenhance % Last Modified by GUIDE v2.5 19-May-2012 20:00:36 % Begin initialization code - DO NOT EDITgui_Singleton = 1;gui_State = struct(gui_Name, mfilename, . gui_Singleton, gui_Singleton, . gui_OpeningFcn, imageenhance_OpeningFcn, . gui_OutputFcn, imageenhance_OutputFcn, . gui_LayoutFcn, , . gui_Callback, );if nargin & ischar(varargin1) gui_State.gui_Callback = str2func(varargin1);end if nargout varargout1:nargout = gui_mainfcn(gui_State, varargin:);else gui_mainfcn(gui_State, varargin:);end% End initialization code - DO NOT EDIT % - Executes just before imageenhance is made visible.function imageenhance_OpeningFcn(hObject, eventdata, handles, varargin)% This function has no output args, see OutputFcn.% hObject handle to figure% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)% varargin command line arguments to imageenhance (see VARARGIN) % Choose default command line output for imageenhancehandles.output = hObject; % Update handles structureguidata(hObject, handles); % UIWAIT makes imageenhance wait for user response (see UIRESUME)% uiwait(handles.figure1); % - Outputs from this function are returned to the command line.function varargout = imageenhance_OutputFcn(hObject, eventdata, handles) % varargout cell array for returning output args (see VARARGOUT);% hObject handle to figure% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA) % Get default command line output from handles structurevarargout1 = handles.output; % - Executes on button press in pushbutton1.function pushbutton1_Callback(hObject, eventdata, handles)% hObject handle to pushbutton1 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA) % - Executes on button press in loadimage2.function loadimage2_Callback(hObject, eventdata, handles)% hObject handle to loadimage2 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)global pic;fname pname index=uigetfile(*.jpg;*.bmp;*.gif);if indexstr=pname fnamepic=imread(str);%figure;imshow(pic);end; % - Executes on button press in pushbutton2.function pushbutton2_Callback(hObject, eventdata, handles)% hObject handle to pushbutton2 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)global pic;str=get(hObject,string);axes(handles.axes1);I=rgb2gray(pic);J=histeq(I); %figure;subplot(221),imshow(I),title(?-?);subplot(222),imshow(J),title(?oao?);subplot(223),imhist(I,64),title(?-?);subplot(224),imhist(J,64),title(?oa?o?);%figure;%subplot(121),imhist(I,64),title(?-?);subplot(122),imhist(J,64),title(?oao?); % - Executes on button press in loadimage1.function loadimage1_Callback(hObject, eventdata, handles)% hObject handle to loadimage1 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)global pic;fname pname index=uigetfile(*.jpg;*.bmp;*.gif);if indexstr=pname fnamepic=imread(str);%figure;imshow(pic);end; % - Executes when selected object is changed in multichoose.function multichoose_SelectionChangeFcn(hObject, eventdata, handles)% hObject handle to the selected object in multichoose % eventdata structure with the following fields (see UIBUTTONGROUP)% EventName: string SelectionChanged (read only)% OldValue: handle of the previously selected object or empty if none was selected% NewValue: handle of the currently selected object% handles structure with handles and user data (see GUIDATA)global pic;str=get(hObject,string);axes(handles.axes4);switch str case ?2 global pic; str=get(hObject,string); axes(handles.axes4); I=rgb2gray(pic); J1=imnoise(I,salt & pepper,0.02); J2=imnoise(I,gaussian,0.02); %average filter R1=filter2(fspecial(average,3),J1)/255; R2=filter2(fspecial(average,3),J2)/255; subplot(221),imshow(J1),title(?); subplot(222),imshow(J2),title(?1?); subplot(223),imshow(R1),title(D?2?); subplot(224),imshow(R2),title(D?1?2?); case?D?2 global pic; str=get(hObject,string); axes(handles.axes4); I=rgb2gray(pic); J1=imnoise(I,salt & pepper,0.02); J2=imnoise(I,gaussian,0.02); %median filter R1=medfilt2(J1,5,5); R2=medfilt2(J2,5,5); subplot(221),imshow(J1),title(?); subplot(222),imshow(J2),title(?1?); subplot(223),imshow(R1),title(D?D?2?); subplot(224),imshow(R2),title(D?1?D?2?); caseD?¥? global pic; str=get(hObject,string); axes(handles.axes4); I1=im2bw(pic); I2=rgb2gray(pic); se=strel(disk,5);R1=imdilate(I1,se);R2=imerode(I1,se); R5=imopen(I1,se);R6=imclose(I1,se); R3=imdilate(I2,se);R4=imerode(I2,se); R7=imopen(I2,se);R8=imclose(I2,se); subplot(521),imshow(R1),title(?t?o?); subplot(522),imshow(R3),title(?o?); subplot(523),imshow(R2),title(?t?o?); subplot(524),imshow(R4),title(?o?); subplot(525),imshow(R5),title(?t?a?o?); subplot(526),imshow(R7),title(?a?o?); subplot(527),imshow(R6),title(?t?o?); subplot(528),imshow(R8),title(?o?); end % - Executes during object creation, after setting all properties.function choose1_CreateFcn(hObject, eventdata, handles)% hObject handle to choose1 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles empty - handles not created until after all CreateFcns calledglobal pic;str=get(hObject,string); I=rgb2gray(pic);J1=imnoise(I,salt & pepper,0.02);J2=imnoise(I,gaussian,0.02);%average filterR1=filter2(fspecial(average,3),J1)/255;R2=filter2(fspecial(average,3),J2)/255; % - Executes during object creation, after setting all properties.function choose2_CreateFcn(hObject, eventdata, handles)% hObject handle to choose2 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles empty - handles not created until after all CreateFcns calledglobal pic;str=get(hObject,string); I=rgb2gray(pic);J1=imnoise(I,salt & pepper,0.02);J2=imnoise(I,gaussian,0.02);%median filterR3=medfilt2(J1,5,5);R4=medfilt2(J2,5,5); % - Executes during object creation, after setting all properties.function radiobutton4_CreateFcn(hObject, eventdata, handles)% hObject handle to radiobutton4 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles empty - handles not created until after all CreateFcns calledglobal pic;str=get(hObject,string); I1=im2bw(pic);I2=rgb2gray(pic); se=strel(disk,5);R1=imdilate(I1,se);R2=imerode(I1,se); R5=imopen(I1,se);R6=imclose(I1,se); R3=imdilate(I2,se);R4=imerode(I2,se); R7=imopen(I2,se);R8=imclose(I2,se); % - Executes on key press with focus on radiobutton4 and none of its controls.function radiobutton4_KeyPressFcn(hObject, eventdata, handles)% hObject handle to radiobutton4 (se
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 2026年全国中小学语文教师教育教学能力考试带答案
- 2026年考研会计学财务会计历年试题及答案
- 2026年食品知识培训试题带答案
- 2026年汉字应用模拟考试卷带答案
- 2026年胎盘早剥护理模拟试题及参考答案
- 人教版小学六年级数学平面几何知识巩固习题
- 2026年ESG报告合规与鉴证政策趋势与企业应对指南
- Senkyunolide-S-生命科学试剂-MCE
- 湖北省荆州市沙市区2026-2027学年八年级上学期11月期中历史试卷-原卷版
- 河北保定市高碑店市第二中学等学校2026-2027学年第一学年度期中教学质量监测九年级英语(含答案无听力音频及原文)
- (完整版)施工现场质量、安全生产管理体系
- 2026年上海市中考数学试卷(含答案)
- 2026墨西哥矿业开发行业市场深度调研及矿产资源勘探与开发规划报告
- 2025年山东省公务员招录考试《申论》(B卷)真题及答案
- ISO9001体系文件清单
- 固危废法律法规培训课件
- 定密责任人培训班试题及答案
- (外研2024版新教材)英语五上Unit 1基础测试卷(含答案+听力音频)
- 智慧高速机电系统集成方案指南
- 适航法规培训课件
- 表达感谢感激感恩的话
评论
0/150
提交评论