template taken from HTML5 Webtemplates.co.uk

CS 194-26 Project 4

by Larry Zhou

Overview

The purpose of this project was to produce a morph animation of our face into someone else's face, as well as compute the average face, given a set of images.


Part 1

For the first part, we needed to define corresponding points on two images. I picked around 4 or 5 points on each key feature of someone's face (e.g. eyes, nose, mouth, etc). It was important to keep the labeling consistent, otherwise we would end up with extremely distorted images. In order to create the triangulation of the points for morphing, we borrow scipy's Delaunay function and use it on the average of the points between the images.

Computing the "Mid-Way Face" and Morphing

Before we can do the morph sequence, we need to compute the mid-way face. To do this, we computed the average of the keypoint locations, warped both faces into that shape, and finally averaged the colors. I generated the mask using polygon.
The middle image did not look as great as I wanted it to, but this can probably be attributed to the number of points I picked.
The morphed image was calculated using the function provided in the spec as a guide-- morph(im1, im2, im1_pts, im2_pts, tri, warp_frac, dissolve_frac). The starting warp_frac and dissolve_frac were 0, and the ending values were 1. In order to generate 45 images, I would add 1/45 to each value at each step.
On the left, we can see a faster version of the gif, starting at my face and going towards a stock image I found on google. On the right is what I initially had, but I did not pick the points as strategically, the speed is slower, and the order of the images is in reverse. I should have also picked points on the hair to make that transition more seamless.

Part2: Average Faces

Here, we implement some of the principles from earlier in order to compute the average face given a set of images of people's faces. I personally used the images of the Danes provided in the spec because the points are already defined and there are a lot of images to work with. The process was similar to the previous part, except this time we're only morphing one image to the average of many more images. After getting all these images morphed to the average, we add the intensities and then divide by the number of images we used.

In the top image, we have the average face of all male Danes looking forward with no expressioin. The image on the bottom was created using all the images of Male Danes, regardless of whether they were looking forward or what their expression was. Interestingly enough, there was not much variation between these two images. Each person had around 6 images in the second set that I used.

Above, we can see some of the morphed faces that were used for the average face. It's interesting that the sum of all these deformed images creates such a seamless image.

Above are two pictures. The first one is my faced warped to the average image's points, and the bottom is the average image warped to my face's features.

Part3: Caricatures

These carcs were created by warping my face to the corresponding points of other images.

Bells and Whistles

Here I transform myself to the image of the average female which I grabbed from google images.