资源简介
最新的基于稀疏表示的人脸识别程序,用Matlab编写,包括了快速算法的实现,是目前识别率和效率较高的最新人脸识别技术的具体算法实现,不可多得!希望能帮助大家!
代码片段和文件信息
function [X accuracy avgTime] = fsc_main(Y A D L sc_algo trainLabel testLabel numClass displayProgressFlag)
% ---------------------------------------------------
% Fast Sparse Representation with Prototypes: fsc_main
% Functionality:
% Find the approaximated sparse solution x of the linear system y=Ax
% Dimension: m --- number of measurement
% Nt--- number of testing samples
% Nd--- number of training samples
%
% Dimension Description
% input: Y m x Nt --- the testing sample
% A m x Nd --- the training sample
% D m x K --- the learned dictionary
% trainLabel 1 x Nt --- the label of training sample
% L --- the number of atoms in OMP
% sc_algo --- the sparse coding algorithm
% e.g. l1magic SparseLab fast_sc SL0 YALL1
% output: X K x Nt --- the sparse coefficient matrix of Y
% accuracy --- accuracy of the classification task
% avgTime --- average runtime for sparse coding
%
% Reference: Jia-Bin Huang and Ming-Hsuan Yang “Fast Sparse Representation with Prototypes.“ the 23th IEEE Conference
% on Computer Vision and Pattern Recognition (CVPR 10‘) San Francisco CA USA June 2010.
% Contact: For any questions email me by jbhuang@ieee.org
% ---------------------------------------------------
[m Nt]= size(Y);
[m Nd]= size(A);
[m K]= size(D);
X = zeros(Nd Nt);
% Compute the new representation of A as W
WA = OMP(D A L);
% Compute the new representation of Y as Wy
WY = OMP(D Y L);
% Compute the sparse representation X
Ainv = pinv(A);
sumTime=0;
correctSample=0;
for i = 1: Nt
% Inital guess
xInit = Ainv * Y(:i);
xp = zeros(Nd1);
% new representation of the test sample y
w_y = WY(:i);
% keep columns with a least one overlapped support and dicard the rest
[WA_reduced releventPosition] = reduceMatrix(w_y WA);
% sparse coding: solve a reduced linear system
tic
xpReduced = sparse_coding_methods(xInit(releventPosition) WA_reduced w_y sc_algo);
t = toc;
sumTime = sumTime+t;
xp(releventPosition)=xpReduced;
X(: i) = xp;
% Predict label of the test sample
residuals = zeros(1numClass);
for iClass = 1: numClass
xpClass = xp;
xpClass(trainLabel~= iClass) = 0;
residuals(iClass) = norm(Y(:i) - A*xpClass);
end
[val ind] = min(residuals);
if(ind==testLabel(i))
correctSample = correctSample+1;
end
if(displayProgressFlag)
avgTime = sumTime/i;
accuracy = correctSample / i;
fprintf(‘Accuracy = %f %% (%d out of %d) speed = %f s\n‘ accuracy*100 correctSample i avgTime);
end
end
accu
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 2795 2010-06-01 16:41 FSR code\fsc_main.asv
文件 3054 2010-06-01 19:32 FSR code\fsc_main.m
文件 884 2010-05-27 19:46 FSR code\fsr_main.asv
文件 3499 2010-06-01 15:48 FSR code\getTrainTestData.asv
文件 2838 2010-06-01 17:14 FSR code\getTrainTestData.m
文件 528 2010-05-31 22:27 FSR code\labelPrediction.asv
文件 1573 2010-06-01 18:07 FSR code\readme.txt
文件 1393 2010-06-01 18:05 FSR code\reduceMatrix.m
文件 3117 2010-06-01 19:36 FSR code\run_sparsity_ba
文件 2421 2010-06-01 17:59 FSR code\sc_main.m
文件 1643 2010-06-01 18:03 FSR code\sparse_coding_methods.m
文件 185727 2005-09-11 15:43 FSR code\tools\dictionary learning\KSVD_Matlab_ToolBox\barbara.png
文件 177762 2005-09-11 15:44 FSR code\tools\dictionary learning\KSVD_Matlab_ToolBox\boat.png
文件 1907 2009-09-03 10:54 FSR code\tools\dictionary learning\KSVD_Matlab_ToolBox\demo1.m
文件 3561 2006-12-12 09:13 FSR code\tools\dictionary learning\KSVD_Matlab_ToolBox\demo2.m
文件 8504 2006-12-28 13:57 FSR code\tools\dictionary learning\KSVD_Matlab_ToolBox\demo3.m
文件 5426 2007-01-24 07:53 FSR code\tools\dictionary learning\KSVD_Matlab_ToolBox\denoiseImageDCT.m
文件 6046 2006-12-12 09:18 FSR code\tools\dictionary learning\KSVD_Matlab_ToolBox\denoiseImageGlobal.m
文件 9088 2007-01-24 07:53 FSR code\tools\dictionary learning\KSVD_Matlab_ToolBox\denoiseImageKSVD.m
文件 3246 2007-01-25 08:39 FSR code\tools\dictionary learning\KSVD_Matlab_ToolBox\displayDictionaryElementsAsImage.asv
文件 3224 2007-01-25 08:39 FSR code\tools\dictionary learning\KSVD_Matlab_ToolBox\displayDictionaryElementsAsImage.m
文件 1896 2006-12-11 14:25 FSR code\tools\dictionary learning\KSVD_Matlab_ToolBox\gererateSyntheticDictionaryAndData.m
文件 5749450 2005-09-21 08:35 FSR code\tools\dictionary learning\KSVD_Matlab_ToolBox\globalTrainedDictionary.mat
文件 34985 2005-09-11 15:44 FSR code\tools\dictionary learning\KSVD_Matlab_ToolBox\house.png
文件 12292 2009-09-03 10:54 FSR code\tools\dictionary learning\KSVD_Matlab_ToolBox\KSVD.m
文件 11585 2006-12-28 14:02 FSR code\tools\dictionary learning\KSVD_Matlab_ToolBox\KSVD_NN.m
文件 151199 2005-09-11 15:44 FSR code\tools\dictionary learning\KSVD_Matlab_ToolBox\lena.png
文件 8053 2006-12-12 08:35 FSR code\tools\dictionary learning\KSVD_Matlab_ToolBox\MOD.m
文件 631 2006-12-11 09:56 FSR code\tools\dictionary learning\KSVD_Matlab_ToolBox\my_im2col.m
文件 1105 2006-12-24 16:00 FSR code\tools\dictionary learning\KSVD_Matlab_ToolBox\NN_BP.m
............此处省略871个文件信息
相关资源
- 基于PCA主成分分析的人脸识别
- oldpac.rar
- 基于ORL库和PCA方法的人脸识别系统m
- 基于神经网络的人脸识别_检测MATLAB模
- 基于稀疏表示和正则化的图像超分辨
- 人脸识别 MATLAB代码
- BP神经网络的人脸识别matlab代码
- PCA人脸降维与单幅图像识别
- 基于MATLAB 的人脸识别
- 基于PCA与KPCA的SVM人脸识别程序含数据
- 基于PCA与SVM的人脸识别matlab代码
- 基于CNN的人脸识别matlab版本.rar
- LDA人脸识别matlab code
- matlab手写卷积神经网络人脸识别
- PCA最近邻分类方法人脸识别
- PCA人脸识别matlab代码
-
人脸数据集 Extended Yale B Databa
seEYa - 基于MATLAB的人脸识别源码
- 人脸识别原理与实战:以MATLAB为工具
- LDA人脸识别MATLAB含k近邻算法
- MATLAB人脸识别PCA实现
- 人脸识别MATLAB,亲测可运行
- 人脸识别MATLAB源程序
- 基于PCA的人脸识别代码MATLAB版
- MATLAB稀疏表示算法
- 基于fisher的线性判别分析(LDA)人脸
- 基于KL变换的人脸识别
- matlab基于bp神经网络的人脸识别
- MATLAB人脸识别.zip
- matlab打开电脑摄像头动态追踪人脸位
评论
共有 条评论