1 / 12
文档名称:

PCA人脸识别算法Matlab版.doc

格式:doc   大小:189KB   页数:12页
下载后只包含 1 个 DOC 格式的文档,没有任何的图纸或源代码,查看文件列表

如果您已付费下载过本站文档,您可以点这里二次下载

分享

预览

PCA人脸识别算法Matlab版.doc

上传人:taotao0a 2021/8/24 文件大小:189 KB

下载得到文件列表

PCA人脸识别算法Matlab版.doc

文档介绍

文档介绍:PCA人脸识别算法Matlab版
2

———————————————————————————————— 作者:
———————————————————————————————— 日期:

个人收集 仅供参考学习 勿做商业用途
PCA人脸识别算法Matlab版
2021-11-18 19:30
function T = CreateDatabase(TrainDatabasePath)
% Align a set of face images (the training set T1, T2, ... , TM )
%
% Description: This function reshapes all 2D images of the training database
% into 1D column vectors. Then, it puts these 1D column vectors in a row to 
% construct 2D matrix 'T'.
%  
% 
% Argument:      TrainDatabasePath      - Path of the training database
%
% Returns:       T                      - A 2D matrix, containing all 1D image vectors.
%                                         Suppose all P images in the training database 
%                                         have the same size of MxN. So the length of 1D 
%                                         column vectors is MN and 'T' will be a MNxP 2D matrix.
%
% See also: STRCMP, STRCAT, RESHAPE
% Original version by Amir Hossein Omidvarnia, October 2007
%                      Email: ******@                  
%%%%%%%%%%%%%%%%%%%%%%%% File management
TrainFiles = dir(TrainDatabasePath);
Train_Number = 0;
for i = 1:size(TrainFiles,1)
    if not(strcmp(TrainFiles(i).name,'.')|strcmp(TrainFiles(i).name,'..')|strcmp(TrainFiles(i).name,''))
         Train_Number = Train_Number + 1; % Number of all images in the training database
     end
end
%%%%%%%%%%%%%%%%%%%%%%%% Construction of 2D matrix from 1D image vectors
T = [];
for i = 1 : Train_Number
    
    % I have chosen the name of each image in databases as a corresponding
    % number. However, it is not mandatory!
     str = int2str(i);
     str = strcat('\',str,'.jpg');
     str = strcat(TrainDatabasePath,str);
    
     img = imread(str);
    

最近更新

2025年度旅游公司与航空公司航线合作合同 8页

2025年度新能源汽车车牌买卖合作协议模板 8页

2025年度新能源储能设备融资租赁服务协议 9页

2025年度新型环保涂料合作生产协议书 9页

2025年度文化创意产业委托经营协议 9页

2025年度文化中心场地借用及文化活动组织协议.. 9页

2025年度教育机构贷款担保服务 7页

2025年度教育培训学校学生意外伤害事故处理及.. 7页

2025年度房屋抵押贷款买房合同 8页

2025年度房地产个人居间服务合同 8页

2025年度影视特效演员聘用协议 8页

2025年度建筑工程人工费支付合同样本 9页

2025年度广州房屋自愿出租与租户文化娱乐活动.. 8页

2025年度幼儿园意外伤害赔偿协议:针对小孩在.. 7页

2025年度幕墙施工劳务承包合同(含新型装饰材.. 9页

2025年度工程机械转让与绿色环保技术研发协议.. 10页

2025年度工厂整体搬迁及资产转让合同 9页

2025年度展会专用展台设计与搭建及展会现场餐.. 10页

小学生家庭实践活动心得体会(3篇) 4页

2023年部编版五年级数学上册期末考试卷及答案.. 6页

2025年度家用空调智能化改造与升级合同 9页

我是一个苹果教案8篇 24页

教师辞职信范文(33篇) 50页

方力智能化设计合同(草稿)XXXX1214 10页

2025年度实习协议书——面向全国大学生 7页

2025年度宅基地永久转让及房屋租赁一体化合同.. 8页

2025年度子女赡养老人及长期护理服务合同 8页

2025年度婚前房产协议实证,婚姻财产保护与规.. 9页

艺术舞蹈老师简历模板 1页

服装设计合作协议书 5页