function varargout = RoundGUI(varargin)
% ROUNDGUI M-file for RoundGUI.fig
% ROUNDGUI, by itself, creates a new ROUNDGUI or raises the existing
% singleton*.
%
% H = ROUNDGUI returns the handle to a new ROUNDGUI or the handle to
% the existing singleton*.
%
% ROUNDGUI('Property','Value',...) creates a new ROUNDGUI using the
% given property value pairs. Unrecognized properties are passed via
% varargin to RoundGUI_OpeningFcn. This calling syntax produces a
% warning when there is an existing singleton*.
%
% ROUNDGUI('CALLBACK') and ROUNDGUI('CALLBACK',hObject,...) call the
% local function named CALLBACK in ROUNDGUI.M with the given input
% arguments.
%
% *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 RoundGUI
% Last Modified by GUIDE v2.5 27-May-2008 15:32:21
% Begin initialization code - DO NOT EDIT
gui_Singleton = 1;
gui_State = struct('gui_Name', mfilename, ...
'gui_Singleton', gui_Singleton, ...
'gui_OpeningFcn', @RoundGUI_OpeningFcn, ...
'gui_OutputFcn', @RoundGUI_OutputFcn, ...
'gui_LayoutFcn', [], ...
'gui_Callback', []);
if nargin & isstr(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 RoundGUI is made visible.
function RoundGUI_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 unrecognized PropertyName/PropertyValue pairs from the
% command line (see VARARGIN)
% Choose default command line output for RoundGUI
handles.output = hObject;
set(handles.filemenu,'ForeGroundColor','b');
% Update handles structure
guidata(hObject, handles);
set(gcf,'Color',[1,0.4,0.6])
% UIWAIT makes RoundGUI wait for user response (see UIRESUME)
% uiwait(handles.figure1);
dsp_head;
% --- Outputs from this function are returned to the command line.
function varargout = RoundGUI_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 filemenu_Callback(hObject, eventdata, handles)
% hObject handle to filemenu (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% --------------------------------------------------------------------
function openimgmenu_Callback(hObject, eventdata, handles)
% hObject handle to openimgmenu (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
global Archivo NameArchivo Img
set(handles.saveimgmenu,'enable','off');
[NameArchivo,PathArchivo] = uigetfile({'*.bmp';'*.jpg';'*.gif';'*.tif';'*.png';'*.hdf';'*.pcx';'*.xwd';'*.ico';'*.cur';'*.ras';'*.pbm';'*.pgm';'*.psd'},'File Selector');
if ~isequal(NameArchivo,0)
Archivo=strcat(PathArchivo,NameArchivo);
Img = imread(Archivo);
imshow( Img );title('Original Image');axis tight;
set(handles.saveimgmenu,'enable','on')
set(handles.viewmenu,'enable','on')
set(handles.imgprocess,'enable','on')
set(handles.roundishprocess,'enable','on')
set(handles.roundishanalysis,'enable','on')
end
% --------------------------------------------------------------------
function closeimgmenu_Callback(hObject, eventdata, handles)
% hObject handle to closeimgmenu (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
selection=questdlg('Do You Want To Close?','Close this image','Yes','No','Yes');
if strcmp(selection,'No')
return
end
delete( gcf );
% --------------------------------------------------------------------
function saveimgmenu_Callback(hObject, eventdata, handles)
% hObject handle to saveimgmenu (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
global Img
if isempty( Img ) == 1,msgbox('Dosenot exist an image');
return;
end
[filename,pathname,filterindex]=uiputfile({'*.jpg;*.gif;*.tif;*.bmp;*.png;*.hdf;*.pcx;*.xwd;*.ico;*.cur;*.ras;*.pbm;*.pgm;*.ppm'},'save file name');
if isequal(filename,0)|isequal(pathname,0)
errordlg('saving canceled','RoundishGUI');
else
try imwrite( Img,[filename,pathname]);
catch errordlg('Error during saving','RoundishGUI');
end
end
% --------------------------------------------------------------------
function viewmenu_Callback(hObject, eventdata, handles)
% hObject handle to viewmenu (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% --------------------------------------------------------------------
function imgprocess_Callback(hObject, eventdata, handles)
% hObject handle to imgprocess (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% --------------------------------------------------------------------
function roundishprocess_Callback(hObject, eventdata, handles)
% hObject handle to roundishprocess (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% --------------------------------------------------------------------
function roundishanalysis_Callback(hObject, eventdata, handles)
% hObject handle to roundishanalysis (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% --------------------------------------------------------------------
function bwimgmenu_Callback(hObject, eventdata, handles)
% hObject handle to bwimgmenu (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
global Img
flag = isrgb( Img );
logo = isgray( Img );
if flag
I = rgb2gray( Img );
elseif logo
I = Img;
end
level = graythresh( I );
BW = im2bw( I,level );
imshow( BW );axis tight;
% --------------------------------------------------------------------
function greyimgmenu_Callback(hObject, eventdata, handles)
% hObject handle to greyimgmenu (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
global Img
flag = isrgb( Img );
if flag
I=rgb2gray( Img );
elseif 1
I=Img;
end
imshow( I); axis tight;
% --- Executes on button press in bwbutton.
function bwbutton_Callback(hObject, eventdata, handles)
% hObject handle to bwbutton (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
global Img
if isrgb( Img )
I=rgb2gray( Img );
elseif isgray( Img );
I= Img;
end
I= imcomplement( I );
level=graythresh( I );
BW=im2bw( I,level );
BW=bwfill( BW,'holes',8 );
imshow( BW );
Img=BW;axis tight;
% --- Executes on button press in greybutton.
% ------------------------------------------------------------
Mymatlab.rar_Mymatlab 分割_binarization_statistical image _粒径_颗粒 图
版权申诉
5星 · 超过95%的资源 105 浏览量
2022-07-15
09:39:44
上传
评论
收藏 733KB RAR 举报
JaniceLu
- 粉丝: 82
- 资源: 1万+
最新资源
- 树莓派连接 DS18B20 温度传感器读取温度时监控客户端,服务器端连接状况,实现断线重连机制
- jQuery 3.7.1
- 校园失物招领小程序源码可作毕业设计
- SAP客户端GUI740安装包(JAVA版本)
- winlibs-x86-64-posix-seh-gcc-13.2.0-llvm-16.0.6-mingw-w64msvcrt
- HTML5小游戏【愤怒的小红帽-优秀H5小游戏合集射击游戏-过关游戏】游戏源码分享下载 - fndxhm.zip
- 医学影像处理-图像分割-肿瘤识别-诊断辅助-matlab图像分割肿瘤代码-DeepBTSeg.zip
- 抖音取图表情包小程序源码+创作者入驻+流量主
- 数字电子-JK触发器-可逆计数器-教学模拟-同步六进制加减法可逆计数器(JK).ms7.zip
- 小程序项目源码之熊猫签证.zip
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