CS 180 Project 3 - Face Morphing

This project was centered around warping and morphing different faces into each other.

Part 1 - Defining Correspondences

First, I had to identify keypoints on both my starting and ending images. I hand-selected these, aiming to align to the key features of each person's face.
Image 1
lebron triangulated
Image 2
the goat triangulated

Part 2 - Computing the "Mid-Way Face"

This entailed computing the midpoints of all corresponding points, in order to get the triangulation structure of the mid-way face. Then, I warped both Steph and Lebron onto the new mid-way face triangulation. For each face, I did this by iterating through each triangle, inverse warping it onto its corresponding triangle in the mid-way face, and then interpolating to get the colors of each pixel in the new triangle. This successfully moved the colors from the original images onto the mid-way face. From there, I took my two warped basketball players and blended their colors evenly.
Image 1
original steph
Image 2
original bron
Image 2
mid-way face

Part 3 - The Morph Sequence

To create a GIF describing the entire morph from Lebron James to Our Glorious King Wardell Stephen Curry the 2nd, I created 45 morph images, linearly interpolating both warp_frac and dissolve_frac from 0 to 1. The result is below. This guy went from a role player to a top 3 NBA player of all time - give this guy the Most Improved Player award already.
Image 1
morphing gif (watch a basketball player improve in real time)

Part 4 - The "Mean Face" of a Population

For this exercise, I chose to create the mean face of the FEI dataset, a dataset of Brazilian faces. I calculated the mean face by calculating the mean points for each point of correspondence, getting a mean face from not just two images, but rather an entire set of ~400 (one smiling picture and one neutral picture each for 200 unique faces). I then warped all of the original faces onto this mean face, and then I blended their textures to get the average face. From there, I warped Steph Curry onto this mean face, and then I warped the mean face onto Steph Curry.

Before

Image 1
Image 2
Image 2
Image 2

After

Image 1
Image 2
Image 2
Image 2

Warping with Steph Curry

Image 1
average face of the FEI dataset
Image 2
the average FEI face warped to the goat's face
Image 2
the goat's face warped to the average FEI face

Part 5 - Caricatures: Extrapolating from the Mean

For this caricature, I took my Steph Curry and my average FEI face and, instead of interpolating between the two, I extrapolated and tried setting alpha to be a negative value (instead of something between 0 and 1).
Image 1
alpha=-0.5
Image 2
alpha=-1.0
Image 2
alpha=-1.5
Image 2
alpha=-1.99

Bells & Whistles - Gender Change

For my bells and whistles, I applied a gender change to my favorite basketball player to summon our glorious queen, Wardell Stephanie Curry II. I did this by isolating about 66 female faces from the FEI dataset and calculating their average face. I then applied a morph (and played with the hyperparameters like warp_frac and dissolve_frac) until I found a picture that seemed to resemble both goat-like and female-presenting features.
Image 1
glorious queen