# Morphing between Images

The first part of the project is all about getting one image to slowly morph into another. The way we do this is by first defining correspondant points between the two images. Then we find a mid-way face shape of the correspondant points. How much of each image contributes is parametrized by an alpha.

We then find the Delaunay triangulation of the shape. Using that we calculate the affine transformation for every triangle between the average shape to each of the two images. Once we've done that we can compute an inverse warp and interpolate all the pixels onto the mid-way shaped face.

Here's the method used to turn Bruce Banner into the Hulk and back.

These are some of the intermediary images and the alpha used for them were 0.25, 0.5 and 0.75 respectively:

# Mean Face of the Population

For this section, I used the IMM Face Database with 37 images. To find the mean face, I first averaged the correspondant points amongst all the images. Then using the method from the previous section, I'm able to warp any of the images in the dataset to that mean shape.

Here are some examples of a few of the faces with only their shape warped to the mean shape while the color was left unchanged.

They turned out in general... well not super great.

Then I computed the mean face by averaging out the color by using each image warped into the average shape. This is what the result looks like. Quite cute, I think.

Here's an image of me and warping the mean face geometry onto my image (first one) and vice versa.

# Caricature

We can push our images further away from the mean to create a caricature. I did this by just increasing alpha for warping the shape to be greater than 1.

Here's an example using an image from within the dataset. The first is the original image, the second is with alpha = 1.5 and the third is alpha = 2.

We can see that pushing alpha a little too far leaves us with the image being way too out of proportion.

This one is using an image of me (first one) and doing a caricature of alpha=1.5 which isn't too bad and going overboard with alpha=2.

# Bells and Whistles

I decided to do a gif of Harry Potter (a.k.a Daniel Radcliffe) over the years by taking an image from when each of the movies where shot.

I used the same method to morph between two images and just merged them all into one gif.

Some of the ones where the face direction shifted a lot doesn't morph super great but overall it doesn't look too bad.

This one is using an image of me (first one) and doing a caricature of alpha=1.5 which isn't too bad and going overboard with alpha=2.