Computational Photography

Project 4 - Face Morphing

Amos Yuen

10/15/2012

 

Description

In this assignment we implemented an image morphing algorithm in order to morph one person's face to another persons. To do this morphing, we find corresponding points on both images and create a triangle mesh from the average of those points of both images. To morph the image we then interpolate the points from one image to another depending on how much we want to morph to create a midway image. Then for each pixel in the midway image, we find the triangle that it is inside and we find the corresponding pixel in the two people images using an affine transform. From those two pixels we then blend their color values to get the final result.

Approach

In my implementation, I found feature points by using the cpselect matlab tool. I chose the same points that we need to use for the mean image. I added the four cornerpoints of the image to each set of points to make sure that the whole image is morphed. Afterwards I calculated the delauny triangulation using the average of the points. Then for each morph, I precalculate the affine transform from each midway triangle to its corresponding triangles in the two images. Then I go through each pixel and find whether it is in a triangle using the provided tsearch function. If the pixel is not in a triangle I just blend the pixels in the same position. Otherwise, I use the precalculated affine transforms to find the positions of the pixel in the two images. Then I interpolate the color values of the pixels near those positions and lastly blend together the colors.
I vectorized all the operations except for multiplying the affine matrix. Because I could not find a way to vectorize that multiplication.

Results

All my results were worked alright, but had some noticeably flaws. In general, the low frequency image's features stood out a bit too much when close up. This resulted mostly when the two images had completely different colors in the same spot. For example the angel's bright blue vs the demon's dark red. However, the contrast in colors, also makes the image look more interesting. Also, there were some problems with aligning images properly which also contributed to the different colors of the image.

Morphing Video

Download Link
ayuen
djacobs

Mean Face

Only 9 students data was available at this time. So the mean is only calculated on those 9.
Mean Face
Amos warped to Mean
Mean warped to Amos