Defining Triangulations + Computing the "Mid-way Face"

First thing I did was define correspondances. Luckily for me, I was able to find a Python package for cpselect which greatly simplified defining point correspondances.

After, I averaged the two sets of points from the original image to the morphed-to image, and calculated a Delaunay triangulation. I also computed the midway face. Both images were warped to the triangulation defined by the average of the point correspondances, and then stacked on top of each other.

This involved solving linear systems of equations for affine transformation matrices, and using their inverses to conduct an inverse warp from the source to output faces.

There's also a version with the drawn on triangulations. This helped immensely for debugging.

The Morph Sequence

By using the warping function I created for the earlier part, I was able to paramertize it and reuse it for a morph function. Below are some examples of my face morphing into different subjects.

Me morphing to George Clooney

Additional YT link if gif dies

Me morphing to Kabosu

As you'd expect with this one, it looks kinda wonky given the perspective shift and the pure anatomical differences between a dude and a dog. Additionally, trying to define a proper correspondance between the two was hard: I figured it'd make more sense for ears to come from ears, than to spring out of my head, for example.

Additional YT link if gif dies

The "Mean Face" of a Population

For this part I used the imm_face_db from here, mainly because I couldn't find others with annotations, and a lot of the ones I was interested in was gated behind requesting permission for research.

Anyways, we can compute the mean for the annotations bundled with the images in the .asf files. Then we have the average face shape, and we can also morph each face in the dataset to that shape and average those for the average face.

We can see some examples of individuals in this dataset being morphed into the average shape we calculated.

01 to avg backup yt 33 to avg backup yt

It's interesting how atypical features get warped away. Similarily, there're also warps from me to the average shape and the average face to my shape.

me to avg backup yt avg to me backup yt

Notice how I get squished and lose aysymmetry in my face as I warp to the average shape, whereas the average face takes on my aysymmetrical features. Neat! Let's make some caricatures as well, and try exacerbating atypical features.

And as you'd expect, those atypical features get exaggerated. For me, it's my uneven face, and for the other example, it's his off centered photo and his neck swagger.

Bells and Whistles

In this part, several classmates got together to make the music video as described in the bells and whistles section, with everyone responsible for one part of the warp.

Here was my small warping section, and like the other gifs in this document, ping-pong'ed for readability.

backup yt

Link of the finished video is below.

In [11]:
from IPython.display import HTML

# Youtube
HTML('<iframe width="640" height="480" src="https://www.youtube.com/embed/sTT0-nN3vtc?rel=0&amp;controls=0&amp;showinfo=0" frameborder="0" allowfullscreen></iframe>')
Out[11]:

backup yt

Additionally, by changing the parameters for morphing (mainly nulling cross dissolving), you can take on characteristics of other faces/average faces. For example, I age myself here using George's correspondances.