资源简介
从网上的得到的资源,因此注释是英文的,不过,里面有我自己附加的代码解说,该matlab代码用的是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
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2017-06-19 22:53 Face-Recognition-master\
文件 6 2014-01-23 22:40 Face-Recognition-master\.gitignore
文件 1818 2014-01-23 22:40 Face-Recognition-master\CreateDataba
文件 2871 2014-01-23 22:40 Face-Recognition-master\EigenfaceCore.m
文件 1264 2014-01-23 22:40 Face-Recognition-master\example.m
文件 1048 2014-01-23 22:40 Face-Recognition-master\Example2.m
文件 495 2014-01-23 22:40 Face-Recognition-master\Readme.md
文件 2480 2014-01-23 22:40 Face-Recognition-master\Recognition.m
目录 0 2014-01-23 22:40 Face-Recognition-master\Test2\
文件 91935 2014-01-23 22:40 Face-Recognition-master\Test2\1.jpg
文件 81797 2014-01-23 22:40 Face-Recognition-master\Test2\2.jpg
文件 92486 2014-01-23 22:40 Face-Recognition-master\Test2\3.jpg
目录 0 2014-01-23 22:40 Face-Recognition-master\TestDataba
文件 6264 2014-01-23 22:40 Face-Recognition-master\TestDataba
文件 6852 2014-01-23 22:40 Face-Recognition-master\TestDataba
文件 6007 2014-01-23 22:40 Face-Recognition-master\TestDataba
文件 5680 2014-01-23 22:40 Face-Recognition-master\TestDataba
文件 6525 2014-01-23 22:40 Face-Recognition-master\TestDataba
文件 4341 2014-01-23 22:40 Face-Recognition-master\TestDataba
文件 5876 2014-01-23 22:40 Face-Recognition-master\TestDataba
文件 4352 2014-01-23 22:40 Face-Recognition-master\TestDataba
文件 6725 2014-01-23 22:40 Face-Recognition-master\TestDataba
文件 5570 2014-01-23 22:40 Face-Recognition-master\TestDataba
目录 0 2014-01-23 22:40 Face-Recognition-master\Train2\
文件 79071 2014-01-23 22:40 Face-Recognition-master\Train2\1.jpg
文件 83336 2014-01-23 22:40 Face-Recognition-master\Train2\2.jpg
文件 81973 2014-01-23 22:40 Face-Recognition-master\Train2\3.jpg
文件 80704 2014-01-23 22:40 Face-Recognition-master\Train2\4.jpg
文件 87354 2014-01-23 22:40 Face-Recognition-master\Train2\5.jpg
文件 89958 2014-01-23 22:40 Face-Recognition-master\Train2\6.jpg
目录 0 2014-01-23 22:40 Face-Recognition-master\TrainDataba
............此处省略21个文件信息
- 上一篇:差分方程模型matlab代码
- 下一篇:移相全桥simuli
nk仿真
相关资源
- 差分方程模型matlab代码
- ID3算法matlab
- 动作能量图
- LMS matlab
- 8阵元均匀圆阵MUSIC DOA算法的matlab程序
- 单片空间后方交会matlab
- topsis matlab 源程序
- 基于MATLAB的模拟退火算法求解最短路
- 放大转发协同通信系统误码率matlab实
- MATLAB信号处理
- 地震波偏移成像matlab
- matlab 仿真程序
- 二维弹性波数值模拟matlab
- 瑞利衰落信道下,采用MRC分集误码性
- 无向图中的最大流算法MATLAB代码
- 基于matlab的简单人脸识别程序代码.
- 人脸识别人眼定位
- ieee30节点
- 卡尔曼滤波与matlab实现
- 混沌神经网络
- CRC编码解码 matlab仿真
- 小波阈值图像去噪,可以matlab运行!
- matlab万年历制作
-
详解MATLAB/Simuli
nk通信系统建模与仿 - 利用MATLAB实现自动曝光
- PCNN分割,边缘提取,图像增强等mat
- pso工具箱 matlab
- A律13折线调制的matlab代码
- etopo地形数据转换为xyz格式
- 基于matlab上实现高斯混合模型说话人
评论
共有 条评论