Overview
In this project, I created a morph sequence from one image to another. I used a set of correspondences, triangulations, and affine transform matrices for the bulk of the morphing. I also found the “mean face” from a large set of images. Finally, I created a “caricature” by extrapolating from the mean.
Defining Correspondences
First, defining a set of correspondence points was necessary to produce a smooth morph sequence. I selected one point on each eye, three on each eyebrow, three on the nose, three on each lip, three on each ear, 6 on each side of the face, one on the chin, and 3 on each side of the hair. These became the points I used to generate my triangulation using the scipy Delunay function. Below, I have my starting images alongside their triangulations.
me
|
my triangulation
|
my sister, Molly
|
Molly's triangulation
|
The Mid-Way-Face
To get the mid-way-face, I first averaged out the two sets of correspondence points. Next, I created a triangulation for this set of averaged points. I then computed the affine transforms of all the triangles in the first image to the average and all of the triangles in the second image to the average. With this information, we can warp the triangles with inverse warping and index into the original image to retrieve corresponding pixels in each triangle.
The Morph Sequence
Finally, we can combine everything into a morph sequence of 45 frames. Using the same code I wrote for obtaining the mid-way-face, I looped through and outputted each frame, scaling by the warp frac (which I increment by 1/45 each time). I do the same with the dissolve frac. After this, we can string the frames together into a warping gif!
The "Mean Face" of a Population & Caricatures
Next, I use what I have done with my morphing sequence to create the mean face, or average face, of a set of people. I chose the initially released subset of the face database from Technical University of Denmark for my population (37 images). I found the average shape by averaging all the points in each image. I warped each image into this shape and then averaged the colors to produce one “mean face” image.
average triangulation
|
averaged face
|
original image 8
|
original image 19
|
original image 30
|
image 8 at average shape
|
image 19 at average shape
|
image 30 at average shape
|
caricature: my face at the average from the population
|
caricature: the Danes average at my face shape
|