This project is all about faces, particularly morphing faces. To morph faces we need to have some points on our images that correspond to one another, like eyes to eyes, eyebrows to eyebrows. With this stepping point we can create animations that morph between two people, change gender, ethnicity, and other traits.
To make faces morph well, we need to make sure that one they are somewhat aligned, and two, that there are some points that correspond to eachother. These points should be on key features, most notably the eyes, mouth, eyebrows, and silloutte of the face. I used a previous students website to create correspondences between two pictures. Who better to morph into one person than me and my girlfriend Colleen.
With these points I created a triangulation using Delaunay triangulation. However we should only use a single triangulation for the rest of the steps. So I computed the average of my points and Colleens points and used that from this point onward, we can see this average triangulation below.
A midway face is both of our faces warped to the average shape of our points. The most important step is warping, for each triangle we can calculate an matrix that corresponds to an affine transformation from our shape to the average shape. Then we can compute the inverse of the matrix, to find a 1 to 1 correspondance between my pixels and the output images pixels. I used skimage.draw.polygon, which takes 3 points of a triangle and creates a mask, this allows me to transform one triangle at a time. Below are both images morphed to the average shape.
Then we can cross disolve the images, giving the illusion of a single person.
Now we can compute a morph sequence by warping each frame to a weighted average of the two points. At time 0 its fully my face and my face shape, and at time 45 its fully Colleens face and her shape, and at the mid-way, its the midway face.
Now we want to start leveraging the power of averaging to get some cool effects. I used the danes dataset which has several images of Danish people which I will use in the following part. For each image they had some set of corresponding points, which I averaged together to get the "average shape of a Dane". Below I have warped a couple of danes to the average shape.
Now we can average together all the images to create, "the most average Dane".
We can then warp my own face into the average dane, and vice versa to create a very uncanny image.
We can create Caricatures of myself by using an alpha value that is greater or less than one when averaging. Below I've created a caricature of me as a Dane, and me as myself.
I found an image online of the average Filipino woman, considering Colleen is also Filipino I thought this would be an interesting combo. I created a correspondance between me and the average, and morphed me to her shape, morphed her to my shape and cross dissolved, and morphed me to her shape and cross dissolved.