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);
    

最近更新

知识产权许可合同模板及独家转让合同 6页

2025年运动系统慢性损伤康复指南 22页

2025年德育新学期工作计划文本 27页

知识产权使用权转让合同样本 6页

2025年度餐饮品牌授权转让合同规范文本 8页

2025年蝶窦鞍内手术并发症应对策略 49页

2025年药物代谢动力学临床应用解析 33页

畜牧养殖设备购销合同 6页

2025年度长途客运车辆司机服务合同 8页

男方出轨离婚财产分配合同模板 5页

高速列车车钩动力学分析-全面剖析 22页

2025年度金融科技项目多人入股投资管理协议 9页

2025年度金融科技劳动合同补充协议 8页

2025年度金融机构远期外汇交易风险管理培训与.. 9页

2025年度金融服务平台小程序风险评估与控制服.. 9页

2025年度金融信息服务劳务派遣劳务协议书 8页

2025年度酒店行业劳务合作合同书 9页

2025年形形色色的人五年级优秀作文500字篇 12页

2025年度酒店业委托经营管理服务协议 8页

2025年度退休人员社区老年大学授课合同 8页

2025年度车辆挂靠他人名下租赁及车辆托管服务.. 8页

2025年度跨境电商平台佣金结算合同 7页

电子产品经销合同纠纷案例分析 6页

新型保存技术在临床输血中的应用-全面剖析 22页

2025年度购房贷款利率变动风险提示合同 7页

鼠害对食品微生物安全性的影响研究-全面剖析 24页

2025年度营养餐厨师聘请与健康管理服务合同 8页

借款合同模板(电子版) 5页

全国学前教育普及普惠区创建工作方案 5页

2024河南电工技师考试题库电工证考试试题及答.. 59页