Reputation: 1367
i am trying to compare just 2 faces and get their likeness - score of how much do they match. I searching internet for solution but I can only find face recognition against set of training images, I cant find if someone has perform research about this problem - I have 2 unknow faces and I wanna find out if its the same person or not. Can you give me any clue, resources anything what could help me? If there is any implementation, it would be great if its - C#, C++ I trying to use openCV- detect faces, recognize faces against some database(get eigen distance) and compare euklidean distances, but I am receiving bad results.(Maybe my approach is wrong and I dont fully understand eigenfaces and euklid distances )
Thanks a lot!
Upvotes: 1
Views: 4338
Reputation: 1250
First, be warned that this is far from a solved problem. In fact it's a relatively area of research in computer vision. Please have a look at the Labeled Faces in the Wild dataset , which uses precisely the task you're talking about, comparing two faces. Of particular interest for you is the results section, which has reports for which algorithms (and the respective papers) work best.
However, it seems all this may be rather advanced. It seems you may not be too familiar with machine learning and/or computer vision, in which case you might want to look at textbooks in these areas.
Either way, the basic thing is this: You don't want to use pixels to compare faces because they change so much with lighting and pose. (You should try it!) So you have to transform pixels in a way that makes faces from the same person similar and faces from different people dissimilar. This is feature extraction, and it is arguably the hardest and most important part of face recognition. How do you know which is the best way to transform them? That's where the training datasets come in. So for example if you use eigenfaces (which should have quite poor performance by the way), you use the training data to get the eigenvectors that best represent this data. Then, two compare two faces you project each face onto the eigenvectors, and use euclidean distance. (This is the same as using Mahalonobis distance).
Upvotes: 1
Reputation: 5148
It seems that what you intend to do is find similarity between the two faces. OpenCV provides basic template matching functionality between two images. Here's a nice explanation and full-fledged C code for doing that.
As explained there, the output of the matching for each point in the images is stored. Getting the match from there is shown in this tutorial, including the various normalizations used.
Also came across this link on fast template matching using the later C++ interface, but haven't used it personally.
If your faces are mug-shots only, with little variation in rotation, perspective etc. then this basic approach should be sufficient for your needs.
Upvotes: 0