this code requires more input arguments to run

조회 수: 5 (최근 30일)
Kalyan Seelam
Kalyan Seelam 2019년 11월 15일
댓글: Walter Roberson 2019년 11월 15일
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
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
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!

Translated by