CS 194

Project 3: Morphing Faces

Fall 2020

Overview

In this project I produced a 'morph' animation of faces, computed the mean of a population of faces, and extrapolated from a population mean to create a caricature. To warp images, I explored how to utilize triangulation and interpolation. To create caricatures, I learned how to parse through large datasets to create an averge image.

Defining Correspondences

To morph faces, I first needed to define the key points of the images. I used ginput to pick 44 points as shown below. I then added on the corners of the image for a total of 48 points.

Points.
George points.
Emma points.

Computing the "Mid-Way Face"

Once I defined points for two images, following the image above, I calculated the average pointset between the two. Using the average pointset, I found a triangulation using the Delaunay algorithm. I then applied the triangulation to the first image, second image, and average pointsets.

George triangulation.
Emma triangulation.

To calculate the 'mid-way face', I warped both the images to the average point set. I did this by computing the affine transformation from each triangle of the average triangulation to the corresponding triangle of the image's triangulation, and applying it to move the image. After warping both images to the average pointset, I overlayed them and averaged their colors together.

George warped to avg.
Images overlayed.
Emma warped to avg.

The Morph Sequence

To produce the morph sequence, I followed the process in the previous section, but introduced two new variables: warp_frac and dissolve_frac. In each frame, the variables were incremented. They helped me interpolate point value and color values between frames to create a smooth transition overall.

Morph sequence!.

The "Mean Face" of a Population

I used a dataset of faces found here . I found the average of all smiling faces and their corresponding points. Then, I found a triangulation for the average points. I warped all faces to the average points and overlayed them on top of each other, averaging their colors to get a final output.

Average face.
Average triangulation.

Here are some before and after images of individual faces warped to the average position.

Original image 0.
Original image 0.
Original image 0.
Warped image 0.
Warped image 1.
Warped image 2.

Using the average point set, I created a warp for my own face to the smiling average. I also warped the smiling average to my frowning face.

Original face.
Average face warped to me.
Warped to average face.
Average face.

Caricatures: Turn that Frown Upside Down!

Using the average smiling face calculated before, I created a caricature of myself by warping my frowning face into a smile. :^)

Alpha = .2.
Alpha = .5.
Alpha = .8.

I also made my face frown more.

Alpha = .2.
Alpha = .5.
Alpha = .8.

Bells & Whistles

Class Morph

I participated in a class morph. Here is my part morphing to Saurav. Link to full vid here!

Average White Men

I used the faces of average European men to see what I would look like as different European men. I also saw what an average European man would look like if he looked a bit more like me.

Average English man.
Average Irish man.
Average French man.
Me!

Now watch me turn into them!

Average English man.
English man as me.
Blended.
Me as an English man
Average Irish man.
Irish man as me.
Blended.
Me as an Irish man
Average French man.
French man as me.
Blended.
Me as a French man

Animorphs

Me turning into a wolf.

Flower Power

I wanted to see how we could use morphing as a transition, and purposefully picked key points that were in very different positions to create the following gifs.

A flower blooming into Saurav.
Trippy flowers blending together.

Fun video!

Finally, a fun video I made of my favorite TV show!