基于主成分分析的人脸二维码识别MATLAB深度学习实战案例
人脸库

全套文件资料目录下载链接–>传送门

本文全文源码下载[链接–>传送门]

如下分析:

主文件

function varargout = MainForm(varargin)
% MAINFORM MATLAB code for MainForm.fig
%      MAINFORM, by itself, creates a new MAINFORM or raises the existing
%      singleton*.
%
%      H = MAINFORM returns the handle to a new MAINFORM or the handle to
%      the existing singleton*.
%
%      MAINFORM('CALLBACK',hObject,eventData,handles,...) calls the local
%      function named CALLBACK in MAINFORM.M with the given input arguments.
%
%      MAINFORM('Property','Value',...) creates a new MAINFORM or raises the
%      existing singleton*.  Starting from the left, property value pairs are
%      applied to the GUI before MainForm_OpeningFcn gets called.  An
%      unrecognized property name or invalid value makes property application
%      stop.  All inputs are passed to MainForm_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 MainForm% Begin initialization code - DO NOT EDIT
gui_Singleton = 1;
gui_State = struct('gui_Name',       mfilename, ...'gui_Singleton',  gui_Singleton, ...'gui_OpeningFcn', @MainForm_OpeningFcn, ...'gui_OutputFcn',  @MainForm_OutputFcn, ...'gui_LayoutFcn',  [] , ...'gui_Callback',   []);
if nargin && ischar(varargin{1})gui_State.gui_Callback = str2func(varargin{1});
endif nargout[varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:});
elsegui_mainfcn(gui_State, varargin{:});
end
% End initialization code - DO NOT EDIT% --- Executes just before MainForm is made visible.
function MainForm_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 MainForm (see VARARGIN)% Choose default command line output for MainForm
handles.output = hObject;
clc;
set(handles.axes1, 'XTick', [], 'YTick', [], ...'XTickLabel', '', 'YTickLabel', '', 'Color', [0.7020 0.7804 1.0000], 'Box', 'On',...'xlim', [-1 1], 'ylim', [-1 1]);
set(handles.axes2, 'XTick', [], 'YTick', [], ...'XTickLabel', '', 'YTickLabel', '', 'Color', [0.7020 0.7804 1.0000], 'Box', 'On',...'xlim', [-1 1], 'ylim', [-1 1]);
set(handles.axes3, 'XTick', [], 'YTick', [], ...'XTickLabel', '', 'YTickLabel', '', 'Color', [0.7020 0.7804 1.0000], 'Box', 'On',...'xlim', [-1 1], 'ylim', [-1 1]);
handles.Ims = 0;
handles.c = 0;
handles.Im = 0;
handles.f = 0;
handles.Img = 0;
% Update handles structure
guidata(hObject, handles);% UIWAIT makes MainForm wait for user response (see UIRESUME)
% uiwait(handles.figure1);% --- Outputs from this function are returned to the command line.
function varargout = MainForm_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 edit1_Callback(hObject, eventdata, handles)
% hObject    handle to edit1 (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 edit1 as text
%        str2double(get(hObject,'String')) returns contents of edit1 as a double% --- Executes during object creation, after setting all properties.
function edit1_CreateFcn(hObject, eventdata, handles)
% hObject    handle to edit1 (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)
filePath = OpenImageFile();
if filePath == 0return;
end
Img = imread(filePath);
if ndims(Img) == 3Img = rgb2gray(Img);
end
sz = size(Img);
sz0 = [112 92];
if ~isequal(sz, sz0);Img = imresize(Img, sz0, 'bilinear');
end
% wh = 600;
% if sz(1) > wh
%     rate = wh/sz(1);
%     Img = imresize(Img, rate, 'bilinear');
% end
% 显示
imshow(Img, [], 'Parent', handles.axes1);
handles.Img = Img;
handles.sz = size(Img);
guidata(hObject, handles);% --- 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)
if isequal(handles.Img, 0)return;
end
f = GetFaceVector(handles.Img);
f = f(1:round(length(f)*0.9));
handles.f = f;
guidata(hObject, handles);
msgbox('降维成功!', '提示信息');% --- Executes on button press in pushbutton3.
function pushbutton3_Callback(hObject, eventdata, handles)
% hObject    handle to pushbutton3 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
if isequal(handles.f, 0)return;
end
Im = QrGen(handles.f);
% 显示
imshow(Im, [], 'Parent', handles.axes2);
handles.Im = Im;
guidata(hObject, handles);% --- Executes on button press in pushbutton4.
function pushbutton4_Callback(hObject, eventdata, handles)
% hObject    handle to pushbutton4 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
if isequal(handles.Im, 0)return;
end
c = QrDen(handles.Im);
set(handles.edit1, 'String', c);
handles.c = c;
guidata(hObject, handles);% --- Executes on button press in pushbutton5.
function pushbutton5_Callback(hObject, eventdata, handles)
% hObject    handle to pushbutton5 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
if isequal(handles.c, 0)return;
end
Ims = FaceRec(handles.c, handles.sz);
% 显示
imshow(Ims, [], 'Parent', handles.axes3);
handles.Ims = Ims;
guidata(hObject, handles);% --- Executes on button press in pushbutton6.
function pushbutton6_Callback(hObject, eventdata, handles)
% hObject    handle to pushbutton6 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
% 清理工作空间
axes(handles.axes1); cla reset;
axes(handles.axes2); cla reset;
axes(handles.axes3); cla reset;
set(handles.axes1, 'XTick', [], 'YTick', [], ...'XTickLabel', '', 'YTickLabel', '', 'Color', [0.7020 0.7804 1.0000], 'Box', 'On');
set(handles.axes2, 'XTick', [], 'YTick', [], ...'XTickLabel', '', 'YTickLabel', '', 'Color', [0.7020 0.7804 1.0000], 'Box', 'On');
set(handles.axes3, 'XTick', [], 'YTick', [], ...'XTickLabel', '', 'YTickLabel', '', 'Color', [0.7020 0.7804 1.0000], 'Box', 'On');
set(handles.edit1, 'String', '');% --- Executes on button press in pushbutton7.
function pushbutton7_Callback(hObject, eventdata, handles)
% hObject    handle to pushbutton7 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
choice = questdlg('确定要退出系统?', ...'退出', ...'确定','取消','取消');
switch choicecase '确定'close;case '取消'return;
end

