As the shape we are looking for might be distorted, such as an open mouth for instance, we are required to map our texture back to a mean shape and then apply PCA to this normalized texture. In order to do that, we will use triangulation. The concept is very simple: we will create triangles including our annotated points and then map from one triangle to another. Open CV comes with a handy function called
cv CreateSubdivDelaunay2D, which creates an empty Delaunay triangulation. You can just consider this a good triangulation that will avoid skinny triangles.