Face Recognition matching face detection with stored database
显示 更早的评论
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 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Keypoint Detection 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!