Part 1: Defining Correspondences¶
For this part, in order to morph two faces together, you have to first define corresponding points in the same order for each image (1:1 mapping like both of the 1st points are to the nose of each respective image, 2nd to the left eye, etc.). I used the correspondence tool that was listed on the website to label an image of myself and George Clooney. Points that seemed to work best for me when I chose points more spread out across the faces rather than in a compact space as it allowed for better morphing. I used more points on the more variable features in a person, like the nose, eyes, hair, and other ones, and less on more uniform features like the forhead or cheeks.¶
Here are the base images for George Clooney and myself:¶
Here are each of our faces labeled with the points¶
Once we have the correspondences (the points labaeled on each face), we can take the mean correspondences and use this to compute the Delaunay triangulation on the mean set of key points.¶
Part 2: Computing the Midway Face¶
Now, we have to compute the midway face between myself and the image of George Clooney. To do this, we must first compute the average shape from the mean correspondences (the ones we used in the previous part for a Delaunay Triangulation), then warp both of the faces into the average shape, and then average the colors of the warped faces in order to cross-dissolve it.¶
For the warping, we warp each triangle from the triangulation of each image into the average shape's triangulation. We can do this using the polygon function in skimage, which generates the triangle and its three vertices allowing us to mask and warp all the points in between instead of looping over all the pixels. Then, we apply an inverse warp to the triangles to find the pixel value at that pixel point.¶
(750, 602, 3) (750, 602, 3)