• 大小: 5.11MB
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2023-11-14
  • 语言: Matlab
  • 标签: PCA  人脸识别  

资源简介

使用PCA算法对ORL的人脸库进行降维,得到主元向量与特征脸图像,可下载运行,可设置特征维度比较识别效果与图像重建效果

资源截图

代码片段和文件信息

%输入图像为image0
%输入主元向量为primary_vector
%分别显示前primary_vector_num个主元分量图像的和
%图像尺寸image_rowsimage_cols
function display_pca_face(image0primary_vectorprimary_vector_numimage_rowsimage_cols)
primary_face_component=primary_vector‘*image0;%在前n个基向量上的分量
%显示各个主分量
figure
for i=1:50
    temp_face=uint8(reshape(primary_face_component(i)*primary_vector(:i)[image_rows image_cols]));
    subplot(69i)
    imshow(temp_face);
end
%显示原图像
figure
temp_face=uint8(reshape(image0(:1)[image_rows image_cols]));
subplot(691)
imshow(temp_face);
%显示各主元重构图像
j=0;
for i=primary_vector_num  
    temp_face1=primary_vector(:1:i)*primary_face_component(1:i);%显示主元和
    temp_face=uint8(reshape(temp_face1[image_rows image_cols]));
    j=j+1;
    subplot(45j)
    imshow(temp_face);
end
end

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2018-04-19 13:59  PCA-facerecognition-hcf\
     目录           0  2018-04-12 13:33  PCA-facerecognition-hcf\ORL\
     文件     1440768  2018-04-10 14:58  PCA-facerecognition-hcf\ORL\Thumbs.db
     文件       11382  2011-12-26 18:43  PCA-facerecognition-hcf\ORL\s10_1.bmp
     文件       11382  2011-12-26 18:43  PCA-facerecognition-hcf\ORL\s10_10.bmp
     文件       11382  2011-12-26 18:43  PCA-facerecognition-hcf\ORL\s10_2.bmp
     文件       11382  2011-12-26 18:43  PCA-facerecognition-hcf\ORL\s10_3.bmp
     文件       11382  2011-12-26 18:43  PCA-facerecognition-hcf\ORL\s10_4.bmp
     文件       11382  2011-12-26 18:43  PCA-facerecognition-hcf\ORL\s10_5.bmp
     文件       11382  2011-12-26 18:43  PCA-facerecognition-hcf\ORL\s10_6.bmp
     文件       11382  2011-12-26 18:43  PCA-facerecognition-hcf\ORL\s10_7.bmp
     文件       11382  2011-12-26 18:43  PCA-facerecognition-hcf\ORL\s10_8.bmp
     文件       11382  2011-12-26 18:43  PCA-facerecognition-hcf\ORL\s10_9.bmp
     文件       11382  2011-12-26 18:43  PCA-facerecognition-hcf\ORL\s11_1.bmp
     文件       11382  2011-12-26 18:43  PCA-facerecognition-hcf\ORL\s11_10.bmp
     文件       11382  2011-12-26 18:43  PCA-facerecognition-hcf\ORL\s11_2.bmp
     文件       11382  2011-12-26 18:43  PCA-facerecognition-hcf\ORL\s11_3.bmp
     文件       11382  2011-12-26 18:43  PCA-facerecognition-hcf\ORL\s11_4.bmp
     文件       11382  2011-12-26 18:43  PCA-facerecognition-hcf\ORL\s11_5.bmp
     文件       11382  2011-12-26 18:43  PCA-facerecognition-hcf\ORL\s11_6.bmp
     文件       11382  2011-12-26 18:43  PCA-facerecognition-hcf\ORL\s11_7.bmp
     文件       11382  2011-12-26 18:43  PCA-facerecognition-hcf\ORL\s11_8.bmp
     文件       11382  2011-12-26 18:43  PCA-facerecognition-hcf\ORL\s11_9.bmp
     文件       11382  2011-12-26 18:43  PCA-facerecognition-hcf\ORL\s12_1.bmp
     文件       11382  2011-12-26 18:43  PCA-facerecognition-hcf\ORL\s12_10.bmp
     文件       11382  2011-12-26 18:43  PCA-facerecognition-hcf\ORL\s12_2.bmp
     文件       11382  2011-12-26 18:43  PCA-facerecognition-hcf\ORL\s12_3.bmp
     文件       11382  2011-12-26 18:43  PCA-facerecognition-hcf\ORL\s12_4.bmp
     文件       11382  2011-12-26 18:43  PCA-facerecognition-hcf\ORL\s12_5.bmp
     文件       11382  2011-12-26 18:43  PCA-facerecognition-hcf\ORL\s12_6.bmp
     文件       11382  2011-12-26 18:43  PCA-facerecognition-hcf\ORL\s12_7.bmp
............此处省略379个文件信息

评论

共有 条评论