CS194-26 Project 3 Image Manipulation and Computational Photography

Rishi Upadhyay, 3033975663, rishi.upadhyay@berkeley.edu

Project Overview

For this project, we used a triangle mesh and image interpolation to combine various images/morph faces and do various other manipulations.

Part 1.1 Defining Correspondences

For this part, I used matplotlib to take in points from the user. They can enter them just by clicking on the image. It is important to enter the points in the same order on both images. Here are a set of correspondences on my face:



Part 1.2 Computing the "Mid-Way" Face

In this step, we computed the mid-way face between my face and Obama. I did this by picking corresponding points on both images. I then generated a triangulation with these points. After this, I found the average points between the two images by taking a simple mean. At this stage, we have 1 triangulation T, but 3 sets of triangles S1,S2, and S3. S1 is on the picture of me, S2 is on the picture of Obama and S3 is on the "average" we are trying to create. I then find 2 sets of transforms, R1 and R2 which transform triangles from the each of the images to the "average" image. I then used the inverse of these transforms, to find the coordinates of the pixels in the "average" image on both my and Obama's image. This way I could move these triangles on both images and that way have more aligned images. We can then simply average the images. Here are a set of 3 images: 2 originals and a midway:



Part 1.3 The Morph Sequence

In this section we used the mid-way face to generate a morph sequence. Essentially we vary the weights of the average points so that the images goes from one to the other. We also vary the weights of the average images. A gif can be visualized as follows:



Part 1.4 The "Mean Face" of the Population

In this section, we used a dataset of faces to compute the average face of the population. We did this by warping all the faces to the average face and then averaging together. Here is the average face from a Danish dataset:



Here are few faces from the dataset warped to the average face:



Here are two images - my face warped to the average face and the average face warped to my face:



Part 1.5 Caricature

In this section, instead of the typical 0.5x + 0.5y for averaging, I used -0.5x + 1.5y. This was essentially the same as going past one of the images instead of in between them. Here is a caricature:



Part 1.6 Bell & Whistle

The bell & whistle I chose to implement was changing the ethnicity of my image. I did this by warping the image of the average chinese image onto me. Here is is:



In addition, here are two other images. One is the average chinese face warped to my face then averaged. The other is my face warped to the average face: