Project 4: Face Morphing

Aditya Batra (cs194-26-aen)

Overview

In this project, I smoothly morph faces between each other, compute an average of a set of faces, and create a caricature of my face. In additon, I made a music video showing a morph between the faces of me and my roomates. To do a smooth morph, I warp the shapes of the two image faces and cross dissolve the colors of the two images. To do a warp, I annotated a set of corresponding points between the two faces and computed a mid shape based on the two point sets. With this mid shape, I computed a Delaunay triangulation of the mid shape and used the resulting triangle mesh to compute affine transformations between corresponding triangles. In particular, given a shape I wanted to morph an image into, I calculated the transform between a triangle in the endpoint image and the corresponding triangle in the original image. Based on this transformation, I am able to map coordinates in the final image to coordinates in the original image. Then, I take the pixel value of the coordinates in the original image and set that as the pixel value of the corresponding coordinates in the final image. For coordinates that are on the boundary of pixels, I used interpolation on the original image. After warping two images into the proper shapes, specified by a warp paramter, we cross dissolve the two images based on a cross dissolve parameter.

Mid-Way Face

To compute a mid-way face, I did the warp mentioned above from my face to the mid shape and I also did a warp from the second image (Daniel Radcliffe) to that mid shape. Then I cross dissolved the two resulting images equally. The result is shown below.


My face

Daniel Radcliffe Face

Mid-Way Face

The Morph

For the actual morph sequence, I created 45 frames where I steadily increased a warp parameter and cross dissolve parameter from 0 to 1. These parameters determine the inbetween shape that I try to warp both images into and the cross dissolve parameter determines how much of both images go into the resulting frame. The closer the parameters are to 1, the more of the second image influences the resulting frame. With all 45 frames, I then made a gif of the morph, which is shown below.


The Morph

The "Mean Face" of a Population

Next, I used the annotated faces in the FEI database to create a "mean face". Using only the non-smiling faces, I computed an average face shape using the annotated keypoints. Then, I warped each face my set into this average shape and two examples are shown below. Then, I computed the average face of the population with cross dissolving. Finally, I show my face warped into the average geometry and the average face warped into my geometry. For these last two, I use my own keypoints to line up my face with the average face.


Face Warped into Average Shape

Another Face Warped into Average Shape

Mean Face

My Face Warped into Avg. Geometry

Avg. Face Warped into My Geometry

Caricatures: Extrapolating from the Mean

To make a caricature of my face, I created a difference vector between my face shape and the shape of the mean face from the FEI database. I then added this vector multiplied by 2 to my face shape and warped my face image into the resulting new vector. By extrapolating away from the mean, my differences from the norm, such as my asymmetric facial structure, are emphasized creating a caricature.


Caricature

Bells and Whistles: Roomate Morphing Video

I created a music video that morphs between the faces of me and my roommates.

Here is the youtube video: Youtube Link