



免费预览已结束,剩余1页可下载查看
下载本文档
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
function varargout = mygui(varargin)% MYGUI M-file for mygui.fig% MYGUI, by itself, creates a new MYGUI or raises the existing% singleton*.% H = MYGUI returns the handle to a new MYGUI or the handle to% the existing singleton*.% MYGUI(CALLBACK,hObject,eventData,handles,.) calls the local% function named CALLBACK in MYGUI.M with the given input arguments.% MYGUI(Property,Value,.) creates a new MYGUI or raises the% existing singleton*. Starting from the left, property value pairs are% applied to the GUI before mygui_OpeningFcn gets called. An% unrecognized property name or invalid value makes property application% stop. All inputs are passed to mygui_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 mygui% Last Modified by GUIDE v2.5 18-May-2012 15:45:08% Begin initialization code - DO NOT EDITgui_Singleton = 1;gui_State = struct(gui_Name, mfilename, . gui_Singleton, gui_Singleton, . gui_OpeningFcn, mygui_OpeningFcn, . gui_OutputFcn, mygui_OutputFcn, . gui_LayoutFcn, , . gui_Callback, );if nargin & ischar(varargin1) gui_State.gui_Callback = str2func(varargin1);endif nargout varargout1:nargout = gui_mainfcn(gui_State, varargin:);else gui_mainfcn(gui_State, varargin:);end% End initialization code - DO NOT EDIT% - Executes just before mygui is made visible.function mygui_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 mygui (see VARARGIN)% Choose default command line output for myguihandles.output = hObject;% Update handles structureguidata(hObject, handles);% UIWAIT makes mygui wait for user response (see UIRESUME)% uiwait(handles.figure1);% - Outputs from this function are returned to the command line.function varargout = mygui_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)global im;filename pathname=uigetfile(*.jpg;*.bmp;*.gif,选择图片);str=pathname filename;im=imread(str);axes(handles.axes1);imshow(im);% - 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)close(gcf);% - Executes on button press in pushbutton3.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)% - Executes when selected object is changed in uipanel1.function uipanel1_SelectionChangeFcn(hObject, eventdata, handles)% hObject handle to the selected object in uipanel1 % 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 im;str=get(hObject,string);axes(handles.axes1);switch str case 原图 imshow(im); case sobel BW=edge(rgb2gray(im),sobel); imshow(BW); case prewitt BW=edge(rgb2gray(im),prewitt); imshow(BW); case canny BW=edge(rgb2gray(im),canny); imshow(BW);end% - Executes on selection change in popupmenu1.function popupmenu1_Callback(hObject, eventdata, handles)% hObject handle to popupmenu1 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)% Hints: contents = cellstr(get(hObject,String) returns popupmenu1 contents as cell array% contentsget(hObject,Value) returns selected item from popupmenu1% - Executes during object creation, after setting all properties.function popupmenu1_CreateFcn(hObject, eventdata, handles)% hObject handle to popupmenu1 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles empty - handles not created until after all CreateFcns called% Hint: popupmenu controls usually have a white background on Windows.% See ISPC and COMPUTER.if ispc & isequal(get(hObject,BackgroundColor), get(0,defaultUicontrolBackgroundColor) set
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 2025年天津市南开区天津大学附小小升初语文试卷
- 强对流天气安全科普题库及答案解析
- 4s店安全培训试题及答案解析
- 甲乙酮装置操作工设备维护与保养考核试卷及答案
- 2025年上海市安全员C证题库及答案解析
- 起重工安全操作考试题库及答案解析
- 2025年食品安全考试试题库+答案
- 车间安全赦与培训试题及答案解析
- 2025年上海市安全b证考试题库及答案解析
- 机场雷达操纵修理工岗前考核试卷及答案
- 浦南运河建设方案
- 2024年4月自考00634广告策划试题
- 沪教版九年级上册化学第三章《物质构成的奥秘》检测卷(含答案解析)
- 如何与客户建立有效的沟通
- 薯片加工项目规划设计方案
- 部编版小学数学六年级上册分数乘法应用题解法一:找单位“1”解析同步练习
- 职业教育课题申报:产教融合背景下职业院校“四位一体”校企合作模式研究与实践
- 效益工资发放审批表
- 土壤的环境背景值与容量
- GB/T 26399-2011电力系统安全稳定控制技术导则
- 电动葫芦检查安装检查验收使用表格
评论
0/150
提交评论