资源简介
基于PCA的人脸识别系统源代码,自动识别人脸,且可以和数据库中的人脸进行对比识别
代码片段和文件信息
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: aomidvar@ece.ut.ac.ir
%%%%%%%%%%%%%%%%%%%%%%%% File management
TrainFiles = dir(TrainDatabasePath);
Train_Number = 0;
for i = 1:size(TrainFiles1)
if not(strcmp(TrainFiles(i).name‘.‘)|strcmp(TrainFiles(i).name‘..‘)|strcmp(TrainFiles(i).name‘Thumbs.db‘))
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(TrainDatabasePathstr);
img = imread(str);
img = rgb2gray(img);
[irow icol] = size(img);
temp = reshape(img‘irow*icol1); % Reshaping 2D images into 1D image vectors
T = [T temp]; % ‘T‘ grows after each turn
end
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 37858 2008-01-27 20:06 PCA-Face-Recognition\PCA-ba
文件 37858 2008-01-27 20:06 PCA-Face-Recognition\PCA-ba
文件 37858 2008-01-27 20:06 PCA-Face-Recognition\PCA-ba
文件 1865 2007-10-20 15:00 PCA-Face-Recognition\PCA_ba
文件 2930 2007-10-20 15:01 PCA-Face-Recognition\PCA_ba
文件 1303 2007-10-20 15:55 PCA-Face-Recognition\PCA_ba
文件 1352 2007-10-20 17:05 PCA-Face-Recognition\PCA_ba
文件 2541 2007-10-20 15:03 PCA-Face-Recognition\PCA_ba
文件 6264 1994-10-05 14:21 PCA-Face-Recognition\PCA_ba
文件 6852 1994-10-05 13:49 PCA-Face-Recognition\PCA_ba
文件 6007 1994-10-05 15:21 PCA-Face-Recognition\PCA_ba
文件 5680 1994-10-05 15:14 PCA-Face-Recognition\PCA_ba
文件 6525 1994-10-05 14:53 PCA-Face-Recognition\PCA_ba
文件 4341 1994-10-05 15:39 PCA-Face-Recognition\PCA_ba
文件 5876 1994-10-05 14:11 PCA-Face-Recognition\PCA_ba
文件 4352 1994-10-05 15:09 PCA-Face-Recognition\PCA_ba
文件 6725 1994-10-05 15:19 PCA-Face-Recognition\PCA_ba
文件 5570 1994-10-05 14:47 PCA-Face-Recognition\PCA_ba
文件 6391 1994-10-05 14:21 PCA-Face-Recognition\PCA_ba
文件 4223 1994-10-05 15:38 PCA-Face-Recognition\PCA_ba
文件 5967 1994-10-05 14:10 PCA-Face-Recognition\PCA_ba
文件 5870 1994-10-05 14:11 PCA-Face-Recognition\PCA_ba
文件 4363 1994-10-05 15:09 PCA-Face-Recognition\PCA_ba
文件 4360 1994-10-05 15:08 PCA-Face-Recognition\PCA_ba
文件 6681 1994-10-05 15:19 PCA-Face-Recognition\PCA_ba
文件 6693 1994-10-05 15:19 PCA-Face-Recognition\PCA_ba
文件 5417 1994-10-05 14:47 PCA-Face-Recognition\PCA_ba
文件 5448 1994-10-05 14:47 PCA-Face-Recognition\PCA_ba
文件 6827 1994-10-05 13:49 PCA-Face-Recognition\PCA_ba
文件 6219 1994-10-05 14:20 PCA-Face-Recognition\PCA_ba
............此处省略16个文件信息
- 上一篇:simuli
nk电动汽车驾驶员模型 - 下一篇:matlab实现循环谱
相关资源
- Pattern Recognition and Machine Learning(高清
- MATLAB 编程 第二版 Stephen J. Chapman 著
- 均值滤波和FFT频谱分析Matlab代码
- 《MATLAB扩展编程》代码
- HDB3码、AMI码的MATLAB实现
- 3点GPS定位MATLAB仿真
- MATLAB数字信号处理85个实用案例精讲入
- matlab从入门到精通pdf94795
- 欧拉放大论文及matlab代码
- 跳一跳辅助_matlab版本
- 全面详解LTE MATLAB建模、仿真与实现
- MIMO-OFDM无线通信技术及MATLAB实现_孙锴
- MATLAB Programming for Engineers 4th - Chapman
- matlab 各种谱分析对比
- 分数阶chen混沌matlab程序
- 基于粒子群算法的非合作博弈的matl
- MATLAB车流仿真 包括跟驰、延误
- matlab空间桁架计算程序
- 基于MATLAB的图像特征点匹配和筛选
- DMA-TVP-FAVAR
- GPS信号的码捕获matlab代码.7z
- 一维光子晶体MATLAB仿真代码吸收率折
- newmark法源程序
- 传统关联成像、计算鬼成像matlab
- pri传统分选算法
- 摆动滚子推杆盘形凸轮设计
- 医学图像重建作业matlab源码
- Matlab实现混沌系统的控制
- 高光谱图像pca分析特征提取
- 检测疲劳驾驶
评论
共有 条评论