Face Morphing

COMPSCI 194-26: Computational Photography & Computer Vision

Professors Alyosha Efros & Angjoo Kanazawa

October 6, 2021

Ethan Buttimer

Overview

By taking advantage of the property that human faces are generally a linear subspace (given a correspondence of face shapes), we can write code to smoothly morph between faces, extrapolate from a population mean, and more!

Defining Correspondences

Ethan Yuan Lavrenti

I manually defined the cooresponding landmark points for my own face and two others. I augmented each set of points with evenly spaced points along the edges of the image, so that the entire image could be triangulated. In order to generate these triangulations, I used the Delaunay triangulation algorithm. For the morphs in the following sections, I computed the triangulations for the mean face shape of the morph to obtain optimal triangles that don't become too thin/sharp.

Midway Images

Ethan Yethan Yuan

I created midway images by separately computing the average shape (weighted by warp_frac) and the average color once the source images are morphed to that average shape. A unique affine transformation is applied to all of the point coordinates within a particular triangle of the mean shape in order to sample colors from the correct locations on one of the source images. Since this inverse warping generated non-integer sample coordinates, bilinear interpolation must be used to compute a sampled color as a weighted average of the four nearest pixels. The samples from the two images are then averaged together using a weight dissolve_frac. This process is repeated for each triangle, and all are added together using a pixel mask of each triangle. For the midway image, dissolve_frac and warp_frac equal 0.5.

Ethan Lavrenthan Lavrenti

Morph Sequence

The morph sequence is a seried of morphed images, with gradually increasing weight given to the second image in both shape and color space. I compiled these images into a repeating gif.

Mean Face of a Population

I used the Danish IMM Face Database as the source for my population-mean image. I pruned grayscale images and images of females in order to get a consistent population. Then, I parsed the .asf files to obtain the correspondence points of all of the images, and averaged these points to obtain the average Danish male face shape. Next, I morphed all of the images to this average shape (some examples are shown below) and averaged them pixel-wise to get the final population-mean image, shown above!

Original Shape Warped to Population Mean

I then labeled the correspondence points of the population-mean image according to the scheme I used for my own images. Once I did that, I was able to compute morphs between that population mean and my own face. These included purely shape-based morphs, like those shown below.

Ethan Avg. Dane warped to Ethan Shape
Ethan warped to Avg. Dane Shape Avg. Dane

Caricature

To caricature myself, I warped my face shape away from the Danish population mean using a negative warp_frac. Really brought out my thin nose and lips!

Changing Gender and Ethnicity (Bells and Whistles)

Finally, I found a composite image representing the average Brazilian woman and labeled its correspondence points. As with the Danish mean image, I warped the shape of the Brazilian into my face shape and vice-versa (shown below). I also morphed both shape and appearance to obtain the midway image shown above.

Ethan Avg. Brazilian Woman warped to Ethan Shape
Ethan warped to Avg. Brazilian Woman Avg. Brazilian Woman