CS 194-26 Spring 2020

Project 3: Face Morphing

Alex Shiyu Liu, cs194-26-afw

Overview

This project covers creating a face morphing animation between two faces, computing a mean of a collection of faces, and extrapolating from that mean face to create caricatures.

Defining Correspondences

Above are images of Brad Pitt and George Clooney that I use to morph together. (I used Brad Pitt's face in lieu of my own for any sections requiring mine.) I used the cpselect function in python to define pairs of corresponding points of the two images by hand. Then I used the Delaunay function from the scipy library to compute a Delaunay triangulation of the selected points. The images with their triangulation overlayed are below:

Computing the "Mid-Way Face"

In this section I compute the mid-way face of Pitt and Clooney. The process is to compute the average shape of the faces, warp both faces into that shape, then average the image colors together. I implemented an affine warp function that found the transformation matrix between two triangles defined by their vertices. Then I used this function to compute inverse tranformation matrices to map points between images. The result is as follows:

The Morph Sequence

In this section I create the morph sequence from Pitt to Clooney. I created a function, morphed_im, that produces a warp between the two images using the point correspondences, triangulation structure and parameters warp_frac and dissolve_frac. The warp_frac parameter determines the proportion of the face shape that is from each image and the dissolve_frac parameter determines the proportion of the color that comes from each image, i.e. the cross-dissolve. Then, I used this function to iterate over warp_frac and _dissolve_frac parameter values from 0 to 1 to get warped images of Pitt and Clooney. I collected these images and converted them into a gif of 45 frames with 30 fps. The result is as follows:

The "Mean Face" of a Population

In this section I used the Danish computer scientists face dataset given in the project spec. Some examples from the data set are below:

I computed the mean face from this set of faces using the same technique above, using the entire set of images instead of two images. The result is as follows:

Next, I morphed some of the faces into the mean geometry of the faces. The images and their results are in order below:

Lastly,I warped Brad Pitt's face into the mean geometry of the face dataset and also warped the mean face into Brad Pitt's geometry. The results are in order below:

Caricatures: Extrapolating from the Mean

In this section I create caricatures of Brad Pitt's face by extrapolation with the population mean face from the previous section. The first image below of Brad Pitt is created by extrapolating Pitt's geometry from the population mean geometry:

The next image shown below is Pitt's geometry and color extrapolated from the population mean geometry and color.

The last image below is the same geometric extrapolation, but now the population mean color is extrapolated from Pitt's color:

Bells and Whistles

In this section, I change the ethnicity of Brad Pitt to hispanic by morphing with the average Mexican male face found online:

The first image below is a morph of just the shape of the Mexcian mean to Brad Pitt:

The next image below is a morph of just the color of the Mexcian mean to Brad Pitt:

The last image below is a morph of both the shape and color of the Mexcian mean to Brad Pitt:

Conclusion

This project was very interesting in that it exposed me to the basics of face morphing and wrapping. These techniques are widely used in applications like face filters on Snapchat and other social medias. I feel that I now know a lot more about how these techniques are implemented.