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年度家庭私人家教定制方案合同 9页

酸碱催化剂及其催化作用 47页

2025年度大数据分析服务比例分成合同 8页

2025年度城市核心地段手房租赁承包管理协议 9页

酒店投诉处理技巧培训 84页

2025年度员工综合素质教育培训服务合同 9页

2025年度厂房拆除与建筑废弃物环保处理技术研.. 10页

2025年度医师医疗信息安全管理聘用合同 8页

2025年度分手协议书模板:分手后共同债务承担.. 8页

2025年度农产品快速配送道路运输服务合同 10页

2025年度公司合规管理及法律事务处理合作协议.. 11页

2025年度健康养生中心会员服务合同简易版 8页

最新个人租房合同范本 7页

2025年度企业培训与人才发展服务合同 9页

部分电子表格处理 89页

2025年度乡村旅游用地转让承包管理协议 9页

智能制造设备技术合作合同(第一部分) 6页

遗传病和人类健康 28页

新版劳动合同的四大法律特征解析 6页

新房交付质量保证金补充合同 5页

散货及快件出口运输代理合同范本 6页

教师岗位的劳动合同范本 7页

政府债券债务转让合同全文 6页

文化创意产品海运合同范本3篇 50页

轮胎式工程机械驱动桥 38页

教育玩具物流交易协议3篇 51页

教育大厦装修合同模板3篇 55页

教育培训企业股权居间合同3篇 49页

教学楼装修解除通知书3篇 53页