Project 3: Morph

In this project, I play around with polygonal morphing on faces.

Face Morph

In this first section, I try to morph faces into each other through a smooth transition. The first step in this process is to find the "average face" between two faces. First I'll show the point correspondences, for each photo.

My Image (hair and background edited)

My keypoints

Gigachad

Gigachad keypoints

The next step is to take these points, average them, and morph the images to the average by calculating their homogenous tranformation matrices, and averaging the colors. The homogenous transformation matricies were calculated by taking each an inverse map, calculated by taking each triangle in the average map, finding the transformation so that two of the sides of the triangle form a orthogonal basis at the origin: A^-1, then finding the transformation to the triangles to the image: B. The matrix product of the two transformations B@A^-1 is the inverse map that find the corresponding pixle from the midway face shape to each person's regular face shape.

This method, however, left some bright lines between the transformed triangles. I believe this is due to the transformation overlapping the triangles together at random locations, since the pixles are brighter intensity but the correct hue. This resulted in it being very difficult to debug, in the future, another method like direct pixle interpolation may provide better results.

Midway Face

With the midway face calculated. We can simply adjust the weighting of the average points and the weighting of the average colors to create a morph sequence.

Midway Face

Mean Faces

By the same principle, we can also find the midway face of an entire population. Here we have a dataset of Brazilian faces manually aligned, we can average each face to obtain an "average" face of the Brazilian population.

Average Face

Happy Average Face

We can try to morph our face to the average population, and vice versa. The results are not so great. This may be because of various differences in how our photo is taken, and me not being Brazilian. As you can see later, morphing a Brazilian face to the Brazilian average face oftentimes looks like there is no difference at all.

My Face

My Face warpped to Mean

My Face

My Face warpped to Mean

Now lets try warping the Brazilian faces to the average. I played with warping non-smiling images to smiling average, just to see the result.

Img 10a

Warped 10a

Img 10b

Warped 10b

Img 1b

Warped 1b

Img 21a: None-smiling

Warped 21a: Warped into smiling

Img 58b

Warped 58b

Another thing we can do is extrapolate and create a caricature. This is done by finding the difference between my image and the average image, then adding this difference by a scalar to my original image. The results look like this:

Caricature

Bells and Whistles: Changing Ethnicity Using Morphs

Using the average image of a population, we can play the the weights and warps to see how a person would look like in different ethnicities. We do this by weighted morphing and averaging the population mean face and individual face together. First let us see if we only change the appearance without morphing:

Appearance Only

As you can see, the alginment is not very good, plus, the two subjects have different face structures so it yields a poor result. Now lets try changing/warping only the structure:

Shape Only

This is a bit better, but what really helps is doing both:

Both

In the above sequence, each loop is has increasing morph, from 0 to 1. The more morph the more the individual's face becomes alligned to the average face. While in each loop we can see the increasing weight of the average face. Specifically the non-gif results look like this:

Morph Array

The best results lie in the middle of the graph, where the individual and average faces are blended together, rather than heavily biasing one or the other. This way we keep the indivudal characteristics of the individual while also apply the average face.