Face Morphing

Nancy Li



Overview

In this project, the first goal is to make a "morph" animation of my face into someone else's face! Secondly, we compute the mean of a population of faces and extrapolate from the mean to make a caricature of my face.


Defining Correspondences

The first step in producing a morph is to choose corresponding (x, y) coordinates between a pair of images A, and B. I mapped feature points on my face & Hermione Granger's face, and selected coordinates using the matplotlib.pyplot.ginput function. This gave me a list of (x, y) corresponding points from my face and Hermione's.


Computing the Midway Face

This step involves 1) computing the average shape of the faces (the average of each feature point's location in the two faces), 2) warping both faces into the average, and 3) averaging the colors together. To warp both faces into the average, first compute a Delaunay triangulation based on the average of selected points. Then solve for an inverse affine warp for each triangle: AT' = T. this matrix A should send each triange T' in the midway face image to its corresponding triangle T in the original image A and B. Once image A and image B are warped to the midway face coordinates, we cross disolve imA_warped with imB_warped (take the average of colors) to get the resulting midway face image.


Card image cap

A picture of me.

Card image cap

Nermione Gi.

Card image cap

Hermione Granger.


The Morph Sequence

We can produce the morph animation from imA to imB using a series of images created with the above method. Now, instead of using a strict average between imA and imB, we compute weighted averages. The animation was created over 45 frames. On each iteration, the midway face coordinates and image is generated using: (1-weight)*imA + (weight)*imB where weight is (1/45). Finally, each frame is displayed for 1/30 of a second. The animation loop is made by displaying the reverse morph from imB to imA.


Card image cap


The "Mean Face" of a Population

Using a freely available dataset of faces (I used this Danish set) with key points provided, we can compute the average face shape of the population. Each face is warped into the average face. Each warped image is then averaged with one another to produce this average face. I warped my own face into the average geometry, and also warped the average Danish face into my geometry.


Card image cap


Card image cap


Card image cap


Card image cap


Card image cap


Card image cap

Me warped into average Danish geometry.

Card image cap

The average Dane warped into my geometry.


Caricatures: Extrapolating from the Mean

A caricature is created by exaggerating the differences between my features and the average Danish face features. This is done by extrapolating from the population mean image from the previous section. The image is obtained by adding imA + k*(average - imA).



Card image cap


Bells & Whistles: Changing my Gender

What would I look like as a man? I picked an image of an average Chinese male off the Internet, and changed the appearance/geometry of my face to match his.


Card image cap


Card image cap

Changing my geometry.

Card image cap

Changing my face colors.

Card image cap

Changed both.



HTML/CSS for this page was taken from https://v4-alpha.getbootstrap.com/components/card/