Using Flandmark Model to align face with Open CV in Android

 

One of the fundamental requirements for successful face recognition is to reduce the environmental noise from the pictures.

Scaling and aligning pictures before it is send for training and recognition using any of the Open CV’s recognition classes will
improve the overall accuracy .

I found a very nice example online that is written in C++ for aligning the faces

http://answers.opencv.org/question/24670/how-can-i-align-face-images/

The basic theory is that using flandmark the position of the eyes is calculated . Next the angle of rotation has to be calculated from the desired final alignment .
This is done by using linear regression , then the image is rotated and saved.

I wanted to try this in android and found that Java CV has made the Java bindings for Flandmark (for Java CV and Open CV own’s Java bindings check here). It was just the matter of
converting the c++ code to java and trying  it out in android. The result is pretty decent , some tweaking of size and parameters could be required.

You can download the code here.

To build the code you will have to download open CV for android from here.

Get it on Google Play
Siyanatullah Khan

Siyanatullah Khan

Mobile Software consultant with a penchant for blogging.

More Posts

Follow Me:
TwitterLinkedInGoogle Plus

Add a Comment

HTML Snippets Powered By : XYZScripts.com