this code requires more input arguments to run
5 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
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 comentarios
Walter Roberson
el 15 de Nov. de 2019
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
el 15 de Nov. de 2019
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?
Respuestas (0)
Ver también
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!