CS 194-26

Face Morphing!

Randy Fan



Overview

In this project, I implemented face morphing using averaging, triangulation, and affine transformations to combine faces together and output new, interpolated faces (or extrapolated for caricatures). The morph required us to determine key, corresponding points on the images, which consists of the main facial features (e.g.eyes, nose, mouth, etc.) and the head structure. The morphs worked particularly well for faces that were well-aligned.

To get full credit, you will need to implement a warping algorithm and turn in a video morph (submit a link to Youtube or animated gif) as well as the mid-way face.

Explanation for Defining Correspondences, computing the "Mid-Way Face": To get the correspondences, I used plt.ginput and saved the point coordinates into an array. I had to make sure the key points in the two images corresponded to one another. This was crucial for getting a nice-looking morph. To compute the "Mid-Way Face", I computed the average face structure by averaging the point coordinates obtained from the "Defining Correspondences" part. Then, I found the Delaunay triangulation of this average face structure. The triangulation is important for getting the correct affine transformations and color. After triangulating, I warped both of our images (faces) into that averaged face structure and used inverse affine transformations to get the correct coloring. To get the morph sequence, I simply varied the weights from 0 to 1 using an interval of size 1/45 (due to the requirement of 45 frames). This creates a sequence of images that vary on how much weight/emphasis to place on each image's face structure (defined by the corresponding points) and coloring.

Klay Thompson and Steph Curry:

Below is the mid-way face:

Mid-way face of Klay and Steph

Below is an animated gif of the morph:

Klay to Steph
Klay to Steph Slow

You will also need to compute the mean face of a population and show results of warping faces into the mean face and producing caricature

Explanation for the "Mean Face" of a population and Caricatures. I found the average face from the Dane's data set, using their neutral expression image. To do this, I first computed the average shape of all the Dane images I was using, then I morphed each Dane face into the average shape. Finally, I calculated their average face, which was the resulting image.

Here is the average face of the Danish faces (neutral expression):

Avg face of the Danish faces (neutral expression)

Here are some examples of morphing the faces into the average shape:

Here is my face.

Here is my face warped into the average geometry.

Here is the average face warped into my geometry.

To get the caricatures, I simply extrapolated from the mean image, meaning I used weights that were greater than 1 or less than 0. Below are a few examples:

Warp factor = 1.7
Warp factor = -0.4

This time you are required to also do at least one bells and whistles option.

I decided to do the following bell & whistle: "Change age/gender/ethnicity/smile/etc of your (or your friend's) face. You can use average images off the web for this, no need to recompute the averages yourself (unless you want to). Show morphing just the shape, just the appearance, and both."

I changed the smile and ethnicity of my face by using the average Dane smiling data set (not the neutral expression I had used in the previous part). Then, I morphed my face into the average shape of those smiling Dane images. Separately, I performed a naive cross-dissolve of my face with the average face. Lastly, I combined shape morphing with cross-dissolve to create a more realistic-looking morph.

First, here is the average Danish smiling face

Morph my face into average face
Naive cross-dissolve
Morph