In this project, we aimed to use morphing in order to smoothly transition one image (faces) into another. We acheived smooth transitions by triangulating images based off a few correspondance points. The Delaunay Triangulation was used in order to not obtain too overly narrow images. Affine transformations were used in order to transform pixels from the source image to the destination image.
For this part, I made a graphical user interface that could be used to select correspondance points that were used to make a triangulation. The user can select as many points as possible, then press esc in order to exit. The four corners of the image were automatically added as points and saved to disk as a .pkl file.
|
Now that we have our points, we can compute a triangulation of the image. We want to create a midpoint image given face A and face B. Both of these points have correspondance points generated from part 1. In order to create a triangulation, we average together all the points to create a "midway" correspondance, then compute a Delaunay triangulation based off of this midpoint image.
|
|
|
With this midpoint triangulation, we then compute an Affine Transformation between each face's points and the midpoints. With this transformation, we then morph face A and face B into the midpoint image triangle by triangle, and then average together the corresponding pixels in order to gain a midway image. Note that when we cycle through all the pixels in order to generate a midway image, we need to do reverse interpolation or else there will be some artifacts. This is because if we do forward interpolation, there might not be pixels in the resulting image that will be filled in. Reverse interpolation guarantees every pixel to be filled in. Images below display the artifacts.
|
|
|
|
|
|
Now that we can do midway morphs, we now aim to create a smooth transition from Face A to face B. We generate 45 frames between Face A and Face B. Instead of using a 50-50 balance to create a midpoint face, for every frame, there will be a weighted average of the points based on the (1/45) factor. As such, each frame will have its own Delaunay triangulation. Also, the pixel values will be weighted the same way as the points, creating a smooth transition between the two faces.
|
|
|
|
|
|
Here, we try to compute the average face of a population employing the same technique as we have employed in the midpoint face. This time, we use an average of ALL the faces in order to create a mean face. I used data from the Danes scientist data set.
|
|
|
|
|
I embarked on two different bells and whistles, the morphing music video chain between me and my friends, and changing my ethnicity + gender.
Here, I gathered images of 5 of my friends and chained them together. I overlayed music from the song "Why Can't We Be Friends?"
|
|
|
|
|
|
I obtained images of the Average Asian Female in order to female-ify myself. My theory was that I would align better to the average asian female than, for example, an average Ukranian Female. Let's test it out.
|
|
|
|
|