1 | initial version |
My suggestion is that:
Firstly, detect the face region and then, inside the face region, detect the eyes. This process can be done by using cascade classifier of OpenCV (see more at this link-http://docs.opencv.org/doc/tutorials/objdetect/cascade_classifier/cascade_classifier.html).
Based on two eyes’s coordinates, proceed the face cropping algorithm. For this end, you can refer to this link-http://bytefish.de/blog/aligning_face_images/ or this link-http://answers.opencv.org/question/24670/how-can-i-align-face-images/ for further details.
The downside of this approach is that it is heavily depent on the accuracy of face detection and it may not provide the best aligned and cropped face image but it is simple to implement and yet efficient enough since you just want the face region. Hope this helps.