基于matlab的人脸识别系统设计与仿真本科毕业论文(4)

2020-03-27 14:07

佳木斯大学学士学位论文

[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, 'BoundingBox'); BB1=struct2cell(BB); BB2=cell2mat(BB1);

[s1 s2]=size(BB2); mx=0;

for k=3:4:s2-1

p=BB2(1,k)*BB2(1,k+1);

if p>mx & (BB2(1,k)/BB2(1,k+1))<1.8

15 佳木斯大学信息电子技术学院

佳木斯大学学士学位论文

mx=p; j=k; end end

figure,imshow(I); hold on;

rectangle('Position',[BB2(1,j-2),BB2(1,j-1),BB2(1,j),BB2(1,j)],'EdgeColor','r' )

1.原始图片 2.灰度图片

3.均衡化灰度图片 4.人脸定位

16 佳木斯大学信息电子技术学院

佳木斯大学学士学位论文

3.3 匹配与识别

人脸人别系统的最后一步是人脸识别。人脸识别,即通过对所采集到的人脸图像进行一系列处理,提取待识别人脸图像的特征信息,通过与已存人脸数据库信息进行匹配识别,确定待识别人脸图像的基本信息。运行如下代码:

function varargout = faceCore(varargin) % FACECORE M-file for faceCore.fig

% 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('CALLBACK',hObject,eventData,handles,...) calls the local

% function named CALLBACK in FACECORE.M with the given input arguments.

%

% FACECORE('Property','Value',...) 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_OpeningFcn via varargin.

17 佳木斯大学信息电子技术学院

佳木斯大学学士学位论文

%

% *See GUI Options on GUIDE's Tools menu. Choose \only one

% instance to run (singleton)\%

% See also: GUIDE, GUIDATA, GUIHANDLES

% Copyright 2002-2003 The MathWorks, Inc.

% Edit the above text to modify the response to help faceCore

% Last Modified by GUIDE v2.5 28-May-2009 10:21:26

% Begin initialization code - DO NOT EDIT gui_Singleton = 1;

gui_State = struct('gui_Name', mfilename, ... 'gui_Singleton', gui_Singleton, ... 'gui_OpeningFcn', @faceCore_OpeningFcn, ... 'gui_OutputFcn', @faceCore_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{:});

18 佳木斯大学信息电子技术学院

佳木斯大学学士学位论文

end

% End initialization code - DO NOT EDIT

% --- Executes just before faceCore is made visible.

function faceCore_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 faceCore (see VARARGIN)

% Choose default command line output for faceCore handles.output = hObject;

% Update handles structure guidata(hObject, handles);

% UIWAIT makes faceCore wait for user response (see UIRESUME) % uiwait(handles.figure1);

% --- Outputs from this function are returned to the command line. function varargout = faceCore_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)

19 佳木斯大学信息电子技术学院


基于matlab的人脸识别系统设计与仿真本科毕业论文(4).doc 将本文的Word文档下载到电脑 下载失败或者文档不完整,请联系客服人员解决!

下一篇:下山峁煤矿防洪、地质灾害防治应急预案

相关阅读
本类排行
× 注册会员免费下载(下载后可以自由复制和排版)

马上注册会员

注:下载文档有可能“只有目录或者内容不全”等情况,请下载之前注意辨别,如果您已付费且无法下载或内容有问题,请联系我们协助你处理。
微信: QQ: