A morph is a simultaneous warp of the image shape and a cross-dissolve of the image colors. The cross-dissolve is the easy part; controlling and doing the warp is the hard part. The warp is controlled by defining a correspondence between the two pictures. The correspondence should map eyes to eyes, mouth to mouth, chin to chin, ears to ears, etc., to get the smoothest transformations possible.
In this assignment I produced a "morph" animation of the faces of two different people, computed the mean of a population of faces and extrapolated from a population mean to create a caricature of myself.
First, I manually defined pairs of corresponding points on the two target images using a consistent labeling, in order for the morph to work. I labeled the faces A and B in a consistent manner using the same ordering of keypoints in the two faces.
For this part, I used the portraits of George and our old friend Derek! I selected 75 points in total across key facial features and accessories in both images by hand to ensure a smooth morphing process.
I computed the Delaunay triangulation at a midway shape to lessen the potential triangle deformations. Here is the triangulation of these points.
Before computing the whole morph sequence, we need to compute the mid-way face. This would involve:
The main task in warping the faces into the average shape is implementing an affine warp for each triangle in the triangulation from the original images into this new shape. Instead of looping over the pixels, we iterated through all the triangles pairs. For each triangle in the average shape, we got the affine projection to the corresponding triangles in each image. Then, for each pixel in the triangle, we found the corresponding points in each image and set value to weighted average (cross-dissolve each triangle).
To create the mid-way face, we warped both faces to the average shape and then blended them using equal weights, i.e. $0.5$. The original images and the image of the mid-way face are shown as below:
Then we could generate a video sequence of the morph. I followed the method mentioned in the course.
George
Morphing Video
Derek
I analyzed a free data set of Danish faces for this part. There are 40 people in this dataset.
I also produced a caricature of my face by extrapolating from the population mean I calculated in the last step, i.e. mean Danish face. This procedure follows: $$ \text{caricature} = \text{average face} + \alpha \times (\text{my face} - \text{average face}). $$
It is obvious that the further $\alpha$ deviates from $1.0$, the stranger my face looks. That's because the caricature is the same as my face when $\alpha = 1.0$. You could deduce this from the equation above.
I changed my face into a smily Danish man!
Morph the Shape
Morph the Appearance
Complete Morph
I made a morphing music video of the main characters in EVANGELION. Here I provide a gif version for you, you could find the mp4 version with music Here! (The quality of the gif file might be poor due to the compression operation, so please click on the link to view the original video)