October 2023
Our goal is to morph the shapes of two images together. To do this we first need to select corresponding keypoints for each image. To make a 2d warp we can use a triangular mesh that covers the whole image, using keypoints such that the triangles in each image correspond to each other. A good method for getting more evenly sized triangles is to use Delaunay triangulation to produce the triangular mesh.
We must figure out how to get from one triangle to the corresponding triangle in the transformed image. We can set up a system of linear equations to solve for the transformation matrix.
Given a triangle T (ax,ay), (bx,by), and (cx,cy) and a triangle T’ with vertices (ax′,ay′), (bx′,by′), and (cx′,cy′) we can set up a system of linear equations that describes this affine warp.
We can solve this for A =
Using this method, we can warp each triangle in the average mesh into
the corresponding triangle in the original image’s mesh. This tells us
which positions in the original image would warp to each pixel of the
midway image, and I used linear barycentric interpolation interpolation
to get the color for that pixel.
We do this for both of the original face images to get the average shape. To get the average color we average the pixel values and then we have our mid-way face.
To get each frame of the morph sequence, we perform the same procedure used for generating the mid-way face, but we use a weighted average instead.
Using The FEI face database (Brazilian face database) dataset, we can compute the average face of this population by calculating the average face shape and morphing each face into the average shape. I did not divide into subpopulations such as gender. Below are some examples of images from the dataset morphed into the average shape for the entire dataset.
Let’s consider the average face shape to be a vector h and my face shape to be a vector f, then f−h can be interpreted as what is unique about my face and we can extrapolate my face further in those directions. Therefore, by adding α(f−h) to my face shape (where α>0) and morphing my face into the new shape, we can exaggerate my facial features to provide a caricature of myself.
Below are the results for extrapolating from the mean of the entire FEI face database, including males and females.
Out of curiosity, I projected my face onto the the average shape of Japanese actresses. I also adjusted what the weights accordingly. My correspondence points should have been a little different because it makes my chin really disproportionate. Other than that, I do look better.