CS 280A: Intro to Computer Vision and Computational Photography, Fall 2024

Project 3: Face Morphing

Jasper Liu

Overview

In this project, I morphed my face into someone else's, found the average face of a female and male, and made caricatures.

Part 1: Defining Correspondences

In this part, I marked key points on both my face and George's face using ginput in Python to save them. I selected a total of 60 points, plus 4 corners. Then, I generated a Delaunay triangulation for the corresponding points.

Gradient X

Jasper

Gradient Y

George

Part 2. Computing the "Mid-way Face"

To compute the mid-way face of two different faces:

  1. Average Shape: Calculate the average positions of key points from both faces.
  2. Warping: Use an affine transformation to morph each triangle from the original face into the shape of the corresponding triangle in the average shape. This can be done using skimage.draw.polygon to handle the triangles efficiently.
  3. Cross-Dissolving: Blend the colors from both warped images with linear interpolation to get the final look.
Jasper

Jasper

Jasper-George Midway

Jasper-George Midway

George

George

The outside hair is not merged very well in the mid-way face. Probably because the hairstyles are different, and I didn't choose too many keypoints on the hair.

Part 3. The Morph Sequence

To create the morph sequence, I used the outputs from Part 2 with a range of weights in [0, 1]. I generated 45 frames for the morph sequence.

Morphing GIF

Part 4. The "Mean face" of a population

In this section, I analyzed a dataset of facial images to determine average face shapes. The dataset consists of 400 images: 100 male faces, 100 smiling male faces, 100 female faces, and 100 smiling female faces. I also transformed individual faces in the dataset to match this average shape and displayed these transformations. Additionally, I morphed my face and the average face into each other.

Four examples of Mean Face

original normal male face

Example 1

warped_normal_male

warped

original normal female face

Example 2

warped_normal_male

warped

original smiling male face

Example 3

warped_smiling_male

warped

original smiling female face

Example 4

warped_smiling_female

warped

Average Faces of population

average_male

Average Male Face

average_female

Average Female Face

average smiling male

Average smiling Male Face

average smiling female

Average smiling Female Face

Morphing between my face and the average face

me_to_average

Jasper to Average Male

average_to_me

Average to Jasper

The image is a little weird, probably because I still kept some forehead, and my head is not in the same position as the average picture.

Part 5. Caricatures: Extrapolating from the mean

In this part, I created caricatures by extrapolating from the average face. I created the image by choosing alphas outside the normal range [0, 1], specifically from -0.5 to 2.

a = 0.5

Caricature with a = 0.5

a = 2

Caricature with a = 2

Bells and Whistles

I morphed my face to the average female and to the average smiling female.

me_to_female

Jasper to Female

me_to_smiling_female

Jasper to Smiling Female

Jasper and part of his friends

I used the previous methods and added morphs among friends to create a face-morphing music video.

Reflection

The project is very interesting. I learned how to morph two faces together. After marking the keypoints, I could use these keypoints to create a mid-way image and generate a smooth morphing sequence. What I can do better: I can choose more keypoints on the hair to make the morphing more smooth.