Running the Code
These images were created with several Python 3 scripts written from scratch. Matplotlib, numpy, scipy, and skimage are needed to run the code. The Danes data set was used to generate an example of an average face.
Midway Face
The main task in warping the faces into the average shape is implementing an affine warp for each triangle in the triangulation from the original images into this new shape. This involves computing an affine transformation matrix A between two triangles. Once the two images are warped into the same shape (one triangle at a time), their values are cross-dissolved.
Of the midway images I computed, a cross between my friend and her younger sister is one of the most convincing.
I also thought the androgynous looking George-Audrey cross wasn't too bad.
Morph Sequence
I produce a warp between im1 and im2 using point correspondences the user provides through clicks and a triangulation structure generated from their midway shape. The warp fraction and dissolve fraction are incremented through 45 frames, and control shape warping and cross-dissolve, respectively.
The "Mean" Face of a Population
I use the annotated Danes data set to compute the mean face of the Danish population. I first found the average face shape, warped each image to the average shape, and then cross-dissolved all images.
Here are examples of samples from the data set, morphed into the average shape.
My face unflatteringly warped into the average Danish shape (changed the point correspondences slightly to account for differences in image).
The average dane warped into my face shape.
Caricatures: Extrapolating from the Mean
A "caricature" of a face can be derived by extrapolating from the population mean. Here we extrapolate from the Danish mean calculated in the last step.
Bells and Whistles
As a fun addition to face morphing, I decided to try morphing the faces/bodies of two cartoon characters with very different features. Jake and Lady Ranicorn from Adventure Time!!! I've shown both the source images, midway image, and the morph.