Compare two faces (and their likeness)

Marco L. picture Marco L. · Jul 6, 2011 · Viewed 13.5k times · Source

Is there is a way to compare two faces (perhaps with OpenCv) and get a score of their likeness? I mean to apply a facial recognition algorithm, but only between 2 faces, not on an entire dataset.

The problem is that, for example, Eigenfaces requires at least 2 training images.

Answer

rossb83 picture rossb83 · Aug 11, 2011

Yes, you can absolutely use eigenfaces. The training faces have nothing to do, with the two faces you are comparing for facial recognition. Have a training face gallery of say 100 faces. Then to compare your two faces (face_1 and face_2), do an eigenface decomposition of each face with the 100 faces in your training gallery. So for example face_1 = [2 3 1 5...]*[eigFace1 eigface2 eigface3 eigface4...]' and same for face two. That vector I showed above in the example [2 3 1 5...], compare it for each of your two face decompositions in some sort of distance algorithm (whether it be a euclidean distance or some other distance metric). If the distance within a certain threshold then you can say they are the same. Keep in mind, if you are using eigenfaces the pose, lighting conditions, size, and background of all the training images as well as the faces you are trying to compare must all be normalized. The eyes, noses, a mouths must also be as lined up as possible.