this code requires more input arguments to run

1 回表示 (過去 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