Correspondences
In order to morph from one face to another, we first need to define corresponding points between the images. We will do this by defining points on the images using ginput. I selected 48 points and with a bigger cluster around the eyebrows, eyes, nose, and mouth. I selected this number of points by choosing how many points I wanted to have on each facial feature and the result ended up 48, writing out a list of the points allowed me to select the points in the corresponding order better.Then, using these points, we create a triangularization between the points using the Delaunay triangularization. For the points on the triangle, we average the corresponding points for both images and build the triangularization from this new set of points. This triangular mesh will allow to us to convert from one set of faces to the other using affine transformations.
Computing the "Mid-Way Face"
Using these triangularizations, we can create an affine warp between the corresponding triangles in the images and show the progress of the morph. At the midway point, we have a combination of features from both images resulting in an image with features from the original images.The Morph Sequence
We can show the entire morph sequence by slowly changing the warp and color dissolve. We can create 45 frames to show the sequence of changes and show this as a gif.The "Mean Face" of a population
We can also create a mean face of the population by averaging a set of faces. Using the Danes face dataset, we can create an average face by aligning each face to one of the annotated faces to create this mean Dane face. The mean face was computed from averaging the points of the aligned faces. I then removed the background to make it white in order to conform better to the other pictures.Here is some of the danes shown with the face geometry of the average Dane. This is the normal picture of the Dane and next to it is the Dane warped into the average Dane geometry.
Here is a set of gifs showing the couple of faces in the Danes data set being morphed to the average face.
This is my face as the geometry of the mean face, and the mean face with the geometry of my face.
Here's my face morphed into the average Dane face, and the average Dane face morphed into my face.
Caricatures: Extrapolating from the mean
We can also use this mean face to create a caricature. We can do this by extrapolating the different from img1 to the mean and continue along the vector. This is extrapolated with factor of 1.5 along the vector.Bells and Whisles
Changing the Age/Gender
For the changing the age and gender, I decided to morph me into my mom and see how big the difference is. I thought it would be cool to see, and find out definitively if look more like my mom or my dad. I morphed me into my mom and also morphed me into my dad. I also found the half image of them.I also found my face with my dad's geometry.