1 简介
在一个 yale 人脸库中,有 15 个人,每人有 11 幅图像。要求选定每一个人的
若干幅图像组成样本库,由样本库得到特征库。再任取 yale 图像库的一张图片,
识别它的身份。
对于一幅图像可以看作一个由像素值组成的矩阵,也可以扩展开,看成一个
矢量。如一幅N*N象素的图像可以视为长度为N2的矢量,这样就认为这幅图像是
位于N2维空间中的一个点,这种图像的矢量表示就是原始的图像空间,但是这个
空间仅是可以表示或者检测图像的许多个空间中的一个。不管子空间的具体形式
如何,这种方法用于图像识别的基本思想都是一样的,首先选择一个合适的子空
间,图像将被投影到这个子空间上,然后利用对图像的这种投影间的某种度量来
确定图像间的相似度,最常见的就是各种距离度量。因此,本次采用PCA算法确
定一个子空间,最后使用最小距离法进行识别,并用matlab实现。
2 部分代码
clear;% % high resolution optical and sar matching% im_Ref = imread('.\data\optical_ref.png');% im_Sen = imread('.\data\SAR_sen.png');% CP_Check_file = '.\data\OpticaltoSAR_CP.txt';% medium resolution optical and sar matchingim_Ref = imread('.\data\Optical_ref2.tif');im_Sen = imread('.\data\SAR_sen2.tif');CP_Check_file = '.\data\OpticaltoSAR2_CP.txt';%lidar intensity and optical matching% im_Ref = imread('.\data\LiDARintensity_ref.tif');% im_Sen = imread('.\data\optical_sen.tif');% CP_Check_file = '.\data\LiDARtoOptical_CP.txt';%visible and infrared image matching%im_Ref = imread('.\data\visible_ref.tif');%im_Sen = imread('.\data\infrared_sen.tif');%CP_Check_file = '.\data\VisibletoInfrared_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 pointsfigure;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代码问题可私信交流。
部分理论引用网络文献,若有侵权联系博主删除。
本文介绍了使用PCA算法在Yale人脸库中选择样本库,提取特征并进行身份识别的过程。通过将图像视为高维空间中的点,通过PCA降维,然后利用最小距离法进行匹配。提供了MATLAB代码示例,包括不同类型的图像匹配,如光学与雷达、激光与光学、可见光与红外等。

被折叠的 条评论
为什么被折叠?



