首页 > 行业资讯 > 【人脸识别】基于模板匹配算法实现人脸识别附matlab代码

【人脸识别】基于模板匹配算法实现人脸识别附matlab代码

时间:2022-06-27 来源: 浏览:

【人脸识别】基于模板匹配算法实现人脸识别附matlab代码

天天Matlab 天天Matlab
天天Matlab

TT_Matlab

博主简介:擅长智能优化算法、神经网络预测、信号处理、元胞自动机、图像处理、路径规划、无人机等多种领域的Matlab仿真,完整matlab代码或者程序定制加qq1575304183。

收录于合集 #图像处理matlab源码 708个

1 简介

在一个 yale 人脸库中,有 15 个人,每人有 11 幅图像。要求选定每一个人的

若干幅图像组成样本库,由样本库得到特征库。再任取 yale 图像库的一张图片,

识别它的身份。

对于一幅图像可以看作一个由像素值组成的矩阵,也可以扩展开,看成一个

矢量。如一幅N*N象素的图像可以视为长度为N 2 的矢量,这样就认为这幅图像是

位于N 2 维空间中的一个点,这种图像的矢量表示就是原始的图像空间,但是这个

空间仅是可以表示或者检测图像的许多个空间中的一个。不管子空间的具体形式

如何,这种方法用于图像识别的基本思想都是一样的,首先选择一个合适的子空

间,图像将被投影到这个子空间上,然后利用对图像的这种投影间的某种度量来

确定图像间的相似度,最常见的就是各种距离度量。因此,本次采用PCA算法确

定一个子空间,最后使用最小距离法进行识别,并用matlab实现。

2 部分代码

clear; % % high resolution optical and sar matching % im_Ref = imread( ’.dataoptical_ref.png’ ); % im_Sen = imread( ’.dataSAR_sen.png’ ); % CP_Check_file = ’.dataOpticaltoSAR_CP.txt’ ; % medium resolution optical and sar matching im_Ref = imread( ’.dataOptical_ref2.tif’ ); im_Sen = imread( ’.dataSAR_sen2.tif’ ); CP_Check_file = ’.dataOpticaltoSAR2_CP.txt’ ; %lidar intensity and optical matching % im_Ref = imread( ’.dataLiDARintensity_ref.tif’ ); % im_Sen = imread( ’.dataoptical_sen.tif’ ); % CP_Check_file = ’.dataLiDARtoOptical_CP.txt’ ; %visible and infrared image matching %im_Ref = imread( ’.datavisible_ref.tif’ ); %im_Sen = imread( ’.datainfrared_sen.tif’ ); %CP_Check_file = ’.dataVisibletoInfrared_CP.txt’ ; disthre = 1.5 ; % the threshod of match errors the deflaut is 1.5 . for % high resolution image covering urban areas, we % should set it to a larger threshod ( such as 2.0 ). % This is beccause that the geometric distortions between such images % is very complicated, and the transfrom model used % by us ( such as projective model ) can only prefit % the geometric distortion. Therefore, a larger threshod % have the more flexibility % template matching using DLSC [CP_Ref,CP_Sen,CMR] = DLSC_match(im_Ref,im_Sen,CP_Check_file,disthre); x= sprintf( ’the correct match ratio is %4.3f’ ,CMR); disp(x) %diplay the tie points figure; imshow(im_Ref),hold on ; plot(CP_Ref(:, 1 ),CP_Ref(:, 2 ), ’yo’ , ’MarkerEdgeColor’ , ’k’ , ’MarkerFaceColor’ , ’y’ , ’MarkerSize’ , 5 );hold on ; title( ’reference image’ ); figure; imshow(im_Sen),hold on ; plot(CP_Sen(:, 1 ),CP_Sen(:, 2 ), ’yo’ , ’MarkerEdgeColor’ , ’k’ , ’MarkerFaceColor’ , ’y’ , ’MarkerSize’ , 5 );hold on ; title( ’sensed image’ );

3 仿真结果

4 参考文献

[1]罗鑫, 赵永进, 柳长春,等. 基于PCA算法人脸识别的matlab实现[J]. 科学技术创新, 2013, 000(002):103-104.

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

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

版权:如无特殊注明,文章转载自网络,侵权请联系cnmhg168#163.com删除!文件均为网友上传,仅供研究和学习使用,务必24小时内删除。
相关推荐