Project 3:
Face Morphing


Author: Isaac Bae
Class: CS 194-26 (UC Berkeley)
Date: 10/6/21


Defining Correspondences


I used a combination of the starter code for aligning images from Project 2 (which uses ginput()) and Photoshop to align my two images (Simu Liu and Chris Hemsworth) appropriately. Then, I defined 62 points (9 for the hair/head, 4 for the nose, 6 for the eyebrows, 7 for the mouth, 8 for the eyes, 10 for the ears, 8 on the face outline, 2 for the neck and 8 on the image borders. With the mean of the two sets of keypoints, I provided a Delaunay triangulation to use for all morphing with the two images.


Simu Liu

simu_fin1
tri_simu

Chris Hemsworth

chris_fin
tri_chris

Computing the "Mid-Way Face"


To compute the mid-way face, you must do 3 things: (1) compute the average shape, (2) warp both faces into that shape, and (3) average the colors togethers. The first step is very simple as you can just take the average of the two sets of keypoints from the two faces. The second step is more difficult. For every triangle from the triangulation done before, you must compute the affine transformation from an original face to the average shape through linear regression or other methods. This should be repeated for the other original face. Then, you can use the inverses of the calculated affine matrices for both faces to find the relevant points in the original images, and use interpolation (e.g. bilinear) to find the correct colors. These colors should then be averaged and mapped back to the warped shape to complete the morph. In practice, there are some steps that can be done differently, but that is the general gist of morphing.


simu_fin1
morph_half
chris_fin

The Morph Sequence


The full morph sequence follows the same guidelines set in the previous section, but you can now use different ratios of warping and cross-dissolving to achieve different levels of morphing. The gif below has 45 frames and is 30 fps.


morph

The "Mean Face" of a Population


I obtained 37 images from a subset of the IMM Face Database and computed the average shape of the faces (using their annotated keypoints). I also added corner points to see the whole image after warping into the mean shape. Here are a few examples.


08-1f
mean_08-1f
33-1m
mean_33-1m
39-1m
mean_39-1m

I took the warped faces and averaged their colors to get the mean face.


Mean

mean_im

I warped the mean face to my image, and vice versa. Here are the results.


mean2simu
simu2mean

Caricatures: Extrapolating from the Mean


To create caricatures, I took the difference between the points for the mean face and my image, scaled it by alpha, and added my points. Here are different results.


alpha = -1.5

simu2mean-1_5

alpha = -1

simu2mean-1

alpha = 1.5

simu2mean1_5

alpha = 2

simu2mean2

Bells and Whistles


Here I wanted to change Simu Liu to an average white American woman.


simu_fin3
ww_fin

I tried out different shape morphs.


Half Shape Morph

hsh_simu

Full Shape Morph

fsh_simu

For the appearance, I didn't think it was interesting to try multiple, so I took the average cross-dissolve.


Appearance Morph

app_simu

Here are the final morph results.


Combined Morph (Half Shape)

hmorph_simu2ww

Combined Morph (Full Shape)

fmorph_simu2ww

Image Links


Simu Liu

Chris Hemsworth

Danes

Average White American Woman