The goal of this project is to create a morphing algorithm that blends two faces together, to compute the mean of a population of faces, and to extrapolate from a population mean to create a caricature.
My goal was to morph my face and my friend Ruihan's face.
I started by defining 34 points on both faces as follows:
With these points, I computed for the mean of the points then computed the Delaunay triangulation of these points.
I also decided to morph the faces of my two friends, Colin and Michael. I defined points on their faces similarly. Here are their original photos:
To compute the mid-way face, I computed the affine transformation matrix of each triangle in the original image's triangulation with each triangle in the mean triangulation. Then using the affine transformation matrix, I computed the corresponding coordinates from pixels in the mean triangle to the original image. I then inputted these coordinates into two functions I created using interp2d for each of the original images that outputs the value of the pixel at that coordinate. The actual pixel value of the final morphed image would be a mean average of these two values.
I applied the same algorithm I used to find the mid-way face except I played with getting a weighted average of the points and also a weighted average of the pixel values. In particular, at each time step, I increase my warp_frac and dissolve_frac by 1/45.
From a dataset of Brazilian people, I randomly selected a male subset of the population. Here are the original images:
The idea here was to produce a caricature of my face by extrapolating from the population mean. I definitely look like a caricature...
For bells and whistles, I attempted to morph my face with a different gender, age, and ethnicity, and I thought Morgan Freeman would be a perfect candidate. Here, I applied the same morphing algorithm I used in previous sections.