Project 3 - Face Morphing

Part 1: Defining Correspondences

For the two images, I have chosen me and my friend Jash. These images are initially resized to 1/5 their dimensions to control the size. Then, I have created a correspondence using the tool provided on the project spec. These points are then loaded in and the midway points are calculated, on which the Delaunay triangulation function is applied. From the image shown below, you can see that I have tried to match feature to feature, focusing on eyes, lips, chin and also the four ends of the image to give it a border.

lowres3 lowres3 lowres3

Part 2: Mid-way Face

This part defines the compute_affine and inversewarp functions, including others. Both the resized images are used, as well as the triangulations, to create the mid-way face. The affine function translates the images to the midway points found in the triangulation, and then an inverse warp is called on the same. Then, the images are cross dissolved to give the right colours. All the results are displayed below, including the warped images + the midway face.

lowres3 lowres3 lowres3

Part 3: The Morph Sequence

To make the morph sequence, the code generates frames by varying warp_frac and dissolve_frac parameters from 0 to 1. The midway face would have values of 0.5 for both parameters. Frames are generated and appended to the "frames" array with the same method as the midway face. The gif produced contains 45 frames, with the first and last frames being the original images 1 and 2 respectively

GIF

Part 4: "Mean face" of a population

This part involved loading all the data from the Danes dataset, which has 37 images. From this, the points were loaded into an array and then the average face was computed with the same method as before.

lowres3

Below shown are images of my face warped onto the average geometry and the average geometry warped onto me.

lowres3 lowres3

Here are examples from the database morphed onto the average face

lowres3

Part 5: Face Caricature

The Caricatures are produced by shifting the points in the original image with the formula a + k*(a - b). The original image is then morphed into this to create the final image.

lowres3

Bells and Whistles - Changing gender

For this, I morphed my image onto the average Indian woman (which I found on the web) using the same triangulation and warping method as before. You can see the features change, ranging from skin color to eyes and eyebrows etc...

lowres3

Conclusion

I have taken some inspiration from ChatGPT and pretrained LLM's to create the structure for some parts of the website.

Back to Main Page