function varargout = untitled(varargin)
% UNTITLED MATLAB code for untitled.fig
% UNTITLED, by itself, creates a new UNTITLED or raises the existing
% singleton*.
%
% H = UNTITLED returns the handle to a new UNTITLED or the handle to
% the existing singleton*.
%
% UNTITLED('CALLBACK',hObject,eventData,handles,...) calls the local
% function named CALLBACK in UNTITLED.M with the given input arguments.
%
% UNTITLED('Property','Value',...) creates a new UNTITLED or raises the
% existing singleton*. Starting from the left, property value pairs are
% applied to the GUI before untitled_OpeningFcn gets called. An
% unrecognized property name or invalid value makes property application
% stop. All inputs are passed to untitled_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 untitled
% Last Modified by GUIDE v2.5 26-Nov-2022 12:19:23
% Begin initialization code - DO NOT EDIT
gui_Singleton = 1;
gui_State = struct('gui_Name', mfilename, ...
'gui_Singleton', gui_Singleton, ...
'gui_OpeningFcn', @untitled_OpeningFcn, ...
'gui_OutputFcn', @untitled_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 untitled is made visible.
function untitled_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 untitled (see VARARGIN)
% Choose default command line output for untitled
handles.output = hObject;
% Update handles structure
guidata(hObject, handles);
% UIWAIT makes untitled wait for user response (see UIRESUME)
% uiwait(handles.figure1);
% --- Outputs from this function are returned to the command line.
function varargout = untitled_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;
function edit_sourimg_Callback(hObject, eventdata, handles)
% hObject handle to edit_sourimg (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hints: get(hObject,'String') returns contents of edit_sourimg as text
% str2double(get(hObject,'String')) returns contents of edit_sourimg as a double
% --- Executes during object creation, after setting all properties.
function edit_sourimg_CreateFcn(hObject, eventdata, handles)
% hObject handle to edit_sourimg (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called
% Hint: edit controls usually have a white background on Windows.
% See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white');
end
function edit2_Callback(hObject, eventdata, handles)
% hObject handle to edit2 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hints: get(hObject,'String') returns contents of edit2 as text
% str2double(get(hObject,'String')) returns contents of edit2 as a double
% --- Executes during object creation, after setting all properties.
function edit2_CreateFcn(hObject, eventdata, handles)
% hObject handle to edit2 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called
% Hint: edit controls usually have a white background on Windows.
% See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white');
end
% --- Executes on button press in button_inflation.
function button_inflation_Callback(hObject, eventdata, handles)%膨胀运算
% hObject handle to button_inflation (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 button_corrosion.
function button_corrosion_Callback(hObject, eventdata, handles)%腐蚀运算
% hObject handle to button_corrosion (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 button_open.
function button_open_Callback(hObject, eventdata, handles)%开运算
% hObject handle to button_open (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 button_close.
function button_close_Callback(hObject, eventdata, handles)%闭运算
% hObject handle to button_close (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 button_imgEnhance.
function button_imgEnhance_Callback(hObject, eventdata, handles)%工具按钮图像增强
% hObject handle to button_imgEnhance (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 button_segm.
function button_segm_Callback(hObject, eventdata, handles)%工具按钮图像分割
% hObject handle to button_segm (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 openImg.
function openImg_Callback(hObject, eventdata, handles)%菜单栏导入图片的控件
% hObject handle to openImg (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% axes(handles.show_sourImg);%导入图片到框1
% image=imread('fruit.jpg');%导入flower图片
% imshow(image);
% title('yy')
%支持用户自己选定图片,任何格式的图片
%%选定axes show_sourImg
% [filename,pathname]=uigetfile({'*.jpg';'*.bmp';'*.tif';'*.*'},'载入图像');
% if isequal(filename,0)||isequal(pathname,0)
% errordlg('没有选中文件','出错');
% return;
% else
% file=[pathname,filename];
% end
% pic = imread(file);
% axes(handles.show_sourImg);
% imshow(pic);
% title('原始图像','color','b');
[filename,pathname]=uigetfile(...
{'*.bmp;*.jpg;*.png;*.jpeg','ImageFiles(*.bmp,*.jpg,*.png,*.jpeg)';...
'*.*','AllFiles(*.*)'},...
'Pickanimage');
axes(handles.show_sourImg);
global fpath;%这个全局变量很重要,事关程序时候能正常运行,后续的全局变量也要用这个名字
fpath=[pathname filename];
img_1=imread(fpath);
imshow(img_1);
title('原始图像');
% --- Executes on button press in button_huidu.
function button_huidu_Callback(hObject, eventdata, handles)%工具按钮 灰度变化
% hObject handle to button_huidu (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with h
没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
收起资源包目录
jmageProcess.zip (8个子文件)
huidu.bmp 590KB
JT.bmp 634KB
pro_jiaoyanzaosheng.bmp 590KB
erzhi.bmp 589KB
fruit.jpg 18KB
untitled.m 29KB
untitled.fig 75KB
flower.jpg 11KB
共 8 条
- 1
资源评论
L洛L
- 粉丝: 1w+
- 资源: 4
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功