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年度大型商场设施设备定期检查维修合同 9页

2025年度外聘演员电影作品合同 8页

2025年度外墙保温工程劳务清包及节能效果评估.. 8页

2025年度地下管线施工免责安全协议书 8页

2025年度土地租赁合同电子版——生态农业示范.. 7页

移动健康技术在慢性病监测中的应用-全面剖析 34页

2025年度商标权过户代理服务合同(不过户) 8页

2025年度商务写字楼委托经营协议 7页

2025年度商业地产分摊费用管理合同 8页

2025年度员工绩效合同修订版及实施细则 8页

2025年度员工健康原因解除劳动合同补偿合同 7页

2025年度司法考试合同法真题实战演练及解析服.. 8页

2025年度双篇股权分配协议:新能源项目合资开.. 8页

2025年度厨师工作安全保障聘用合同 7页

2025年度印刷行业电子商务合作合同 9页

2025年度单位临时租用个人车辆安全驾驶及责任.. 8页

2025年度医院医疗纠纷处理合同规范 8页

2025年度医疗设备月结供应商服务协议 9页

2025年度区块链技术应用合作人合伙协议 9页

2025年度化妆品包装设计与国际市场拓展协议 9页

2025年度劳动合同变更及员工离职补偿金计算方.. 6页

2025年度加油站与物流企业合作配送服务合同 9页

2025年度办公室文员劳动合同(含环保意识培训.. 7页

2025年度创业公司股权代持与退出机制协议书 8页

2025年度出租车企业信息化建设及运营维护合同.. 9页

2025年度冷库租赁权及冷链物流业务转让合同 8页

2025年度农村果树病虫害防治与生态农业承包合.. 9页

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

服装设计合作协议书 5页

煤炭资源地质勘查设计编写提纲 14页