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!