function varargout = guipic(varargin)
% GUIPIC MATLAB code for guipic.fig
% GUIPIC, by itself, creates a new GUIPIC or raises the existing
% singleton*.
%
% H = GUIPIC returns the handle to a new GUIPIC or the handle to
% the existing singleton*.
%
% GUIPIC('CALLBACK',hObject,eventData,handles,...) calls the local
% function named CALLBACK in GUIPIC.M with the given input arguments.
%
% GUIPIC('Property','Value',...) creates a new GUIPIC or raises the
% existing singleton*. Starting from the left, property value pairs are
% applied to the GUI before guipic_OpeningFcn gets called. An
% unrecognized property name or invalid value makes property application
% stop. All inputs are passed to guipic_OpeningFcn via varargin.
%
% *See GUI Options on GUIDE's 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 guipic
% Last Modified by GUIDE v2.5 13-Mar-2021 17:27:58
% Begin initialization code - DO NOT EDIT
gui_Singleton = 1;
gui_State = struct('gui_Name', mfilename, ...
'gui_Singleton', gui_Singleton, ...
'gui_OpeningFcn', @guipic_OpeningFcn, ...
'gui_OutputFcn', @guipic_OutputFcn, ...
'gui_LayoutFcn', [] , ...
'gui_Callback', []);
if nargin && ischar(varargin{1})
gui_State.gui_Callback = str2func(varargin{1});
end
if nargout
[varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:});
else
gui_mainfcn(gui_State, varargin{:});
end
% End initialization code - DO NOT EDIT
% --- Executes just before guipic is made visible.
function guipic_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 guipic (see VARARGIN)
% Choose default command line output for guipic
handles.output = hObject;
% Update handles structure
guidata(hObject, handles);
% UIWAIT makes guipic wait for user response (see UIRESUME)
% uiwait(handles.figure1);
% --- Outputs from this function are returned to the command line.
function varargout = guipic_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 structure
varargout{1} = handles.output;
% --- Executes on button press in ok.
function ok_Callback(hObject, eventdata, handles)
% hObject handle to ok (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
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 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;


Matlab领域
- 粉丝: 3w+
- 资源: 3898
最新资源
- 管家婆辉煌食品版TOP+15.0
- 《计算机编程 2 级存储库》(毕业设计,源码,教程)简单部署即可运行 功能完善、操作简单,适合毕设或课程设计.zip
- 基于Comsol的电力变压器匝间故障计算模型研究:电磁场与电路的物理场分析及其应用,Comsol电力变压器匝间故障计算模型:基于电磁场与电路物理场研究,分析匝间绝缘故障下的电磁场分布及电压电流计算结果
- 《基于机器学习开发的验光平台》(毕业设计,源码,教程)简单部署即可运行 功能完善、操作简单,适合毕设或课程设计.zip
- 基于Maxwell的8极12槽内置式永磁同步电机设计:“一”字与“V”型转子结构性能对比及建模学习,基于Maxwell的8极12槽内置式永磁同步电机设计:“一”字与“V”型转子结构性能对比及建模学习指
- 《用于电动遥控赛车的单圈计时器》(毕业设计,源码,教程)简单部署即可运行 功能完善、操作简单,适合毕设或课程设计.zip
- 基于STM32的FOC弦波无刷电机控制方法与源码解析,含Video教程分享,基于STM32的FOC弦波无刷电机控制源码分享及视频教程揭秘,foc 基于stm32 弦波无刷电机控制资料 源码 带vide
- STM32 普通IO模拟串口UART(完整代码-已编译验证)
- 《免费数电-Multisim电路仿真大合集(120例)-电子类专业实验/毕设实战资源库》
- 《大创项目 基于机器学习开发的预测经济增长软件》(毕业设计,源码,教程)简单部署即可运行 功能完善、操作简单,适合毕设或课程设计.zip
- 基于DBSCAN密度聚类算法的优化风电-负荷场景生成与削减模型研究,基于DBSCAN密度聚类的风电-负荷场景生成与削减策略,基于DBSCAN密度聚类的风电-负荷场景削减方法 关键词:密度聚类 场景削减
- 《使用神经网络和机器学习的自主缩小模型汽车的开发》(毕业设计,源码,教程)简单部署即可运行 功能完善、操作简单,适合毕设或课程设计.zip
- 基于Simulink仿真的单相PWM整流无桥图腾柱pfc技术研究:220V输入电压,500V输出电压,低纹波,高功率因数,低电流THD,开关频率达20kHz,电力电子入门学习指南 ,基于Simulin
- COMSOL交流电弧模型的多物理场耦合研究:涵盖温度场、流体场与电磁场分析的参考指南,基于多物理场耦合的COMSOL交流电弧模型:涵盖温度场、流体场与电磁场综合分析参考指南,[COMSOL交流电弧模型
- 基于Swing库的Java简易俄罗斯方块游戏开发教程与代码解析
- 图像识别拍照以及保存图片
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈


