Face Morphing

by Nir Levin

Overview

In this project, I mixed different faces together by first morphing them and taking the average color values post-morph. I made use of affine transformations in order to transform between different image spaces.

Computing the "Mid-way Face"

Here, I started out with two pictures, one of myself and one of my girlfriend. In order to get a morphing effect that looks good, I had to first pick points which represented the same key features on both of our faces. I used the average of those two sets of points to get a trianglation of the points.


Nir
Isha
Nir Triangulation
Isha Triangulation

Then, I morphed both images into their average I calculated earlier, the "mean face". I did this by calculating the affine transformation matrix between each triangle in each images and its counterpart in the mean face triangulation. This transformation matrix was then multiplied by every pixel in the triangle to get the corresponding location in the triangle I'm transforming to. I set the color of this pixel in the morphed image to be the average color of the transformed pixels in each of the starter images.

Result

The Morph Sequence

In order to create the morph gif below, I ran the same algorithm I used above. However, instead of averaging the feature points and colors, I used a warp fraction and dissolve fraction. For each time t, both fractions would increase by a constant amount, and I calculated every separate frame using (1 - frac) * Nir + frac * Isha .

The "Mean face" of a population

In this part, I calculated the average of a set of 240 faces. Below are three of them. This dataset came with feature points already picked out for me, which I could use for the triangulation.

Essentially, I used the same tactic as above: I calculated the average face by averaging out the feature points, got the triangulation of that face, and calculated an affine transformation between the triangles of each face to the corresponding triangles in the mean face. Below are the images above, morphed to the average face.

And here is the result of averaging out all 240 morphed faces:

Nir warped to mean face
Mean face warped to Nir

Bells and Whistles: Morphing Music Video