CS 194-26 Project 4

Face Morphing

Borong Zhang     cs194-26-agb

Part 1: Face Morphing

To produce a sequence of morphing images, we can follow the steps below:

1. Choose two images A and B and find all the corresponding points between them.

2. Average each pair of corresponding points then use the python scipy Delaunay function to process them and get the triangulation.

3. Set the frame number to 45. We want to get a sequence of 45 target images. Each of them is a mixture of warped A and B. For each image, we need to set two fractions: warp_fraction and dissolve_frac, both vary from 0 to 1 and increase by 1/45 in each step.

4. For every triangle in a target image, find the affine matrix that transform the corresponding triangles in image A and B to it.

5. Use the affine matrix we get from step 4 to process each pixel in the source images to the target image, then apply the dissolve_frac to get the target image.

6. save all the target images in a gif file.

Source images and corresponding points

Triangulation

Mean face and triangulation on it

Morph sequence

Part 2: Mean Face

In this part, we want to get an average face of a subpopulation, following the steps below:

1. Download enough images of a subpopulation, 40 in this case, and download the corresponding points set.

2. Average all the corresponding points, then use the python scipy Delaunay function to process them and get the triangulation.

3. For every triangle in the target image, find the affine matrix that transform the corresponding triangles in the specific image to it.

4. Use the affine matrix we get from step 3 to process each pixel in the source images, add them up and then average by 40.

The resulting mean face

Source images morphed into the mean face

Caricatures

Bells and Whistles

I used female mean face to change gender of my face.

Target images and corresponding points

My face warped into the average geometry

The mean face warped into my geometry

female mean face

Me

Morph both

Morph appearance

Morph shape