CS194-26 Project 4: Face Morphing
Ian Lee
Overview
In this project, I explore the transformation between human faces (and more). I first morph a face into another, then I compute the mean face of a population using affine transformations.
This b4 all
Defining Correspondences
First we need to define pairs of correponding points by hand. We will need these points for triangluations, on which we perform affine transformation. Using the Delaunay algorithm, we can avoid long skinny triangles.
Triangulation on Obama | Triangulation on Old Me |
---|---|
Computing the Mid Face
To compute the average shape, we add the corresponding points together with an equal weight of 0.5. Then we compute the affine transformation from the average shape to each traingle from both images. This is the same as doing inverse warping using the transformation from the images to the average shape. At last, we map each pixel on our result image to its corresponding point on the two images. Since the points most likely would land on an exact pixel, Using interpolation, we can estimate the value we want using the nearby pixels. Here I use draw_polygon to speed up the computation by doing math on an entire triangle instead of pixel by pixel.
Mid Face | Morph Sequence |
---|---|
s/o to my test subjects
The Mean Face
I picked the smiling faces of all the dudes. Because I have a smiling picture of the new me.
dude 10 | dude 10 in average geometry |
---|---|
dude 11 | dude 11 in average geometry |
Mean face | New Me |
Dane in my geometry | Me in Dane geometry |
Caricature
We can produce caricature by exaggerating the transformation by increasing the warp factorMe as danish male warp_frac=1.5 | Me as danish male warp_frac=2 |
---|---|
bells and whistles
Changing gender
If I were a Female Chinese Actress (Shape) | If I were a Female Chinese Actress (Color) |
---|---|
Me if I'm a Female Chinese Actress (both) | Morph |