CS180 Project 3: Face Morphing and Population Analysis
Part 1: Defining Correspondences
In this section, I defined pairs of corresponding triangulations on two images and below that we show the mean triangulation mesh that we used for the mid-way image. I have used the Delaunay triangulation to create these meshes. These are my friends Kash and Nandy.
Part 2: Computing the "Mid-way Face"
Now that we have defined the mean triangular mesh. We can compute the mid-way face between two images by defining an affine warp. The way I did this was by morphing the two images into the mean mesh and then taking the average of the two images. I used the griddata function for extrapolation and the sklearn.draw.polygon function to get the pixel points inside each of the Delaunay triangles.
Part 3: The Morph Sequence
We created a morph sequence from one image to another. To do this we created a function that computes weighted averages of the mesh points we call this mesh the average_mesh which is parameterized by 0 < alpha < 1. I then morphed (affine transformation) Image1 into the this average mesh and then morphed Image2 into the average mesh. I then took the weighted average of the two morphed images to get the morph sequence. This below gif shows the morph sequence from Kash to Nandy with 30 frames where alpha varies from 0 to 1. Notice that alpha = 0 will give us Image1 and alpha = 1 will give us Image2.
Part 4: The "Mean face" of a population
We computed the average face shape of given the FEI Face Database population. I did this by taking the average of the annotated points given in the dataset and then morphing each of the individuals in the population into this average mesh. I then took the average of all the morphed images to get the mean face. I have shown the mean face below and a few examples of faces morphed into the average mesh. Note that this dataset contains 100 images with people both smiling and not smiling. This explains why the mean face has a little bit of a blurr in the mouth region.
Here is the mean face
here are the warped faces
Here is kashvi's face in the average geometry and the average face in kashvi's face geometry
Part 5: Caricatures
We produced a caricature by extrapolating from the population mean. We do this by taking the difference between the mean face and the individual face scaling it by some factor between 0 and 1 and then adding this difference to the mean face. This will exaggerate the differences between the individual and the mean face. I have shown the caricature of Kash below.
Bells and Whistles
I took the mean face of the british parliament from the internet. Then I created a caricature of my friend Kashvi in the geometry of the mean face of the british parliament. I have shown the mean face of the british parliament and the caricature of Kashvi below.