This project involved a lot of triangles, inverse affine transforms, and Delaunay Triangles. Bells and Whistles: -Changed a person of Asian ethnicity into a person of European ethnicity
Here we do 2 things:
Now that we have a set of correspondence points and we know how to find a set of Delaunay Triangles for these points the goal here is to find a set of Delaunay Triangles that are the same for both images so that we can comprehensively combine the two images. Each image has a unique Delaunay Triangle mask associated with it initially.
A simple way to do this is to simply find an average between the two triangles and then use half of one image and half of the other image through a cross dissolve. What we get here, is the Mid-Way Face connected to a Mid-Way Delaunay Triangle mask.
An even half and half averaged mask is only one out of an arbitrary amount of possible intermediate masks, each averaged intermediate mask can be weighted more heavily toward one image mask or the other. From this, we can create a morphing from one image to another image by procedurally finding a set of Mid-Way Delaunay Triangle masks that transition smoothly from one image to the other by slowly being weighted closer and closer toward the destination images Delaunay Triangle mask.
We warp one image across the set of Mid-Way masks by using an affine transformation from each triangle in the initial Delaunay Triangle mask to the respective triangle in the current Mid-Way mask. Here we use 45 different Mid-Way masks for 45 frames in the following gif.
In this example we do the same thing as above, but with images of a different nature. The source image is an image of an Asian female’s face, and the destination is an image of the average female European's face.
By transitioning from the Asian females face toward the average European female’s face, we can procedurally change the ethnicity of the initial image to be more European. Below is shown the Mid-Way Face between the 2 images which changes the ethnicity of the Asian females face to European
As demonstrated in the above example, average faces can be incredibly useful in morphing.
In the following segment we use a freely available dataset of annotated faces of Danes with correspondence points. Using this, we can find the mean Danish face. Here, average set of correspondence points and the resulting average Delaunay Triangle mask is calculated from the given correspondence points from all the images, and then, each image is warped into the average shape using the same method used in morphing.
Now that we have the mean, we can do some interesting things.