资源简介
经典文献“Non-negative Matrix Factorization with
Sparseness Constraints”的实现代码(MATLAB)
代码片段和文件信息
function V = cbcldata
% cbcldata - read face image data from cbcl database
%
global imloadfunc;
% This is where the cbcl face images reside
thepath = ‘../data/cbcl-face-database/face/‘;
% Create the data matrix
V = zeros(19*192429);
% Read the directory listing
D = dir(thepath);
% Step through each image reading it into the data matrix
% Note: The (+2) is just to avoid ‘.‘ and ‘..‘ entries
fprintf(‘Reading in the images...\n‘);
for i=1:2429
switch imloadfunc
case ‘pgma_read‘
I = pgma_read([thepath D(i+2).name]);
otherwise
I = imread([thepath D(i+2).name]);
end
V(:i) = reshape(I[19*19 1]);
if rem(i100)==1 fprintf(‘[%d/24]‘floor(i/100)); end
end
fprintf(‘\n‘);
% Same preprocessing as Lee and Seung
V = V - mean(V(:));
V = V / sqrt(mean(V(:).^2));
V = V + 0.25;
V = V * 0.25;
V = min(V1);
V = max(V0);
% Additionally this is required to avoid having any exact zeros:
% (divergence objective cannot handle them!)
V = max(V1e-4);
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2006-08-03 11:02 nmfpack\
文件 6862 2006-08-03 11:02 nmfpack\README
目录 0 2006-08-03 11:02 nmfpack\code\
文件 4932 2006-08-03 11:02 nmfpack\code\nmfsc.m
文件 569 2006-08-03 11:02 nmfpack\code\natdata.m
文件 6585 2006-08-03 11:02 nmfpack\code\main.m
文件 1914 2006-08-03 11:02 nmfpack\code\nmfdiv.m
文件 933 2006-08-03 11:02 nmfpack\code\sampleimages.m
文件 1551 2006-08-03 11:02 nmfpack\code\visual.m
文件 3209 2006-08-03 11:02 nmfpack\code\projtest.m
文件 1841 2006-08-03 11:02 nmfpack\code\nmfmse.m
文件 2019 2006-08-03 11:02 nmfpack\code\snmf.m
文件 2010 2006-08-03 11:02 nmfpack\code\lnmf.m
文件 1002 2006-08-03 11:02 nmfpack\code\cbcldata.m
文件 1257 2006-08-03 11:02 nmfpack\code\orldata.m
文件 1509 2006-08-03 11:02 nmfpack\code\projfunc.m
文件 3993 2006-08-03 11:02 nmfpack\code\pgma_read.m
目录 0 2006-08-03 11:02 nmfpack\data\
目录 0 2006-08-03 11:02 nmfpack\data\cbcl-face-databa
目录 0 2006-08-03 11:03 nmfpack\data\orl-faces\
目录 0 2006-08-03 11:02 nmfpack\data\orl-faces\s1\
文件 10318 2006-08-03 11:02 nmfpack\data\orl-faces\s1\1.pgm
文件 10318 2006-08-03 11:02 nmfpack\data\orl-faces\s1\10.pgm
文件 10318 2006-08-03 11:02 nmfpack\data\orl-faces\s1\2.pgm
文件 10318 2006-08-03 11:02 nmfpack\data\orl-faces\s1\3.pgm
文件 10318 2006-08-03 11:02 nmfpack\data\orl-faces\s1\4.pgm
文件 10318 2006-08-03 11:02 nmfpack\data\orl-faces\s1\5.pgm
文件 10322 2006-08-03 11:02 nmfpack\data\orl-faces\s1\6.pgm
文件 10321 2006-08-03 11:02 nmfpack\data\orl-faces\s1\7.pgm
文件 10318 2006-08-03 11:02 nmfpack\data\orl-faces\s1\8.pgm
文件 10318 2006-08-03 11:02 nmfpack\data\orl-faces\s1\9.pgm
............此处省略434个文件信息
- 上一篇:无线信道传播建模与仿真MATLAB源代码
- 下一篇:shearlet变换代码包
评论
共有 条评论