Project 3: face morphing

Introduction

In this project I am trying to smoothly morph two images, manually selecting correspondences, using Delaunay triangulation and affine transformations. I also compute mean of the dataset of 100 ppl, try to warp my face into the average, warp a few faces from the dataset, and create a caricature of myself.

Part 1: efining correspondences

I decided to do correspondences of Matthew Mcconaughey and Elon Musk. To define correspondences I used the given tool in project specification. Here's what I got

Matthew Mcconaughey and Elon Musk images

Mcconaughey

Musk

Below are the triagnulations I got.

Part 2: Mid-way face

Here I computed the Mid-way face. To do that I used warp fraction and dissolve fraction(both 0.5). I created two empty images with the shape of our images, created blended points by '(1 - warp_fraction) * points_img1 + warp_fraction * points_img2', warped triangles(bounding rects, create a mask, fillconvexpoly and then affine(w/ billinear interpolation)). In the end, I blened warped results doing '(1 - dissolve_fraction) * warped_img1 + dissolve_fraction * warped_img2' - using cross dissolve.

Here's the midway image

Part 3: morph sequence

Here, I just performed the same thing above, but getting 45 frames and making it a gif.

Morphing Sequence

Part 4: The "Mean face" of a population

Here, I downloaded a dataset of 100 faces, took the average and created the "average face".

I used the average to warp myself and a few people from the dataset as an example

Part 5: Caricatures

In this part I extrapolated the average using 'caricature_points = mean_points + extrapolation_factor * (keypoints - mean_points)', where the factor was > 1

I believe my pictures could've been better if they were made in a similar way, but I couldn't make a good one and ended up having this. However, the effect of average is clearly seen in dataset pictures.