【圖像分割】基于迭代闕值選擇、最大類間差、區(qū)域生長多種算法實(shí)現(xiàn)圖像分割含Matlab源碼
【圖像分割】基于迭代闕值選擇、最大類間差、區(qū)域生長多種算法實(shí)現(xiàn)圖像分割含Matlab源碼
1 簡(jiǎn)介
重點(diǎn)討論了圖像分割法中的閾值研究法,包括迭代闕值選擇、最大類間差、區(qū)域生長進(jìn)行了重點(diǎn)分析,用Matlab進(jìn)行實(shí)現(xiàn)并給出了實(shí)驗(yàn)結(jié)果.
2 部分代碼
function varargout = ImageDivision(varargin)
%
IMAGEDIVISION M-file
for
ImageDivision.fig
%
IMAGEDIVISION, by itself, creates a new IMAGEDIVISION or raises the existing
%
singleton*.
%
%
H = IMAGEDIVISION returns the handle to a new IMAGEDIVISION or the handle to
%
the existing singleton*.
%
%
IMAGEDIVISION(
’CALLBACK’
,hObject,eventData,handles,...) calls the
local
%
function
named CALLBACK
in
IMAGEDIVISION.M with the given input arguments.
%
%
IMAGEDIVISION(
’Property’
,
’Value’
,...) creates a new IMAGEDIVISION or raises the
%
existing singleton*. Starting from the left, property value pairs are
%
applied to the GUI before ImageDivision_OpeningFcn gets called. An
%
unrecognized property name or invalid value makes property application
%
stop. All inputs are passed to ImageDivision_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 ImageDivision
%
Last Modified by GUIDE v2.5 26-Aug-2013 17:11:44
%
Begin initialization code - DO NOT EDIT
gui_Singleton = 1;
gui_State = struct(’gui_Name’, mfilename, ...
’gui_Singleton’, gui_Singleton, ...
’gui_OpeningFcn’, @ImageDivision_OpeningFcn, ...
’gui_OutputFcn’, @ImageDivision_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 ImageDivision is made visible.
function ImageDivision_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 ImageDivision (see VARARGIN)
%
Choose default command line output for ImageDivision
handles.output = hObject;
%
Update handles structure
guidata(hObject, handles);
%
UIWAIT makes ImageDivision wait for user response (see UIRESUME)
%
uiwait(handles.figure1);
%
--- Outputs from this function are returned to the command line.
function varargout = ImageDivision_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 file_Callback(hObject, eventdata, handles)
%
hObject handle to file (see GCBO)
%
eventdata reserved - to be defined in a future version of MATLAB
%
handles structure with handles and user data (see GUIDATA)
%
--------------------------------------------------------------------
function MorphProcessing_Callback(hObject, eventdata, handles)
%
hObject handle to MorphProcessing (see GCBO)
%
eventdata reserved - to be defined in a future version of MATLAB
%
handles structure with handles and user data (see GUIDATA)
%
--------------------------------------------------------------------
function ImageDilate_Callback(hObject, eventdata, handles)
%
hObject handle to ImageDilate (see GCBO)
%
eventdata reserved - to be defined in a future version of MATLAB
%
handles structure with handles and user data (see GUIDATA)
set(handles.axes2,’HandleVisibility’,’ON’);
axes(handles.axes2);
I=handles.img;
se=strel(’disk’,1);
I2=imdilate(I,se);
imshow(I2);
set(handles.axes2,’HandleVisibility’,’OFF’);
%
--------------------------------------------------------------------
function ImgErode_Callback(hObject, eventdata, handles)
%
hObject handle to ImgErode (see GCBO)
%
eventdata reserved - to be defined in a future version of MATLAB
%
handles structure with handles and user data (see GUIDATA)
set(handles.axes2,’HandleVisibility’,’ON’);
axes(handles.axes2);
I=handles.img;
se=strel(’disk’,1);
I2=imerode(I,se);
imshow(I2);
set(handles.axes2,’HandleVisibility’,’OFF’);
%
--------------------------------------------------------------------
function ImgOpen_Callback(hObject, eventdata, handles)
%
hObject handle to ImgOpen (see GCBO)
%
eventdata reserved - to be defined in a future version of MATLAB
%
handles structure with handles and user data (see GUIDATA)
set(handles.axes2,’HandleVisibility’,’ON’);
axes(handles.axes2);
I=handles.img;
se=strel(’disk’,1);
I2=imopen(I,se);
imshow(I2);
set(handles.axes2,’HandleVisibility’,’OFF’);
%
--------------------------------------------------------------------
function ImgClose_Callback(hObject, eventdata, handles)
%
hObject handle to ImgClose (see GCBO)
%
eventdata reserved - to be defined in a future version of MATLAB
%
handles structure with handles and user data (see GUIDATA)
set(handles.axes2,’HandleVisibility’,’ON’);
axes(handles.axes2);
I=handles.img;
se=strel(’disk’,1);
I2=imclose(I,se);
imshow(I2);
set(handles.axes2,’HandleVisibility’,’OFF’);
3 仿真結(jié)果
4 參考文獻(xiàn)
[1]黃誼, 任毅. 基于閾值法和區(qū)域生長法的圖像分割算法研究[J]. 電子測(cè)試, 2012(10):4.
博主簡(jiǎn)介:擅長智能優(yōu)化算法、神經(jīng)網(wǎng)絡(luò)預(yù)測(cè)、信號(hào)處理、元胞自動(dòng)機(jī)、圖像處理、路徑規(guī)劃、無人機(jī)等多種領(lǐng)域的Matlab仿真,相關(guān)matlab代碼問題可私信交流。
部分理論引用網(wǎng)絡(luò)文獻(xiàn),若有侵權(quán)聯(lián)系博主刪除。
-
2023年各省最新電價(jià)一覽!8省中午執(zhí)行谷段電價(jià)! 2023-01-03
-
PPT導(dǎo)出高分辨率圖片的四種方法 2022-09-22
-
全國消防救援總隊(duì)主官及簡(jiǎn)歷(2023.2) 2023-02-10
-
盤點(diǎn) l 中國石油大慶油田現(xiàn)任領(lǐng)導(dǎo)班子 2023-02-28
-
我們的前輩!歷屆全國工程勘察設(shè)計(jì)大師完整名單! 2022-11-18
-
關(guān)于某送變電公司“4·22”人身死亡事故的快報(bào) 2022-04-26
