I selected two images. The first image is of Matt Damon and the second image is of Mark Wahlberg (these are both famous actors).
To start, I used the ginput function from matplotlib to select points on each image. Then, I averaged the points from each image and computed a Delaunay Triangulation on these averaged points.
To achieve mid-way faces, I warped each image to the averaged points mentioned in the previous section.
This was done by for looping through the Delaunay Triangulation, computing an affine transformation and performing an inverse warp for each triangle, then interpolating from the values in each respective original image.
With these each image morphed to the average shape now, I average the colors on each together to create the mid-way face.
To create a morph sequence, I morphed the mid-way images along with their colors but this time across 45 frames.
For each frame, I have a warp fraction and a dissolve fraction.
The warp fraction determines the weighted average of the points between the two images, while the dissolve fraction determines how much color from each image is blended into our midway face image.
The warp and dissolve fractions start at 1 and gets closer to 0, as I want to show the original first image of Matt Damon first and slowly let it morph to the image of Mark Wahlberg across the 45 frames.
I picked the Danes dataset of annotated faces and chose a subset of only male faces. I morphed all of the male faces from the Danes dataset and averaged them to get the average male Dane face.
Some examples of faces morphed to the average shape:
Here is the average male Dane face.
I warped Matt Damon into the average male Dane's geometry.
I also warped the average male Dane into Matt Damon's geometry.
I used points from the average male Dane and extrapolated with alpha values less than 0. I subtracted the points from the Matt Damon image from the average male Dane image, multiplied it by alpha, and added it to the original points of the Matt Damon image. These were some of my results:
I decided to change the ethnicity of Matt Damon's face through morphing it's shape and appearance with an average Asian male face.