Opencv FaceRecognition can not predicte new face? (Bug #2634)


Added by tianliang feng about 12 years ago. Updated over 9 years ago.


Status:Open Start date:2012-12-17
Priority:Normal Due date:
Assignee:Philipp Wagner % Done:

0%

Category:legacy, contrib
Target version:-
Affected version: Operating System:
Difficulty: HW Platform:
Pull request:

Description

Opencv FaceRecognition have 2 phase:training and predicting,After training, In the first phase,we trained 2 persons s1 and s2,
s1/1.pgm;0 s1/2.pgm;0 s1/3.pgm;0 s1/4.pgm;0 s2/1.pgm;1 s2/2.pgm;1 s2/3.pgm;1 s2/4.pgm;1 then in the seconde phase,
if I predict s1/5.pgm(whichever belong to person s1),i can get the label 0 and it is correct. if I predict s3/5.pgm(which is a face of a new person),the predicting result may be 0 or 1 but no -1,and it is wrong!
I want to know when the I can get -1 by using predict method or how can I know the face belong to a new person?

Look foward to your soonest reply! Thanks!

The original post is at
http://answers.opencv.org/question/4604/help-opencv-facerecognition-can-not-predicte-new/


Associated revisions

Revision 0e1bf581
Added by Alexander Alekhin almost 11 years ago

Merge pull request #2634 from ElenaGvozdeva:ippiDCT

History

Updated by Alexander Shishkov about 12 years ago

  • Category set to legacy, contrib
  • Priority changed from Blocker to Normal
  • Assignee set to Philipp Wagner

Updated by Shervin Emami about 12 years ago

I have also noticed this problem, that the FaceRecognizer's method of determining if someone is known or unknown is too unreliable. The task can be treated as "Face Verification", where you have a photo of a person and you need to decide if it really is that person or not. I wrote a more reliable solution for the Mastering OpenCV book (code is at "https://github.com/MasteringOpenCV/code/tree/master/Chapter8_FaceRecognition"):

// Generate a face approximation by back-projecting the eigenvectors & eigenvalues.
Mat reconstructedFace;
reconstructedFace = reconstructFace(model, preprocessedFace);

// Verify whether the reconstructed face looks like the preprocessed face, otherwise it is probably an unknown person.
double similarity = getSimilarity(preprocessedFace, reconstructedFace);

It usually works quite well for Eigenfaces/PCA because you have a lot of images available to reconstruct the face. For Fisherfaces it won't work quite as well but it still seems to be much more reliable than FaceRecognizer's existing solution of just loking at the Euclidean distance as the confidence metric to threshold.

Feel free to replace the threshold technique of FaceRecognizer with some of the code from the book if you think it is a good idea.
-Shervin Emami.

Updated by Maksim Shabunin over 9 years ago

Issue has been transferred to GitHub: https://github.com/Itseez/opencv/issues/4472

Also available in: Atom PDF