IT数码 购物 网址 头条 软件 日历 阅读 图书馆
TxT小说阅读器
↓语音阅读,小说下载,古典文学↓
图片批量下载器
↓批量下载图片,美女图库↓
图片自动播放器
↓图片自动播放器↓
一键清除垃圾
↓轻轻一点,清除系统垃圾↓
开发: C++知识库 Java知识库 JavaScript Python PHP知识库 人工智能 区块链 大数据 移动开发 嵌入式 开发工具 数据结构与算法 开发测试 游戏开发 网络协议 系统运维
教程: HTML教程 CSS教程 JavaScript教程 Go语言教程 JQuery教程 VUE教程 VUE3教程 Bootstrap教程 SQL数据库教程 C语言教程 C++教程 Java教程 Python教程 Python3教程 C#教程
数码: 电脑 笔记本 显卡 显示器 固态硬盘 硬盘 耳机 手机 iphone vivo oppo 小米 华为 单反 装机 图拉丁
 
   -> 人工智能 -> 【手写数字识别】基于Fisher分类实现手写数字识别附matlab代码 -> 正文阅读

[人工智能]【手写数字识别】基于Fisher分类实现手写数字识别附matlab代码

1 简介

?

Fisher分类器同SVM(supportvectormachine)分类器一样是有监督分类方法,它通过计算图像的类内散布矩阵和类间散布矩阵,找到最 优?投 影面,使投影方向上的类内数据尽量密集而类间数据尽量分散。?

