Can anyone Help me with the Errors in this code? It's about Face Recognition using Eigenfaces
Answers (2)
You have
gui_State = struct('gui_Name' mfilename, ...
'gui_Singleton', gui_Singleton; ...
'gui_OpeningFcn' @FaceRec_OpeningFcn, ...
'gui_OutputFcn' @FaceRec_OutputFcn, ...
'gui_LayoutFcn' [] , ...
'gui_Callback', []);
You need commas between all of the parts, and the semi-colon needs to be a comma
gui_State = struct('gui_Name', mfilename, ...
'gui_Singleton', gui_Singleton, ...
'gui_OpeningFcn', @FaceRec_OpeningFcn, ...
'gui_OutputFcn', @FaceRec_OutputFcn, ...
'gui_LayoutFcn', [] , ...
'gui_Callback', []);
You have
[filename, pathname] = uigetfile ('*.jpg',Load Image');You are missing the opening ' for the second string
[filename, pathname] = uigetfile ('*.jpg','Load Image');You have
eval('img==imread(str);');
That asks to compare img to the result of imread(). That is a problem because img is probably not defined at that point. But it might be defined, depending on exactly which variables were in the two .mat that you load()'d.
You should probably change that to
img = imread(str);
Warning: the files you are trying to read might not be in the current directory...
You have
cpy=imagesc(ReshapedImage);
That leaves cpy as being the handle to an image() object that is displaying that image.
You have
if(img==cpy)
but it looks like img is intended to be the result of reading the file in as data. The image data is never going to equal the graphics handle. I do not know what you were trying to do there.
0 votes
Categories
Find more on Weather and Atmospheric Science in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!