The goal of this project was to have fun morphing faces together.
We define the keypoints of the image to be vertices for triangulation. After selecting the points, we do Delaunay
triangulation on the keypoints.
Computing Midway Face
First, we get the points for both images and take the average to get the average shape. We get the triangulation of the average shape
For each triangle, we solve the system of equations y = Tx, where y is the original points of the triangle and x is the average points
of the triangle to get the inverse transform T from the average shape to the original images. We do this, so we can get the color values
from the original images. However, it is possible we land on a fractional value for a pixel, so we have to interpolate between pixel values
to get the correct color. We do a weighted sum of the color values for each image, which is the average for the midway face.
Morph Sequence
Instead of taking the average as before with the midway face, we instead interpolate between 0 and 1 to get a weighted shape and do the same
algorithm, and for cross dissolving, we also interpolate between 0 and 1, instead of taking the average. We stack 45 frames at 30 fps to
create a gif of morphing from 1 face to another.
The Mean Face of Danes
I used the Danes dataset for morphing as shown below. To get the average face image, we do the morphing as above into
the average shape, and then average the interpolated colors across the images.
Average Dane
|
Original
|
Morphed to Average
|
Original
|
Morphed to Average
|
Original
|
Morphed to Average
|
Jay Z Morphed to Average Shape
|
Average Morphed to Jay Z Shape
|
Caricatures: Extrapolating from the Mean
I increase the interpolation value to be outside the range [0,1] to do an extrapolation on the population mean
of the Danes for the image morphing.
alpha = 1
|
alpha = 1.5
|
Bells and Whistles:
I decided to turn Jay Z into a Burmese man.
Jay Z
|
Average Burmese Man
|
Shape Change
|
Appearance Change
|
Burmese Jay Z
|