this code requires more input arguments to run
9 次查看(过去 30 天)
显示 更早的评论
function [m, A, Eigenfaces] = EigenfaceCore(T)
m = mean(T,2); % Computing the average face image m = (1/P)*sum(Tj's) (j = 1 : P)
Train_Number = size(T,2);
A = [];
for i = 1 : Train_Number
temp = double(T(:,i)) - m; % Computing the difference image for each image in the training set Ai = Ti - m
A = [A temp]; % Merging all centered images
end
L = A'*A; % L is the surrogate of covariance matrix C=A*A'.
[V ,D] = eig(L); % Diagonal elements of D are the eigenvalues for both L=A'*A and C=A*A'.
L_eig_vec = [];
for i = 1 : size(V,2)
if( D(i,i)>1 )
L_eig_vec = [L_eig_vec V(:,i)];
end
end
Eigenfaces = A * L_eig_vec; % A: centered image vectors
5 个评论
Walter Roberson
2019-11-15
That code does not have any call to EigenFaceCore; and if it did, there would still be the question of how you invoke this function CreateDatabase ?
Walter Roberson
2019-11-15
I suspect that you are running the code by pressing the green Run button in the editor. When you do that, how are you expecting MATLAB to know what the value of TrainDatabase or T should be?
回答(0 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!