CS 194 Project 3: Face Morphing

By Sainan Chen
10/9/2020

1.1 reference points and Mid-way Face

To get start with, we need to find key reference points on each of our input images. We can manually select points using matlab or use existing dataset with labeled points. One thing important is that the order how these reference points are stored should be consistent among all input images, so computer knows which points should be aligned.

In the example below, I manually selected 50 points identifying key face features on each of the input image. However, the afterwards morphing is not satisfying because the outline of the forehead is distorted without having any reference points. Therefore, I added more reference points on top half of the head later which leads to a better result, and it's always true that more reference points, better the result, although it might also increase the running time. 

To produce the mid-way face, I set both warping fraction and dissolving fraction to 1/2. I first find Delaunay Triangulation (which vertices should form a triangle) based on average coordinates of 2 sets of reference points. Then I find out vertex coordinates of every triangle on the middle image using the average vertex coordinates of corresponding triangles in 2 input images (warping fraction = 1/2). For every pixel on the middle image, I fisrt check which DT triangle it's in, and then I applied inverse Affine Transformation of that particular triangle and each of the input image to find the corresponding 2 points respectively on input images and put average of their pixel colors (dissolving fraction = 1/2) back to the pixel on the middle image.

mid face

1.2 Morph Sequence

To make the morphing process dynamic, we only need to change the warping fraction and dissolving fraction in the mid-way face part into a continuous sequence from 0(totally first image) to 1(totally second image). 

Here I choose both fractions to be 0/45, 1/45, ..., 45/45, so we have 45 frames in total.