Face Morphing

Francis Pan

In this project, I will be using key feature points on various faces to create triangulations. I will then be using these triangulations to perform different types of face morphs.

Defining Correspondences

In order to begin morphing, we mush first manually define the key features of our two faces

My good friend Aaron
Faker, the most famous League of Legends player

By using python's ginput, we can select out key points for each image manually, making sure to select the *same points* in the *same order* for the two faces. I selected 73 points total (69 (nice.) manual points plus 4 for each corner to ensure the background morphs as well). After selecting the points, we then average them, and use the average to compute our Delunay triangulation to minimize triangle warping/flipping between the two images.

Triangulations

Triangulation of Aaron's face
Triangulation of Faker's face

As you can see there are still a few areas where triangles may have flipped/become really skinny, but those areas are minimal.

Computing the "Mid-way Face"

Before we begin making the morph sequence, let us first calculate the midway face. This is done buy first morphing both base images to the midway points, then averaging the two "mid-shaped" images. To morph, we use affine transformations on each triangle of the triangulation, and then interpolate the colors from the original triangles to the new triangle.

Aaker

The images more closely resenble Faker, and I believe this is due to the Faker base image being much brighter. This won't really impact the morph sequence so I just left it as is.

The Morph Sequence

Now we're ready to build the morph sequence. To do this, we just simply compute many (46 to be exact) varrying degreees of the "mid-way" face. We can do this by using our code from before, but moving the locations of the "average points" slowly from Aaron's points to Faker's points, while also using a weighted average of the images instead, so that we cross dissolve our images gradually from Aaron to Faker.

Aaker Morph!
Full loop for a better viewing experience

The basic morph has 46 frames at 30fps. Full loop has 92 frames.

The "Mean face" of a population

Now let's use these same concepts to find the "mean face" of a population. We can do this by using an exisitng dataset with pre-defined points (Danes in this case) and morphing all the faces into the average shape, then averaging all the morphed faces. Very similar to how we got the midway Aaker image above, now simply with many more images to average over. Below are a few examples of original images morphed into the "average shape".

Dane 1
Dane 1 morphed
Dane 2
Dane 2 morphed
Dane 3
Dane 3 morphed
Dane 4
Dane 4 morphed
Dane 5
Dane 5 morphed
Dane 6
Dane 6 morphed

When we average all the morphed faces, we get the face of the average Dane!

Mean Face of the Danes

We can now use this avergae face to morph. Here is my face morphed into the average Dane, as well as visa versa.

Dane
Me as a Dane
Dane as me
Me

Caricatures: Extrapolating from the mean

By computing the difference between my face and the avergea Dane's, we can also make caricatures by scaling that difference, and then re-adding it to my face. Here is my face as a "hyper" dane and an "anti" dane. Alpha is the scaling factor (where 1 would just be the original image)

Alpha = 1.5 (Hyper)
Alpha = 1.0 (Normal)
Alpha = -1.0 (Anti)

As the alpha increases outside of the range of (0, 1) you can see that the images become more and more "extreme".

Bells and Whistles

Since Hollywood already seems to think Scarlett Johansson is Asian, I figured I might as well take it upon myself and make her Asian for them.

ScarJo
Average Asian Female
Midway between ScarJo and Asian Female

Basically the same person amirite. Below are morphs between the two, showing shape only, color/appreance only, and then a full morph.

Shape only morph
Color only morph
Full Morph

Final Thoughts

I think this project has been the best so far (despite also being the hardest to debug). Jokes aside, I was very surprised at how good the Asian Scarlett Johansson turned out.