MasteringOpenCV / code

Code for the book "Mastering OpenCV with Practical Computer Vision Projects" by Packt Publishing 2012.
Other
2.71k stars 1.64k forks source link

Chapter8 FaceRecognition: Some points and questions #88

Closed Bahramudin closed 7 years ago

Bahramudin commented 7 years ago

I check the entire code for the face recognition, I found some question going to ask here

  1. Do all the images per person must be the same count? I want to know that, is this important to have the same count of images per person (e.g: 10 image/person) to train faces in Eigen/Fisher/LBPH FaceRecognizer? Or it can be different count (person1: 10 images, person2: 20 images, ...)

  2. In the recognition part, the reconstructed face for Eigenfaces was not similar for with the current pre-processed face, so the NORM_L2 algorithm always returns high value (it was completely no similar), so unable satisfy this condition:if (similarity < UNKNOWN_PERSON_THRESHOLD). But the reconstructed face for the Fisherfacewas a little OK.

  3. I am wondering why using the NORM_L2 algorithm for calculating confidence value? Because the NORM_L2 is not a face recognition algorithm so, sometimes the same face can be very different and sometimes two different faces can be very similar, so in these both situation the confidence value is wrong. And more important if we use the NORM_L2 algorithm for calculating the confidence value, it can cause the recognition algorithms (Eigenfaces, Fisherface, LBPH) behavior goes under the question, that how it is possible that recognition algorithm even cannot calculate the confidence value?

shervinemami commented 7 years ago

1) It can be different. Ideally it's fairly similar, to give a more uniform probability. 2) see below. 3) As mentioned in the book, this confidence metric is not perfect, it's just an OK method to begin with, and much more reliable than simply using the Eigenvalue distance, but there are many academic research papers each year showing better algorithms for face recognition & verification. So this code is not going to give you the world's best recognition, it will just give you something simple enough to get you started.