Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Rotate face in image

I have a problem, when i take a photo with my tablet, i use opencv for detecting a face and recognition a face. So i would try to rotate the face in order to have for example the eyes and mounth in the same position for example all with the same horizontal angle.
Can you suggest me some OpenCv functions or some useful links for do this?
Thanks in advance.
Marco

like image 762
Marco Gallella Avatar asked Feb 17 '12 14:02

Marco Gallella


1 Answers

I think the opencv remapping tutorial might help http://opencv.itseez.com/doc/tutorials/imgproc/imgtrans/remap/remap.html#remap


Full answer:

Use this to locate the eyes cascade_classifier now when you have a point for each eye - build the line equation and use simple trigonometry to find the angle. when you have the angle - use the remap to rotate or even better use this warp_affine

like image 182
Boaz Avatar answered Nov 20 '22 07:11

Boaz