Face Morphing

Varun Bharadwaj - Fall 2024 CS 180

Part 1: Defining Correspondences

The first step in order to generate a face morph was to define a set of Correspondences to define the matching points in my face and LeBron's face. I used the provided correspondence tool to pick the same points in both my face and LeBron's face. After doing this, I averaged these 2 points in order to get a midway shape. I then used the scikit Dealuny algorithm in order to create a triangulation of these points. I then applied this average triangulation onto the 2 faces.

Keypoints and Corresponding Triangles

Part 2: Compute the Midway Face

Now that we have a mapping from my face onto Lebron's face, I can begin working on a midway face to start the morph sequence. I did the following to calculate the average face shape. I computed the average shape by doing avg_shape = 1/2(my_face_pts + lebron_face_pts). I then calculated the inverse of the affine transformation from the triangles in the original image and the triangles in the average face. I then used the inverse morphing algorithm we learned in class in order to calculate the components of the midway image from both my face and LeBron's face. I then cross dissolved these 2 images by averaging their pixel values.

My face and Lebron's face

Midway Components from my face and Lebron's face

Midway Face

Part 3: Morph Sequence

This step was similar to the previous step. I adjusted the weights to range from 0 to 1 increasing by 0.04 per frame. This led to the following 25 frame face morph.

Face Morph

Part 4: Average of a Population

For this part I used the danes dataset in order to find the average of a population. This population has 37 images with correspondences between the points. I first parsed the .asf files in order to get the correspondences for each of the faces. I then took the average of all of the points. I then used the morphing code I used in the previous parts in order to map each individual onto this average danish face. Below are a few of my results.

Left: Original, Right: Mapped to Average Shape

Left: Original, Right: Mapped to Average Shape

Left: Original, Right: Mapped to Average Shape

Left: Original, Right: Mapped to Average Shape

Left: Original, Right: Mapped to Average Shape

I then averaged all of the warped images in order to get the following average image.

Average Dane

I then used the correspondence mapping described in the paper in order to get a correspondence of my face that maps to the one used for the danish images. I then used this correspondence in order to get a morph of my face onto the average dane's face shape and a morph of the average dane's face onto my face shape.

My face mapped onto the average dane, average dane mapped onto my face

Part 5: Caricatures

I then used an extrapolation in order to get a face that turns me into a more than average dane or a face that turns me to less of a dane. I changed the alpha factor to -0.5 that made a picture that was a less danish version of myself or increasing it to 1.5 to get a more danish version of my face mapped onto the danish average.

a = -0.5, a = 1.5

Part 6: Bells + Whistles

Bells and Whistles 1: Automatic Correspondences

One of the things that I did for bells and whistles was an automatic morphing. I used the mediapipe face mesh library in order to generate correspondences automatically. Below you can see the automatic correspondes generated for my face and lebron's face.

Keypoints and Corresponding Triangles

Bells and Whistles 2: Ethnicity Morph

I used a picture of an average greek male that I found on the interenet in order to morph my face onto it. I used the midway image code that I used to create the morph between me and Lebron along with the automatic correspondence creator that I added in the previous bells and whistles part. I have attached the 3 images below.

Me, Average Greek Face, Me Morphed onto Greek Face

Here is the morph of just my face shape and appearence

Morph to shape, Morph to Appearance