2 部分代码

 function varargout = main_gui(varargin)% MAIN_GUI MATLAB code for main_gui.fig%      MAIN_GUI, by itself, creates a new MAIN_GUI or raises the existing%      singleton*.%%      H = MAIN_GUI returns the handle to a new MAIN_GUI or the handle to%      the existing singleton*.%%      MAIN_GUI('CALLBACK',hObject,eventData,handles,...) calls the local%      function named CALLBACK in MAIN_GUI.M with the given input arguments.%%      MAIN_GUI('Property','Value',...) creates a new MAIN_GUI or raises the%      existing singleton*.  Starting from the left, property value pairs are%      applied to the GUI before main_gui_OpeningFcn gets called.  An%      unrecognized property name or invalid value makes property application%      stop.  All inputs are passed to main_gui_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 main_gui% Last Modified by GUIDE v2.5 02-Apr-2019 15:37:29% Begin initialization code - DO NOT EDITgui_Singleton = 1;gui_State = struct('gui_Name',       mfilename, ...                   'gui_Singleton',  gui_Singleton, ...                   'gui_OpeningFcn', @main_gui_OpeningFcn, ...                   'gui_OutputFcn',  @main_gui_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 main_gui is made visible.function main_gui_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 main_gui (see VARARGIN)% set( handles.axes1, 'visible', 'off' );% set( handles.axes1, 'box', 'on' );global W W0;load W load W0% Choose default command line output for main_guihandles.output = hObject;% Update handles structureguidata(hObject, handles);% UIWAIT makes main_gui wait for user response (see UIRESUME)% uiwait(handles.figure1);?% --- Outputs from this function are returned to the command line.function varargout = main_gui_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 structurevarargout{1} = handles.output;% --- Executes on mouse press over figure background, over a disabled or% --- inactive control, or over an axes background.function figure1_WindowButtonDownFcn(hObject, eventdata, handles)% hObject    handle to figure1 (see GCBO)% eventdata  reserved - to be defined in a future version of MATLAB% handles    structure with handles and user data (see GUIDATA)global draw_enable;  %定义一个标志,1表示绘图,0表示停止绘图global x;global y;draw_enable=1;if draw_enable    position=get(gca,'currentpoint');  %gca(获取当前坐标轴的句柄)    x(1)=position(1);    y(1)=position(3);end?% --- Executes on mouse motion over figure - except title and menu.function figure1_WindowButtonMotionFcn(hObject, eventdata, handles)% hObject    handle to figure1 (see GCBO)% eventdata  reserved - to be defined in a future version of MATLAB% handles    structure with handles and user data (see GUIDATA)global draw_enable;global x;global y;global h1;if draw_enable==1    position=get(gca,'currentpoint');    x(2)=position(1);    y(2)=position(3);    h1=line(x,y,'LineWidth',25,'color','k','Linestyle','-.');    x(1)=x(2);    y(1)=y(2);   %鼠标移动,随时更新数据end?% --- Executes on mouse press over figure background, over a disabled or% --- inactive control, or over an axes background.function figure1_WindowButtonUpFcn(hObject, eventdata, handles)% hObject    handle to figure1 (see GCBO)% eventdata  reserved - to be defined in a future version of MATLAB% handles    structure with handles and user data (see GUIDATA)global draw_enable;    draw_enable=0;?function num_Callback(hObject, eventdata, handles)% hObject    handle to num (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 num as text%        str2double(get(hObject,'String')) returns contents of num as a double?% --- Executes during object creation, after setting all properties.function num_CreateFcn(hObject, eventdata, handles)% hObject    handle to num (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 pushbutton1.function pushbutton1_Callback(hObject, eventdata, handles)% hObject    handle to pushbutton1 (see GCBO)% eventdata  reserved - to be defined in a future version of MATLAB% handles    structure with handles and user data (see GUIDATA)global Wglobal W0img=getframe(handles.axes1);img=imresize(img.cdata,[28,28]);img=im2bw(img,graythresh(img)); img=~img;axes(handles.axes2);img1=~img;imshow(img1);%img1为预览图像%计算概率for cnt=1:4    for cnt2=1:4        Atemp=sum(img(((cnt*7-6):(cnt*7)),((cnt2*7-6):(cnt2*7))));%10*10box        lett((cnt-1)*4+cnt2)=sum(Atemp);    endendpredict=W'*lett';predict=predict-W0';for i=1:10    num=size(find(predict(i*9-8:i*9)>0),1);    total(i)=num;end[~,num]=max(total);set(handles.num,'string',num2str(num-1));% --- 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)set(handles.num,'string','');axes(handles.axes1);cla;axes(handles.axes2);cla;   %cla清空坐标轴?

3 仿真结果

转存失败重新上传取消

4 参考文献

[1]王海涛, 丁宣浩. 基于Fisher分类和自适应阈值的分形图像编码方法[J]. 广西科学, 2008, 15(3):3.

博主简介:擅长智能优化算法、神经网络预测、信号处理、元胞自动机、图像处理、路径规划、无人机等多种领域的Matlab仿真,相关matlab代码问题可私信交流。

部分理论引用网络文献,若有侵权联系博主删除。

  人工智能 最新文章
2022吴恩达机器学习课程——第二课(神经网
第十五章 规则学习
FixMatch: Simplifying Semi-Supervised Le
数据挖掘Java——Kmeans算法的实现
大脑皮层的分割方法
【翻译】GPT-3是如何工作的
论文笔记:TEACHTEXT: CrossModal Generaliz
python从零学(六)
详解Python 3.x 导入(import)
【答读者问27】backtrader不支持最新版本的
上一篇文章      下一篇文章      查看所有文章
加:2022-05-19 11:56:10  更:2022-05-19 11:56:45 
 
开发: C++知识库 Java知识库 JavaScript Python PHP知识库 人工智能 区块链 大数据 移动开发 嵌入式 开发工具 数据结构与算法 开发测试 游戏开发 网络协议 系统运维
教程: HTML教程 CSS教程 JavaScript教程 Go语言教程 JQuery教程 VUE教程 VUE3教程 Bootstrap教程 SQL数据库教程 C语言教程 C++教程 Java教程 Python教程 Python3教程 C#教程
数码: 电脑 笔记本 显卡 显示器 固态硬盘 硬盘 耳机 手机 iphone vivo oppo 小米 华为 单反 装机 图拉丁

360图书馆 购物 三丰科技 阅读网 日历 万年历 2024年11日历 -2024/11/26 4:44:27-

图片自动播放器
↓图片自动播放器↓
TxT小说阅读器
↓语音阅读,小说下载,古典文学↓
一键清除垃圾
↓轻轻一点,清除系统垃圾↓
图片批量下载器
↓批量下载图片,美女图库↓
  网站联系: qq:121756557 email:121756557@qq.com  IT数码