Face Recognition matching face detection with stored database
4 views (last 30 days)
Show older comments
I have a databse folder file name "FaceDatabse"
This code last line is "imshow(galleryImage,'Parent',handles.axes2);". It not the right codes because it only show what the image had been upload at axes1.
Please help me change the codes to make it match the face detect witht the image in database.
faceDatabase = imageSet('FaceDatabase','recursive');
galleryImage = getimage(handles.axes1);
[training, test] = partition(faceDatabase,[0.8 0.2]);
[hogFeature, visualization] = extractHOGFeatures(galleryImage);
trainingFeatures = zeros(19,4680);
featureCount = 1;
for i=1:size(training,2)
for j = 1: training(i).Count
trainingFeatures(featureCount,:) = extractHOGFeatures(read(training(i),j));
trainingLabel{featureCount} = training(i).Description;
featureCount = featureCount + 1;
end
personIndex{1} = training(i).Description;
end
faceClassifier = fitcecoc(trainingFeatures,trainingLabel);
queryFeatures = extractHOGFeatures(galleryImage);
personLabel = predict(faceClassifier,queryFeatures);
booleanIndex = strcmp(personLabel, personIndex);
integerIndex = find(booleanIndex);
axes(handles.axes2);
imshow(galleryImage,'Parent',handles.axes2);
0 Comments
Answers (0)
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!