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.

Jason and Alice

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.

Jason's Face

Jason's Face

Mid-way Face

Mid-way Face

Alice's Face

Alice's Face

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.

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.

Population Mean

Next, I warped each face into the mean shape, and here are some examples.

Face Pair 1A

Original

Face Pair 1B

Warped to Average

Face Pair 2A

Original

Face Pair 2B

Warped to Average

Face Pair 3A

Original

Face Pair 3B

Warped to Average

Face Pair 4A

Original

Face Pair 4B

Warped to Average

I then take average of all the warped faces to get the mean face.

Trio 1

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.

morph_jason_to_danes

Jason to Danes

morph_danes_to_jason

Danes to Jason

morph_jason_to_danes_male

Jason to Danes Male

morph_danes_male_to_jason

Danes Male to Jason

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).

Caricature 1

Jason (alpha = 1.5)

Caricature 2

Jason (alpha = -0.3)

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 1

Alice

Bells and Whistles 1

Average Chinese Male

Bells and Whistles 1

Alice to Avg Chinese Male (Both Warp and Dissolve)

Bells and Whistles 1

Alice to Avg Chinese Male (Warp Only)

Bells and Whistles 1

Alice to Avg Chinese Male (Dissolve Only)

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.

Danes Eigenfaces

Danes Eigenfaces

Danes Male Eigenfaces

Danes Male Eigenfaces

Danes Female Eigenfaces

Danes Female Eigenfaces

Sampled Face

Sampled Face

Sampled Male Face

Sampled Male Face

Sampled Female Face

Sampled Female Face

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.