Project 4: Face Morphing Marc WuDunn

Part 1: Morphing Morphing two images is the process of applying transformations onto one image (warp and cross-dissolve), to obtain another image (and in this case, intermediate frames). The first step is selecting feature points of both images, which will determine how one face morphs into the other.

Part 2: Midway Image The next step was to actually warp and cross-dissolve the two images, such that the result is the average of the two. To do this, I first calculated the mean of the points selected in the first part. Afterwards, I took the Delaunay Triangulation of this average, which I used to split up the two images, such that a triangle in the triangulation corresponds to three of the points chosen in part 1. Next, I computed the inverse affine transformations for the two images, which I used to map pixels in the original image into points of the triangles in the triangulation. I calculated which points corresponded to which triangle using draw polygon (using the result as a mask for each triangle). I then multiplied the color at this point by 0.5 (averaging the color between the two images).

Part 3: Morph This step proceeded much like in part 2, except now the image had to be iteratively warped and cross-dissolved. This was not difficult to do, since the warp was basically a weighted average of the chosen points. Likewise, the cross-dissolve was simply calculated by assigning weights to the colors of each image. I chose to use 43 frames for my GIF animation, and so the amounts were set accordingly.

Part 4: Population Average To calculate the population average, I chose to use the FEI Face Database and their frontal face images. I used the points of 100 of their "b" images to construct an average face, which like in the previous parts, I took the Delaunay Triangulation of. I then warped every image in the dataset into this average face. Some images looked good after the warp, though others did not.

After warping them, I took each of the resulting images and averaged them together. The result was a bit blurry, which I imagine is because many of the faces had different sizes, expressions, and alignments.

Part 5: Caricature To produce a caricature of myself, I took the average points I calculated in the previous part, selected points on my face that matched the features, and then extrapolated from the differences. I then warped my face with varying amounts. The first is the original image, the second uses an extrapolation factor of 20%, and the third with 40%. Due to the angle of my face, the 40% caricature results came out rather grotesque.

Bells and Whistles: Gender Swap I did the gender swap in two ways, first, I tried to directly warp my face into an image of a woman I found online. Unfortuately, it turned out quite badly (again, likely due to the angle of my face). For my second try, I used a combination of warping and cross-dissolving, which turned out much better.