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

Project 3: Face Morphing

Alan Nguyen, cs194-26-ags


Part 1: Defining Correspondences

I handpicked 41 feature points for both my source and target image through a UI. For my source image, I used George Clooney. For my target image, I used Clint Eastwood. The features were primarily all around the face. Afterwards, I created a mid-way shape consisting of the average feature points from both the source and target image.



Computing the "Mid-way Face"

As previously mentioned, I computed the average shape and its Delaunay triangulation. Then, I warped two faces into that shape by doing the following for each midway triangle:

  1. Computing the Affine matrix by essentially performing the dot product between the target matrix and the inverse source matrix.
  2. Creating a polygon, covering all of the pixels in the current midway triangle.
  3. For each midway pixel, I performed an inverse warp operation from the midway pixel to the source pixel with the inverse Affine matrix.
  4. Interpolated each result of the inverse transformation into the source image.
This process was done between the source image and the average shape, as well as the target image and the average shape. After getting the mid-way face for both images, I cross-dissolved their colors together to create one final mid-way face between the source and target images.

Morph Sequence

Instead of calculating the mid-way shape with a weight of 0.5, I used a weight t, such that t is a time interval from 0 to 1 with step size 1/45 (since our morph sequence will be a 45-frame GIF). I essentially repeat the same algorithm from the previous part, except the only difference being that my cross-dissolve weights are entirely dependent on t rather than 0.5.

Mean Face

I used the Danes dataset to calculate the average set of correspondences, the "average" face. Below are some examples of Danish faces warped to the average shape:

When computing the average face of the dataset, we notice that the entire dataset consists of 33 males and 7 females. Hence, the average face appears to be male.

Here's how I look originally, (and also with the average shape), and how the average face looks like with my shape!

Caricatures

Turns out, we can make caricatures of ourselves by extrapolating from the population mean! The way extrapolation works is that for points P and Q and k, we have the following equation P + k(Q - P). As k approaches infinity, the image will shift more towards the average Dane. On the other hand, the image will shift more towards my facial structure as k approaches negative infinity!

(-1.5 towards me) (+1.5 towards average Dane)

Bells & Whistles

Here's what the average Danish female looks like, according to the dataset (recall that there are only 7 females total in the dataset):

Now, here's me changing my ethnicity and gender to the typical Danish female. The below images feature various properties of how I look like as a completely different person.

Only the shape is warped; no cross-dissolving. Cross-dissolving only. Complete morph from asian male to Danish female.