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;
没有合适的资源?快使用搜索试试~ 我知道了~
【图像边缘检测】Sobel+Prewitt+Canny算子图像边缘检测(带面板)【含Matlab源码 1045期】.zip
共7个文件
png:5个
m:1个
fig:1个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 18 浏览量
2024-06-20
16:27:56
上传
评论
收藏 1MB ZIP 举报
温馨提示
Matlab领域上传的代码均可运行,亲测可用,直接替换数据即可,适合小白; 1、代码压缩包内容 主函数:main.m; 调用函数:其他m文件;无需运行 运行结果效果图; 2、代码运行版本 Matlab 2019b;若运行有误,根据提示修改;若不会,私信博主; 3、运行操作步骤 步骤一:将所有文件放到Matlab的当前文件夹中; 步骤二:双击打开main.m文件; 步骤三:点击运行,等程序运行完得到结果; 4、仿真咨询 如需其他服务,可私信博主或扫描博客文章底部QQ名片; 4.1 博客或资源的完整代码提供 4.2 期刊或参考文献复现 4.3 Matlab程序定制 4.4 科研合作 图像边缘检测: Snake模型、八方向、CNN、积累加权、 Sobel+Prewitt+Canny+Robert算子图像边缘检测 蚁群算法、模拟退火算法、蚁群聚类图像边缘检测 元胞自动机图像边缘检测 插值法亚像素、Zernike矩亚像素边缘检测 拉普拉斯算法图像边缘检测
资源推荐
资源详情
资源评论
收起资源包目录
【图像边缘检测】 GUI Sobel+Prewitt+Canny算子图像边缘检测(带面板)【含Matlab源码 1045期】.zip (7个子文件)
【图像边缘检测】基于matlab GUI Sobel+Prewitt+Canny算子图像边缘检测(带面板)【含Matlab源码 1045期】
guipic.m 4KB
风景图.PNG 542KB
运行结果4.PNG 73KB
运行结果2.PNG 58KB
guipic.fig 6KB
运行结果3.PNG 58KB
运行结果1.PNG 299KB
共 7 条
- 1
资源评论
Matlab领域
- 粉丝: 3w+
- 资源: 3183
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功