Steph
Steph

Reputation: 659

Align profile face image with its frontal face image

I have a profile face:

enter image description here

and a frontal face image:

enter image description here

Output: aligned profile face with reference to frontal face.

Idea: I just need to know which 3 common points I can take,which will be visible on both faces and then use affineTransform and display the aligned profile face

      OR any other **simple method** of doing so

development envi.:c++ and opencv 2.4.2

what I tried:

  1. haarcascade feature detection(common detection point in both images=eye) ; it wont detect ear in frontal face
  2. OpenCV: Shift/Align face image relative to reference Image (Image Registration) (I get error message)

Upvotes: 5

Views: 5360

Answers (2)

Vlad
Vlad

Reputation: 4525

If you look for something really simple you can treat your mouth as a line on a planar object and calculate the rotation by the amount of line foreshortening. You should never smile though when you take pictures nor when you write your code.

A much cooler approach though would be to map your face as a texture to a predefined 3D model and rotate it until it correlates best with your profile view.

Of course, the right way to do this is to use a set of different head rotations to train a binary classifier that does only pairwise intensity comparisons as in Lepetit paper.

Upvotes: 1

herohuyongtao
herohuyongtao

Reputation: 50717

As discussed here by @bytefish, 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.

You'll need a robust head pose estimation for aligning face images. Here are two most robust ones (with code available):


For example, using the method described in the second paper, you will get more robust features like that are shown in the following images. And these robust features will, in turn, ensure to generate more robust face alignment performance.

enter image description here

enter image description here

Upvotes: 5

Related Questions