Defining Correspondences

Using ginput I inputted correspondences for 2 images. I then found the average set of points that corresponded. Lastly, I used those average points to create a Delaunay triangulation. This way the triangulation is equally imperfect for each image.

Triangulation on Image A
Triangulation on Image B
Computing the Mid-Way Face

To compute the midway face, I iterated through all the triangles in the triangulation. For each triangle, I computed a transformation matrix using the 3 (x, y) coordinates from the original image's triangle and the 3 (x', y') coordinates from the triangles from the average points. With those points, I applied linear algebra to find the a, b, c, d, e, f values of the transformation matrix.

With the transformation matrix T found, I then found T's inverse in order to perform an inverse warp. Applying T's inverse on all the (x', y') points of the target image's triangles gave the (x, y) value in the original image to sample from. On all the pixels within the triangle, I sampled the associated (x, y) values in the original image and interpolated them to put into the warped image.

Image A warped to average shape
Image B warped to average shape
Halfway image
Morph Sequence

I applied the morph sequence by using the same method as the midway face, but by using weighted averages such that the weight towards the final image increased with time.

"Mean Face" of a Population

To generate the mean face of the population, I averaged all their correspondences to find an average shape and then morphed all their faces together. I then added up the images (warped in average shape) and scaled each one by 1/n, where n is the number of samples included in the mean.

Below are the outputs from generating a mean neutral face and a mean happy face using 50 samples. There are also some samples of images from the population that had their face geometry warped into the average face.

Mean Neutral Face

Mean Smiling Face
Sample Image 1

Sample Image 1 - In Average Shape
Sample Image 2

Sample Image 2 - In Average Shape
Sample Image 3

Sample Image 3 - In Average Shape

In the images where I warped my face with the mean face, I struggled with getting a good match, probably because the angle of the photo is slightly different, despite best efforts to recreate a photo that aligned well with the population.

Image of myself
Average image shaped into my geometry
My face warped into average geometry
Caricatures: Extrapolating from the Mean

Produce a caricature of your face by extrapolating from the population mean you calculated in the last step. This might work better on a gender specific mean or some other characteristics specific mean.

Using the mean face and my face warped into the average geometry from the previous portion, I created a caricature of my face. The left caricature darkened my face, since my face is a bit darker than the mean image. The left caricature moved my face closer to the mean image by making my face smoother like the mean image and removing my freckles.

Image of myself

Mean face

My face warped into average geometry

Caricature
(0.6 * deviation)

Caricature
(-0.4 * deviation)
Bells and Whistles: Modifying Gender

To modify gender, I first generated a mean image for men using 30 images and then a mean image for women using 36 images. I then used those mean images to generate vectors so that I could move my image in the more "masculine" direction.

In the appearance modification we see the emergence of a slight shadow on the upper lip. In the shape modification my face gets wider, especially around the jawline.


Mean Face of 30 Men

Mean Face of 36 Women

Image of myself

More masculine - appearance

More masculine - shape)

More masculine - shape & appearance)