face recognition program
% Acquire new image
% Note: the input image must have a bmp or jpg extension.
% It should have the same size as the ones in your training set.
% It should be placed on your desktop
InputImage = input('Please enter the name of the image and its extension \n','s');InputImage = imread(strcat('C:\Users\Sudha\Desktop\',InputImage));figure(5)subplot(1,2,1)imshow(InputImage); colormap('gray');title('Input image','fontsize',18)InImage=reshape(double(InputImage)',irow*icol,1); temp=InImage;me=mean(temp);st=std(temp);temp=(temp-me)*ustd/st+um;NormImage = temp;Difference = temp-m; p = []; aa=size(u,2); for i = 1:aa pare = dot(NormImage,u(:,i)); p = [p; pare]; end ReshapedImage = m + u(:,1:aa)*p; %m is the mean image, u is the eigenvector
ReshapedImage = reshape(ReshapedImage,icol,irow); ReshapedImage = ReshapedImage'; %show the reconstructed image.
subplot(1,2,2) imagesc(ReshapedImage); colormap('gray'); title('Reconstructed image','fontsize',18) InImWeight = []; for i=1:size(u,2) t = u(:,i)'; WeightOfInputImage = dot(t,Difference'); InImWeight = [InImWeight; WeightOfInputImage]; end ll = 1:M; figure(68) subplot(1,2,1) stem(ll,InImWeight) title('Weight of Input Face','fontsize',14) % Find Euclidean distance
e=[]; for i=1:size(omega,2) q = omega(:,i); DiffWeight = InImWeight-q; mag = norm(DiffWeight); e = [e mag]; end kk = 1:size(e,2); subplot(1,2,2) stem(kk,e) title('Eucledian distance of input image','fontsize',14) MaximumValue=max(e); MinimumValue=min(e);
the error is
??? Error using ==> ctransposeTranspose on ND array is not defined.Error in ==> Mio at 164InImage=reshape(double(InputImage)',irow*icol,1);
plz help me solve this error…
Best Answer