Face alignment can be thought of as an image processing task consisting of the following steps:
- Identify the facial landmarks (or the facial geometric structure).
- Compute a canonical alignment by estimating a geometric transformation (for example, an affine transform) of the face to be aligned using the landmarks.
Face alignment is a data normalization process—an essential pre-processing step for many facial recognition algorithms. In this recipe, you will first learn how to use the dlib library's face detector to detect the faces from an image containing face(s) and then use the shape predictor to extract the facial landmarks from the detected faces. After that, we will warp the input face (using the estimated transformation) to the output face using the facial landmarks extracted.
The key facial attributes of a face (for example, the corners...