How to align face images c++ opencv

OntoBLW picture OntoBLW · Apr 13, 2012 · Viewed 16.4k times · Source

I am developing a C++ application for face authentication. First, I have to detect the face and pre-process the image.

  1. For face detection I have used the HaarCascadeClassifier. The problem is that the this tool or this algorithm gives me a facial region detected by a little bit large rectangle that englobes hair and some of the background. Is there a solution to change the dimension of this rectangle? I used "frontalfacecascaadclassifier.xml".
  2. For face pre-processing i want to do face alignment exactly like this technique. How would I go about accomplishing this?

Answer

bytefish picture bytefish · Apr 15, 2012

Finding the accurate position of the eyes in a given image is far from trivial. The Haar-cascades for finding the eyes in OpenCV produce too many false positive to be useful, moreover this approach won't be robust to image rotation (it may compensate slight rotation though, I don't know the training images). If I were you I'd start a breadth-first search on http://scholar.google.com for relevant papers of this research area.

You'll need a robust head pose estimation for aligning face images. I did some research myself and I think sharing algorithms and code is useful here. The most interesting approaches I have seen are: