CS194 Project #3: Face Morphing

By: Scott Shao

Defining Correspondences


George with labels and triangulation
Brad with labels and triangulation
Brad with average labels and triangulation
Anne with average labels and triangulation
Anne with labels and triangulation
Me with labels and triangulation

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"

George
Brad
George warped to mid-way face
Brad warped to mid-way face
Mid-way face of George and Brad
Mid-way face of Anne and Me
Anne
Me
Anne warped to mid-way face
Me warped to 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

George and Brad morph sequence
Anne and Me 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

Examples of faces that are rescaled and aligned
Numbers on top indicating the rescale factor

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.

Top: mean face
Bottom: original face
Top: mean face
Bottom: original face
Top: mean face
Bottom: original face
Top: mean 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.

Population mean face
Population mean face goofy
Population mean face left
Population mean face right
Population mean face shade
Population mean face smile

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.

My face warped into the average geometry
The average face warped into my geometry

Caricatures: Extrapolating From The Mean

Warping constant = -0.8
Warping constant = -0.5
Warping constant = 1.5
Warping constant = 1.8

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

Morph my facial expression to smile using population mean face of smile

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.