In omputational photography, morphing is the process of creating a smooth transition, or morph, from one picture to another. Unsurprisingly, in face morphing our two images our pictures of two faces.
By marking the positions of features, like the eyes or the nose, in each image, we can compute the transformation that moves each point to any other arbitrary point. Through some additional trickery, we "pull" the pixels of each image so that they follow the control points to the new positions.
Assuming that we have two images and a list of control points, morphing between the two images is relatively straighforward.
An affine transform in a single transformation that combines translation, rotation, scaling, and shearing. As a matrix, it is defined by six parameters. To compute it, we need three correspondances, or a total of six points. How convinient for us that six points can be obtained from two triangles!
I found the affine transform using a series of basis changes, which I've attempted to illustrate below. First, we find the matrix that converts a point in cartesian coordinates to coordinates defined by the sides of one triangle (Barycentric coordinates). Then we find the matrix that converts coordinates defined by the sides of the second triangle back to cartesian coordinates.
Now we apply a nice property of triangles - they are all basically the same. What this means is that if we have a point defined in terms of two sides of a triangle, the matching point in a different triangle has the same coordinates in terms of the same two sides of the new triangle. What we have are two different points that have the same relation with respect to their triangles. If we morph one triangle to the other, we also move one point to the other.
The end result of all of this is that if we combine the two coordinate (basis) changes, we have a single transformation that goes from pixel coordinates in one image to pixel coordinates in another - our affine transformation
This is the average face of the class. The mean face, if you will. All faces were morphed to the average shape and then the pixel values were averaged together.
This is the mean face morphed to my facial structure.
This is my face morphed to the average structure.
Not feeling ambitious enough to try the more technical bells and whistle, I just had fun morphing things
For example, if we define two sets of control points on the same image, we can make squishy things! Blorp! Blorp!
Next, I took a trip to the zoo. I saw a llama, a hideous gorilla, and a gazelle.
Then, I mutated. Evolution in action! Unfortunately, the process left some artifacts...