基于matlab的人脸识别系统设计与仿真毕业论文(编辑修改稿)内容摘要:

积分图像分析法 检测速度 较快, 满足实时检测 的 要求,检测效率 相对较高 错误报警数 与 检测率 成反比 支撑向量法 具有更好的泛化能力 “非人脸”的复杂 造成支持向量数目 较多, 导致 运算复杂度 变 大 运用 matlab 软件 仿真进行人脸检测定位实例: 人脸检测定位程序: %%%%% Reading of a RGB image原始图像 i=imread(39。 F:\39。 )。 I=rgb2gray(i)。 BW=im2bw(I)。 figure,imshow(BW) %%%%%%%%%%%%%%%%%%%%灰度图像及均衡化灰度图像 [n1 n2]=size(BW)。 r=floor(n1/10)。 c=floor(n2/10)。 x1=1。 x2=r。 s=r*c。 for i=1:10 y1=1。 y2=c。 for j=1:10 if (y2=c | y2=9*c) | (x1==1 | x2==r*10) loc=find(BW(x1:x2, y1:y2)==0)。 佳木斯大学学士学位论文 佳木斯大学信息电子技术学院 15 [o p]=size(loc)。 pr=o*100/s。 if pr=100 BW(x1:x2, y1:y2)=0。 r1=x1。 r2=x2。 s1=y1。 s2=y2。 pr1=0。 end imshow(BW)。 end y1=y1+c。 y2=y2+c。 end x1=x1+r。 x2=x2+r。 end figure,imshow(BW) %%%%%%%%%%%%%%%%%%人脸定位 %%%%%%%%%%%%%%%%%% %%%%% L = bwlabel(BW,8)。 BB = regionprops(L, 39。 BoundingBox39。 )。 BB1=struct2cell(BB)。 BB2=cell2mat(BB1)。 [s1 s2]=size(BB2)。 mx=0。 for k=3:4:s21 p=BB2(1,k)*BB2(1,k+1)。 if pmx amp。 (BB2(1,k)/BB2(1,k+1)) 佳木斯大学学士学位论文 佳木斯大学信息电子技术学院 16 mx=p。 j=k。 end end figure,imshow(I)。 hold on。 rectangle(39。 Position39。 ,[BB2(1,j2),BB2(1,j1),BB2(1,j),BB2(1,j)],39。 EdgeColor39。 ,39。 r39。 ) 佳木斯大学学士学位论文 佳木斯大学信息电子技术学院 17 匹配与识别 人脸 人别系统的最后一步是人脸识别。 人脸识别,即通过 对所采集到的人脸图像进行一系列处理,提取待识别人脸图像的特征信息,通过与已存人脸数据库信息进行 匹配 识别,确定待识别人脸图像的基本信息。 运行如下代码: function varargout = faceCore(varargin) % FACECORE Mfile for % FACECORE, by itself, creates a new FACECORE or raises the existing % singleton*. % % H = FACECORE returns the handle to a new FACECORE or the handle to % the existing singleton*. % % FACECORE(39。 CALLBACK39。 ,hObject,eventData,handles,...) calls the local % function named CALLBACK in with the given input arguments. % % FACECORE(39。 Property39。 ,39。 Value39。 ,...) creates a new FACECORE or raises the % existing singleton*. Starting from the left, property value pairs are % applied to the GUI before faceCore_OpeningFunction gets called. An % unrecognized property name or invalid value makes property application % stop. All inputs are passed to faceCore_OpeningF via varargin. 佳木斯大学学士学位论文 佳木斯大学信息电子技术学院 18 % % *See GUI Options on GUIDE39。 s Tools menu. Choose GUI allows only one % instance to run (singleton). % % See also: GUIDE, GUIDATA, GUIHANDLES % Copyright 20202020 The MathWorks, Inc. % Edit the above text to modify the response to help faceCore % Last Modified by GUIDE 28May2020 10:21:26 % Begin initialization code DO NOT EDIT gui_Singleton = 1。 gui_State = struct(39。 gui_Name39。 , mfilename, ... 39。 gui_Singleton39。 , gui_Singleton, ... 39。 gui_OpeningF39。 , @faceCore_OpeningF, ... 39。 gui_OutputF39。 , @faceCore_OutputF, ... 39。 gui_LayoutF39。 , [] , ... 39。 gui_Callback39。 , [])。 if nargin amp。 amp。 ischar(varargin{1}) = str2func(varargin{1})。 end if nargout [varargout{1:nargout}] = gui_mainf(gui_State, varargin{:})。 else gui_mainf(gui_State, varargin{:})。 佳木斯大学学士学位论文 佳木斯大学信息电子技术学院 19 end % End initialization code DO NOT EDIT % Executes just before faceCore is made visible. function faceCore_OpeningF(hObject, eventdata, handles, varargin) % This function has no output args, see OutputF. % 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 mand line arguments to faceCore (see VARARGIN) % Choose default mand line output for faceCore = hObject。 % Update handles structure guidata(hObject, handles)。 % UIWAIT makes faceCore wait for user response (see UIRESUME) % uiwait()。 % Outputs from this function are returned to the mand line. function varargout = faceCore_OutputF(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) 佳木斯大学学士学位论文 佳木斯大学信息电子技术学院 20 % Get default mand line output from handles structure varargout{1} =。 % 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 TrainDatabasePath。 TrainDatabasePath = uigetdir(strcat(matlabroot,39。 \work39。 ), 39。 训练库路径选择 ...39。 )。 % 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) global TestDatabasePath。 TestDatabasePath = uigetdir(strcat(matlabroot,39。 \work39。 ), 39。 测试库路径选择 ...39。 )。 % 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。
阅读剩余 0%
本站所有文章资讯、展示的图片素材等内容均为注册用户上传(部分报媒/平媒内容转载自网络合作媒体),仅供学习参考。 用户通过本站上传、发布的任何内容的知识产权归属用户或原始著作权人所有。如有侵犯您的版权,请联系我们反馈本站将在三个工作日内改正。