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页

草原土壤碳循环研究-全面剖析 22页

2025年度绿色消费商铺场地租赁合同 8页

物流服务合同优秀模板 7页

2025年开学安全教育讲话稿 46页

跨文化视角下的多维度复核方法研究-全面剖析 21页

2025年度绿色建筑土建工程合同素材汇编 9页

物流公司与配送单位合作合同范本 6页

2025年开学典礼感受作文500字 6页

2025年度绿色人力资源公司劳动合同与环境协议.. 8页

2025年度综合性医院儿科科室承包管理服务协议.. 9页

2025年度线上线下联合营销店铺合作经营合同书.. 9页

2025年开业活动策划方案 24页

2025年建设文明城市建议书素材汇集 8页

2025年建议书作文保护环境 5页

2025年建筑工程项目工作总结报告(7篇) 32页

2025年度离婚协议中两个孩子债务清偿方案 7页

2025年建筑工程个人年终工作总结 18页

版药品供应链购销合同范本 7页

2025年度知识产权评估与交易合同 8页

2025年度知识产权代理服务合作协议 9页

2025年度电竞联赛赛事委托承办协议书 8页

版排水工程施工合同范本 6页

2025年度电子劳动合同在线签署与电子合同履行.. 9页

2025年度电子产品寄售代理佣金合同 9页

2025年女性生殖器官详细解析 28页

版员工无息借款合同规定 5页

2025年度生态牧业合伙养羊投资合同 8页

最新部编版三年级下册语文全册教案 106页

2级经销商分销协议 5页