CS194-26: Image Manipulation and Computational Photography


Project 4: Face Morphing

Midway Face

For this part of the project, we had to compute the midway face between two faces. To do that, I first found the midway points between each point of the previously defined correspondences. Then, I used those points to compute a Delaunay triangulation. For each triangle in this triangulation, I found the corresponding triangle between the correspondences in each of the images, and then computed the affine transformation matrices from the triangles in the images to the triangle in the midway triangulation. Then, for each triangle in the midway image, I found all pixels contained in that triangle, and multiplied it by the appropriate inverse matrix to get the corresponding point in the first face, and then again for the second face. I used an average of the pixel values at these points to determine the pixel value of the middle image.
However, as you can see below, the transformation doesn't appear to be working quite right. I am fairly confident in my transformation matrices and in my triangulation, so I don't know where my algorithm is messing up. Regardless, I have displayed my faulty results below.

Original Face 1
Original Face 2

Midway Face


The Morph Sequence

For this part of the project, we had to create a video sequence of a morph between two faces, which I will call A and B. To compute this, I used the same process as above to create corresponding triangulations between A, B, and the middle image. However, instead of using the average between correspondences and pixel values, I used the values defined in warp_frac and dissolve_frac, respectively, to determine what fraction of the second image would be present. I created a sequence of morphed images where warp_frac and dissolve_frac were continuously increased until both were 1, completing the transition from the first face to the second face.
Here is a (attempted - still having the same morphing issues as above) morph of my two favorite Danish men:

The "Mean Face" of a Population

For this part of the project, we had to compute the mean face of a certain population, and then morph faces to the mean face. To compute the mean face, I computed the mean of correspondences in the population, and used that to determine the triangulation. I then morphed each face into this average geometry, and computed the final image by taking 1/n of the pixel values for each image where n is the total number of images in the population.