应用效果如图所示

【第 07 章 基于主成分分析的人脸二维码识别MATLAB深度学习实战案例】相关推荐

  1. 【图像识别】基于主成分分析算法实现人脸二维码识别matlab代码

    1 简介 基于主成分分析(PCA)的人脸识别算法由于其识别率高,算法技术成熟越来越多的被用做人脸识别技术的研究.本文首先讲解了人脸识别前的图像预处理,然后介绍基于主成分分析(PCA)算法的主要步骤,最 ...

  2. 基于主要成分分析的人脸二维码识别系统-含Matlab代码

    目录 一.引言 二.人脸图像信息处理 2.1 主成分分析PCA 2.2 PCA人脸压缩与重构算法分析 三.二维码转换以及识别 3.1 QR码 3.2 将人脸图像生成二维码 3.3 二维码的识别与图像还 ...

  3. 第 09 章 基于特征匹配的英文印刷字符识别 MATLAB深度学习实战案例

    基于特征匹配的英文印刷字符识别 MATLAB深度学习实战 话不多讲,直接开撸代码 MainForm函数 function MainForm global bw; global bl; global b ...

  4. 基于halcon的简易二维码识别

    二维码识别 原图 代码 结果 原图 代码 dev_update_off () dev_close_window () read_image (Image, '111.png') get_image_s ...

  5. opencv调用微信的二维码识别引擎

    导读 用过二维码识别的小伙伴们都知道,微信的二维码识别确实要比开源的二维码识别zxing和zbar要强不少,zxing和zbar对小的二维码以及模糊的二维码基本上是识别不出来的,有时候一张包含二维码的 ...

  6. Python基于pyzbar、opencv、pyqt5库,实现二维码识别 gui 应用程序开发

    二维码组成结构基本介绍 二维码识别背景介绍 视觉的方法可以用来估计位置和姿态.最容易想到的是在目标上布置多个容易识别的特征,这样使用opencv相机标定和.相机畸变矫正.轮廓提取.solvepnp来获 ...

  7. 基于Android的二维码识别系统的研究与实现(eclipse开发)

    目 录 1 Android系统开发背景与意义 1 1.1 Android系统平台的出现 1 1.2 Android系统的发展 1 1.3 Android系统架构的介绍 1 1.4 Android开放系 ...

  8. IOS人脸识别和二维码识别

    人脸识别应用于许多领域.二维码的识别更是疯狂.下面,我们一起去看看简单的人脸识别和二维码识别. 1.测试数据的展示(人脸). 原图: 1.人脸的大小 // 人脸大小 CGRect FaceRect  ...

  9. 基于人脸的常见表情识别(1)——深度学习基础知识

    基于人脸的常见表情识别(1)--深度学习基础知识 神经网络 1. 感知机 2. 多层感知机与反向传播 卷积神经网络 1. 全连接神经网络的2大缺陷 2. 卷积神经网络的崛起 卷积神经网络的基本网络层 ...

最新文章

  1. LeetCode 2. Add Two Numbers--C++,Python解法--面试算法题
  2. JavaScript递归
  3. HDU 4466 Triangle(计数)
  4. python程序在安卓上如何运行-在 android 上运行 python 的方法
  5. ModuleNotFoundError: No module named '_ctypes' ERROR:Command errored out with exit status 1: python
  6. Week 1 Team Homework #3 from Z.XML-软件工程在北航
  7. Linux内核协议栈分析之网卡初始化——tcp/ip通信并不神秘(1)
  8. oracle错误代码及解决办法整合
  9. 聊聊如何从零开始自学编程
  10. ncl 添加点shp文件_NCL绘制中国地图
  11. pytorch下使用LSTM神经网络写诗
  12. Cardhop for Mac(通讯录管理软件)
  13. P1894 [USACO4.2]完美的牛栏The Perfect Stall
  14. python123凯撒密码_凯撒密码和反密码
  15. 论文查重一般包括哪些部分呢?
  16. Mybatis使用及原理
  17. [catsVSdogs]猫狗大战代码注释讲解_1
  18. *.manifest
  19. 雷神轮胎携手JBL 演绎科技降噪、感受非凡音悦
  20. 2021-07-16(Kotlin学习笔记 -->享学课堂vip课程)

热门文章

  1. CMP电缆和低烟无卤电缆的安全性能比较
  2. 基于EasyX学习图形学中的二维几何变换
  3. IE8兼容fontAwesome
  4. Android 图片选择器(支持拍照,预览)
  5. 机器学习实战教程(一):K-近邻算法
  6. 阿里iDST研究员华先胜:图像搜索的下一步是可以索引整个城市
  7. 软件质量管理实践全面总结
  8. 基于Python pygame简易版斗兽棋小游戏源代码
  9. Delphi中ActionList组件在菜单编制中的应用
  10. 屏幕分辨率——宽、高及像素密度的获取