Project 3: Face Morphing
This project involves producing a morph animation of my face into another person's face, computing the mean face of a population, and extrapolating from the mean to create a caricature.
Part 1: Defining Correspondences
First, I cropped photos of myself and my friend Alice to the same size, then identified corresponding points on our faces using online tools. These points were chosen to capture our facial features and contours accurately.
Part 2: Computing the "Mid-way Face"
In this part, like the previous one, I started by averaging the corresponding points of our two images to obtain the average shape. Then, I wrote a computeAffine function to calculate the matrix required to transform one triangle into another. Next, I used the inverse of this matrix along with a polygon function, which allowed me to warp the faces of both of us to the average shape by providing all the points within the triangle. Finally, I performed a cross-dissolve on the two warped images to blend them together.
Part 3: The Morph Sequence
I used the function from Part 2, but gradually increased the warp_frac and dissolve_frac, which control the amount of warping and cross-dissolving, respectively. Both parameters were slowly incremented from 0 to 1. In the end, I created a GIF consisting of 45 frames, with each frame displayed for 30 milliseconds, to show the entire morph sequence.
Part 4: The "Mean Face" of a Population
In this part, I used the Danes Dataset provided in the instructions, which includes photos of thirty Danish men and seven Danish women. The first thing I did was to parse the labeled points from the .asf files and then average them to obtain the mean shape.
Next, I warped each face into the mean shape, and here are some examples.
I then take average of all the warped faces to get the mean face.
Finally, I warped my face into the mean danes face, and vice versa. And I also morphed my face into the mean danes male face, and vice versa.
Part 5: Caricatures: Extrapolating from the mean
In this section, I created caricatures by extrapolating from the population mean established in the previous part. Below are the results of exaggerating either my own facial features (alpha > 1) or the average facial features (alpha < 0).
Bells and Whistles
Bells and Whistles 1: Change of Gender
For this experiment, I started by sourcing an image of the average Chinese male face from this website. I then cropped my friend Alice's photo to match the size of this image. Using the same method as before, I identified corresponding points between these two images. I experimented with different techniques: warping only the shape, only using cross-dissolve, and combining both. I discovered that a warp fraction of 0.7 and a dissolve fraction of 0.7 provided the most visually appealing results.
Bells and Whistles 2: PCA and Eigenfaces
Initially, I flattened the entire dataset of Danish faces and applied Principal Component Analysis (PCA) to extract eigenfaces. I then attempted to generate random faces by sampling from these eigenfaces. Due to the images in the dataset not being aligned, the results were not very clear. However, the essential concept is that if the faces were aligned, we could use this method to create random faces or blend specific facial features based on eigenfaces to produce customized appearances.
Bells and Whistles 3: Music Video
To better illustrate the face morphing process, I've created a music video for myself using my images when I was 1 month, 3 years, 13 years, 17 years, and 21 years old. Between every two images, I used 35 images for the transition.