In this project, I will be using key feature points on various faces to create triangulations. I will then be using these triangulations to perform different types of face morphs.
In order to begin morphing, we mush first manually define the key features of our two faces
|
|
By using python's ginput, we can select out key points for each image manually, making sure to select the *same points* in the *same order* for the two faces. I selected 73 points total (69 (nice.) manual points plus 4 for each corner to ensure the background morphs as well). After selecting the points, we then average them, and use the average to compute our Delunay triangulation to minimize triangle warping/flipping between the two images.
|
|
As you can see there are still a few areas where triangles may have flipped/become really skinny, but those areas are minimal.
Before we begin making the morph sequence, let us first calculate the midway face. This is done buy first morphing both base images to the midway points, then averaging the two "mid-shaped" images. To morph, we use affine transformations on each triangle of the triangulation, and then interpolate the colors from the original triangles to the new triangle.
|
The images more closely resenble Faker, and I believe this is due to the Faker base image being much brighter. This won't really impact the morph sequence so I just left it as is.
Now we're ready to build the morph sequence. To do this, we just simply compute many (46 to be exact) varrying degreees of the "mid-way" face. We can do this by using our code from before, but moving the locations of the "average points" slowly from Aaron's points to Faker's points, while also using a weighted average of the images instead, so that we cross dissolve our images gradually from Aaron to Faker.
|
|
The basic morph has 46 frames at 30fps. Full loop has 92 frames.
Now let's use these same concepts to find the "mean face" of a population. We can do this by using an exisitng dataset with pre-defined points (Danes in this case) and morphing all the faces into the average shape, then averaging all the morphed faces. Very similar to how we got the midway Aaker image above, now simply with many more images to average over. Below are a few examples of original images morphed into the "average shape".
|
|
|
|
|
|
|
|
|
|
|
|
When we average all the morphed faces, we get the face of the average Dane!
|
We can now use this avergae face to morph. Here is my face morphed into the average Dane, as well as visa versa.
|
|
|
|
By computing the difference between my face and the avergea Dane's, we can also make caricatures by scaling that difference, and then re-adding it to my face. Here is my face as a "hyper" dane and an "anti" dane. Alpha is the scaling factor (where 1 would just be the original image)
|
|
|
As the alpha increases outside of the range of (0, 1) you can see that the images become more and more "extreme".
Since Hollywood already seems to think Scarlett Johansson is Asian, I figured I might as well take it upon myself and make her Asian for them.
|
|
|
Basically the same person amirite. Below are morphs between the two, showing shape only, color/appreance only, and then a full morph.
|
|
|
I think this project has been the best so far (despite also being the hardest to debug). Jokes aside, I was very surprised at how good the Asian Scarlett Johansson turned out.