CS 180 Project 3 - Face Morphing and Modelling a Photo Collection by Eshani Jha

Overview

In this project, I explored face morphing techniques, including warping facial features and blending colors between two images. I started by defining corresponding points between two faces and used triangulation to create a smooth transition. I then implemented affine transformations to compute a mid-way face, which combines the shapes and colors of the input images. Additionally, I created a morph sequence between two faces, generating an animation from one face to another. Finally, I computed the mean face of a population and extrapolated from this average to produce a caricature. These exercises helped me deepen my understanding of affine warps, image interpolation, and facial feature manipulation.

Defining Correspondences

To define pairs of corresponding points between two faces, I used a labeling tool from a previous CS 180 student. The keypoints were consistently labeled across both faces, ensuring smooth transitions. For this project, I labeled my own face and that of Priyanka Chopra, a well-known Bollywood actress. Once labeled, I computed a Delaunay triangulation based on the midway shape between the two point sets, as this reduces triangle deformation during morphing. This triangulation was used to control the warping process for a smoother morph result.

Results

Result Cameraman Gradient Image

Computing the "Mid-Way Face"

To create the mid-way face between my face and Priyanka Chopra's, I started by computing the average shape, which involved averaging the corresponding keypoints of both faces. Next, I warped both faces into this new shape by calculating affine transformations for each triangle in the triangulation. These transformations mapped the original triangles to their positions in the average shape. I then used inverse warping to determine the pixel colors for each triangle. Finally, I blended the two images by averaging the colors together, producing a smooth transition. Below, you can see the original images of myself and Priyanka Chopra, along with the resulting mid-way face.

Results

Irregular Mask Results Irregular Mask Results
Resulting Cameraman with Filter

The Morph Sequence

For the morph sequence, I wrote a function that produces a smooth transition between my face and Priyanka Chopra's face. This function uses point correspondences and triangulation to warp both images into intermediate shapes, controlled by parameters for warping and dissolving the images. By varying these parameters, I generated a sequence of frames that smoothly morph my face into Priyanka's. The result is a video sequence as an animated gif.

Results

Sharpening the Taj Mahal

The "Mean Face" of a Population

Here I used the Danes dataset and focused on the neutral male and female subcategories. I computed the average face shape for each group by averaging the annotated keypoints. Then, I warped two images from the datasets into these average shapes, showing how they transform to fit the average geometry. Finally, I also warped my own face to match the average shape (andd vice versa). Below, you can see the results of the average face, the warped dataset images, and my face transformed into the average shape.

Average Results

Gaussian and Laplacian Results Gaussian and Laplacian Results Gaussian and Laplacian Results

My Results

The results of warping the average geometry to my face, and vice versa, were not ideal. My round and wide face shape does not align well with the average, which led to issues like the chin of the neutral male and female being noticeably cut off.

Gaussian and Laplacian Results Gaussian and Laplacian Results

Caricatures: Extrapolating from the Mean)

To create caricatures of my face, I extrapolated from the population mean of the neutral females from the Danes dataset. I calculated the difference between my facial keypoints and the average keypoints, then amplified this difference to create exaggerated versions of my face. By adding 1.5 times the difference, I generated a more pronounced caricature, and with 0.5 times the difference, I created a subtler version. After warping my face into these new shapes, I cropped the images to remove any excess background, highlighting the exaggerated features.

Results

Mask for Orapple

Bells and Whistles

For the "Bells and Whistles" part of my project, I experimented with morphing just the shape, just the appearance, and both the shape and appearance between my face and Priyanka Chopra's. I created three different morphs: one that focused purely on shape transformation, another that blended only the appearance, and a final morph that combined both. Morphing just the appearance led to changes in skin tone, texture, and smile. Morphing the shape modified the facial structure, contributing to a change in perceived ethnicity.

Results

Irregular Mask Results Irregular Mask Results
Gaussian and Laplacian Results