基于MATLAB的柑橘果实分类图像朴素贝叶斯分类器
Naive Bayes Classifier To Classification Image Of Citrus Fruits With Matlab Code
function varargout = NaiveBayesClassifier(varargin)
% NAIVEBAYESCLASSIFIERM-file for NaiveBayesClassifier.fig
% NAIVEBAYESCLASSIFIER, by itself, createsa new NAIVEBAYESCLASSIFIER or raises the existing
% singleton*.
%
% H = NAIVEBAYESCLASSIFIER returns thehandle to a new NAIVEBAYESCLASSIFIER or the handle to
% the existing singleton*.
%
% NAIVEBAYESCLASSIFIER(‘CALLBACK’,hObject,eventData,handles,…) calls thelocal
% function named CALLBACK inNAIVEBAYESCLASSIFIER.M with the given input arguments.
%
% NAIVEBAYESCLASSIFIER(‘Property’,’Value’,…)creates a new NAIVEBAYESCLASSIFIER or raises the
% existing singleton*. Starting from the left, property value pairsare
% applied to the GUI beforeNaiveBayesClassifier_OpeningFcn gets called. An
% unrecognized property name or invalid valuemakes property application
% stop. All inputs are passed to NaiveBayesClassifier_OpeningFcn via varargin.
%
% *See GUI Options on GUIDE’s Toolsmenu. Choose “GUI allows only one
% instance to run (singleton)”.
%
% See also: GUIDE,GUIDATA, GUIHANDLES
% Edit the above text tomodify the response to help NaiveBayesClassifier
% Last Modified by GUIDEv2.5 09-May-2013 06:54:52
% GUI初始化代码
gui_Singleton = 1;
gui_State = struct(‘gui_Name’, mfilename, …
'gui_Singleton', gui_Singleton, ...
'gui_OpeningFcn',@NaiveBayesClassifier_OpeningFcn, ...
'gui_OutputFcn', @NaiveBayesClassifier_OutputFcn, ...
'gui_LayoutFcn', [] , ...
'gui_Callback', []);
if nargin && ischar(varargin{1})
gui_State.gui_Callback =str2func(varargin{1});
clc;
% 设置窗体位置 (get_size_screen/gsl_)
gsl_ = get(0,'ScreenSize');
end
if nargout
[varargout{1:nargout}] =gui_mainfcn(gui_State, varargin{:});
else
gui_mainfcn(gui_State, varargin{:});
end
% 初始化代码结束
% — 可视化 NaiveBayesClassifier
function NaiveBayesClassifier_OpeningFcn(hObject, eventdata, handles, varargin)
% This function has nooutput args, see OutputFcn.
% hObject handle to figure
% eventdata reserved - to be defined in a future versionof MATLAB
% handles structure with handles and user data (seeGUIDATA)
% varargin command line arguments toNaiveBayesClassifier (see VARARGIN)
% Choose default commandline output for NaiveBayesClassifier
handles.output = hObject;
% 更新结构句柄
guidata(hObject, handles);
% UIWAIT makesNaiveBayesClassifier wait for user response (see UIRESUME)
%uiwait(handles.NaiveBayesClassifier);
% 设置图像图标
warning(‘off’,’MATLAB:HandleGraphics:ObsoletedProperty:JavaFrame’);
jframe=get(handles.NaiveBayesClassifier,’javaframe’);
jIcon=javax.swing.ImageIcon(‘citrus-icon.png’);
jframe.setFigureIcon(jIcon);
……
完整源码下载地址:
(http://page2.dfpan.com/fs/fl9c9j525241a2b9166/)
更多精彩文章请关注微信号: