Using transformations and interpolation to morph faces!
For this section, I chose an image of myself and an image of George Clooney to create a midpoint face and morph my face into George Clooney. First, I used a correspondence selection tool, implemented by a previous student, to obtain a .json file of all the correspondance points for the two images that I wanted to morph. Then, I used the Delaunay triangulation algorithm to create a triangular mesh shape for the images.
Nakul Srikanth Triangulation
George Clooney Triangulation
Utilizing our developments from the previous section, I used the correspondance points from both images to find the midpoints (average of the correspondances) between the two images. Using these midpoints, I used the same triangulation algorithm to obtain a midpoint triangulation mesh shape. Now using this midpoint shape and the two original image shapes, I first found the affine transformation between an original image and the midpont. I then used the inverse warp from the midpoint to the original image to obtain pixels in the original image that are warped in the midpoint image. I then used bilinar interpolation to estimate pixels values from the original image to the midpoint image. I repeated the process for the second image and then average the color by cross-dissolving them. The final result was a "Mid-way Face" between myself and George Clooney.
Nakul Srikanth
Nakul - Clooney : Midpoint Face
George Clooney
Another example with Bollywood actor, Shah Rukh Khan.
Nakul Srikanth
Nakul - SRK : Midpoint Face
Shah Rukh Khan
For the morph sequence, we just had to extend our code from the previous section, and create a function called morph() to reproduce all the steps from Step 2 for any two images. Using this function, we can then obtain a series of 20-50 morph images with warp_fractiion and dissolve_fraction, linearly increasing from [0, 1] in every sequence. Then putting all the morphed images together in a GIF file reproduces the morphing sequence.
Nakul - George Clooney
Nakul - Shah Rukh Khan
Using the Braziliian Faces dataset, I used the ENTIRE population to create a mean face, using techniques from previous steps.
Mean Face
Example 0
Example 0 to Mean
Example 1
Example 1 to Mean
Example 2
Example 2 to Mean
Example 3
Example 3 to Mean
Example 4
Example 4 to Mean
Mean Face
Nakul to Mean
Mean to Nakul
Using the mean face obtained from the previous steps, I have created some caricatures for different values of alpha. This is done by weighting the mean_face_pts by alpha and the normal_face_pt by (1-alpha) for various values of alpha.
Alpha = -2
Alpha = -0.5
Alpha = 0.5
Alpha = 1
Alpha = 2
Using the official portraits of US Presidents, I have created a morph sequence for all the presidents in the order that they were in office.