How to align face images c++ opencv

后端 未结 9 524
慢半拍i
慢半拍i 2020-12-13 05:13

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 HaarC
9条回答
  •  谎友^
    谎友^ (楼主)
    2020-12-13 05:50

    Can't you then use another Haar classifier to find each eye (eyes are very easy to find) then assuming the person has two eyes and we define a 'level' face to mean the eyes are horizontal.

    Simply measure the anlge between the two eyes and rotate the image by that angle.

    angle = atan ( eye1.Y - eye2.Y ) / (eye1.X - eye2.X )
    

提交回复
热议问题