CS194-26 Project 4: Face Morphing

Maxwell Gerber


In this project, we implement an algorithm to create arbitrary morph sequences between similar images. Once this is done, we can use the tools gained to compute other interesting results, including the mean of a collection of images, caricatures based on vector spaces of image features, and 'intelligent' repositioning of features within an image.


First, we need to be able to define pairs of corresponding points between images. I wrote a custom tool to ensure I maintained a consistent labeling of the two input images. Above is a screenshot showing this tool in progress. First you mark a point on the left image, then a point on the right image. Since points can be saved to disk, it is also possible to load a completed set of corresponding points from an old image and then mark those points on a new image - making consistent labelling across images much easier. The second image shows the Delaunay triangulation formed by these points overlaying my face. We will use this to compute morphs later.


To compute the midway face, we must find the weighted average of each corresponding point from image A and B according to the formula (1-t)*A + t*B. At time t=0 the resultant image will be identical to image A. At time t=1 the resultant image will be identical to image B. At time t=.5 we will have the midway face shape. To fill the midway face shape with colors from the input images, we must compute the inverse affine tranformation from each triangle in A to each matching triangle in B. Once we have that we can locally warp each triangle and add the results to get the midway face colors. The images of me, my friend matt, and our halfway merge are shown above.


Once we have a way to compute the midway face, we can compute any arbitrary mix of shapes A and B. By varying 0<=t<=1 we can produce many frames to compose a smooth warp between the two shapes. Warps between me, Matt, and The Zuck are shown above.


We can also compute cool transformations and averages between arbitrary populations of images. Using the data taken from here I have computed the average Danish face, the average male Danish face and the average Female danish face, shown above.


Above you can see the Danish subjects 11-1m and 14-1f morphed so that their shapes match the mean shape. You can also see 11-1m morphed into the mean face entirely.


We can do a similar process with my face shown above and the Danish male mean face. Here, it was necessary to redefine the correspondence points given in the dataset to match with the correspondence points I generated in part 1 of this project. My face gets rounder and my forehead gets much larger. Notice the weird shape that appears on my right eyebrow. Weird, huh?


Here, I show my face moving away from the Danish Male mean face. Various me-isms are greatly exaggerated - note how one side of my face starts to dominate the image? I broke my jaw on that side when I was a kid which led to some weird bone growth. My eyebrows get huge as well.


Here, I apply a lot of the New Zealand Female's face shape to my own, and just a little bit of the New Zealand Female's color to make myself appear more feminine.


Here, I apply these warping techniques to a single image. By shifting all these points 300px to the left, I can reposition the house by warping the landscape around it. I can use this technique to edit images while making sure to not disort the featurespace.