doing multiple tests using one run
Mostrar comentarios más antiguos
i am working on a facial recognition system, and i need some help with creating a loop that allows me to do multiple test in one time run, here is the testing part of the code:
prompt = {'Enter test image name:'};
dlg_title = 'Face Recognition System';
num_lines= 1;
def = {'1'};
TestImage = inputdlg(prompt,dlg_title,num_lines,def);
TestImage = strcat(TestDatabasePath,'/',char(TestImage),'.pgm');
im = imread(TestImage);
toc;
recognition_rate=abs(50*(size(N,2)-wrong)/size(N,2))
T = CreateDatabase(TrainDatabasePath);
[m, A, Eigenfaces] = face(T);
OutputName = recog(TestImage, m, A, Eigenfaces);
SelectedImage = strcat(TrainDatabasePath,'/',OutputName);
SelectedImage = imread(SelectedImage);
imshow(im)
title('Image to be tested');
figure,imshow(SelectedImage);
title('Equivalent Image');
any help?
2 comentarios
Walter Roberson
el 10 de Mayo de 2020
Multiple tests? How? Something along the lines of using uigetfile() with 'MultiSelect', 'on', and processing all of the files the user chooses?
zeina abdelaziz
el 10 de Mayo de 2020
Respuestas (1)
Walter Roberson
el 10 de Mayo de 2020
uigetfile() with 'MultiSelect', 'on' in order to get the list of file names.
Note that there is a trick to uigetfile with multiselect on: if the user selects more than one file then the file names are returned as a cell array of character vectors, but if the user selects only one file than the file name is returned as a character vector that is not in a cell array. The way to deal with that is
[filenames, pathname] = uigetfile('*.png', 'Pick some files', 'multiselect', 'on');
if isnumeric(filenames)
return; %user cancel
end
filenames = cellstr(filenames); %character vector will become cell array of character vector
filenames = fullfile(pathname, filenames); %attach the directory
numfiles = length(filenames);
for K = 1 : numfiles
TestImage = filenames{K};
im = imread(TestImage);
and so on
end
1 comentario
zeina abdelaziz
el 10 de Mayo de 2020
Categorías
Más información sobre Semantic Segmentation en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!