CS194 Project #3: Face Morphing
Defining Correspondences
I wrote my own little program to labels the features on two images side by side that supports jumping between images and delete mislabelled features. I then used Delaunay to get the triangulation of the midway shape.
Computing The "Mid-Way Face"
For the warping and mid-way face generation. I first created a canvas of the same shape as my image. I then calculate the inverse of the affine matrix for the affine transformation from the face to the mid-way face for every single triangle. I then use the inverse warping matrix to get the corresponding coordinates of every pixel in the mid-way face from orignal face image. I did that for all the triangles to generate a map of coordinates for all the pixels in the warped face. Lastly I get the color value for the mid-way face using interpolation from orignal face.
The Morph Sequence
Both morph sequence were made with 50 images each lasts 20 ms to create a total of one second morph, and the morph sequence was then played in reverse to give a 2 second morph sequence gif.
The "Mean Face" Of A Population
The population dataset used is the Danes (Free data sets for statistical models of shape), exluding image 2, 3, and 4 since they are monochrome. Although the images all had the same shape, the positions of the face were different. I first computed the mean position of the left and right eyes and used that as the reference for alignment. Each image was rescaled so that the distance between left and right eyes matchs that of the mean, and translated so that the left eye is at the same position as the mean left eye. Above images showed examples of rescaled and aligned faces with features in green cross and calcualted mean eyes in blue and orange. The alignement was great.
Bottom: original face
Bottom: original face
Bottom: original face
Bottom: original face
After the alignments, the mean face was calculated and all the input images were warped into the mean face. Above are some examples of the warping.
Above are the result of the population mean face using different sets of the original faces. The set contains both male and female of all ages, it can be seen that the population mean face looks better than all the input faces.
Caricatures: Extrapolating From The Mean
The caricatures do not look good. This is probably due to the location of the featuers made the triangle affine transformation ackward.
Bells And Whistles
For bells and whistles, I morphed my facial expression to smile using the population mean face of smile. I have also tried to change my gender in part one and experimented with pre-align the images verses not align the images and found out that pre-alignment makes a big difference.