CS 194-26: Image Manipulation and Computational Photography, Fall 2017

Project 4: Face Morphing

David Dominguez Hooper, CS194-26-abs



Overview

In this assignment I produce a "morph" animation of my face into someone else's face, compute the mean of a population of faces and extrapolate from a population mean to create a caricature of yourself. For bells and whistles, I morph my friend Trey's face in 3 different ways!

Part 1: Face Morphing

Defining Correspondences

This section involved selecting corresponding points on the images you wish to morph together. These points will later be linearly interpolated so that the geometry of the faces match, and morph from the first geometry to the second as the video plays.

George Clooney and Jack Nicholson

Computing "Mid-Way" Face

In this section we are trying to find the transformation matrix of each point A, so that we can insert the pixel values from point p on the original image, to point p' in the morphed image. To do this, we define the following equation:

             Ap' = p        (1)
      [a b tx][p'x]   [px]
      [c d ty][p'y] = [py]
      [0 0  1][ 1 ]   [1 ]
    

To find the A matrix, we define triangles of three points, using the Delauney triangulation scheme. To find the transformation of the points inside the triangle defined by points p'1, p'2, p'3 to p1, p2, p3:

      [a b tx][|   |   | ]   [|  |  | ]
      [c d ty][p'1 p'2 p'3] = [p1 p2 p3]
      [0 0  1][|   |   | ]   [|  |  | ]


      [a b tx]   [|  |  | ] ([ |   |  | ]) -1
      [c d ty] = [p1 p2 p3] ([p'1 p'2 p'3])   
      [0 0  1]   [|  |  | ] ([ |   |  | ])   
    

To find all values p' inside the new warped image, all we have to do now is to multiply this A matrix to p', like in equation (1) above.

George
Geck
Jack

The Morph Sequence

To morph two images together, I did the same thing as in the mid-way face, but instead of doing a simple average of the geometry and pixels, I did a weighted average of the geometry and pixels. For each gif, I took 20 steps from the first image to the second one, with 1/4 of a second in between each image. Here are some examples of things I morphed:

George
Jack
Person #10
Average Danish Face
Person #11
Average Danish Face

Part 2: "Mean Face" of a Population

This part involved taking the faces of each person in the dataset, and computing the average geometry. I then transformed each face to have the same geometry, and averaged all the images together. The results of the average is below, along with the average of just the males and just the females.

Average Male Face
Average Danish Face
Average Female Face

Here is my face transformed into the Average Danish shape, and the Average Danish face transformed into my geometry. You can see here that if the two images aren't similar in size, there will be very drastic morphing.

David
David Transformed into Danish
Average Danish Transformed
Average Danish

I morphed some of the faces of the Danish people in the dataset in the previous section.

Caricatures: Extrapolating from the mean

Here is the caricature of myself. To do this, I created the average points of the faces to be equal to my face points weighted by 1.5 subtracted by the average female pts weighted by 0.5. I used these modified "caricature" points to do the morphing and found that even though the results are exaggerated, my eyes look smaller in the picture which shows a hint of some woman qualities.

David
David more feminine eyes caricature
Average Female

Part 3: Bells and Whistles

Change Age and Ethnicity

In the next images, I took an image of my good friend Trey, and made him look more like me.

Trey
Trey with just shape changed
Trey with just appearance changed
Trey with both shape & appearance changed
David