CS 194-26: Project 3
Defining Correspondances and Image Morphing
In this part of the project, I worked on using image warping to morph one image into another. The images were preprocessed by doing the following:
1. Defining Correspondences: Points were collected in each image that correspond to the same prominent facial features.
2. Calculating a Triangulation: Using a Delaunay Triangulation, the points in each images were organized into triangles that could then be warped
This step for an image of me and George Clooney is shown below: George Points George Triangulation Me Points Me Triangulation
Then, the following was done to generate a moprh, generating multiple transition images using different warping ratios(r) ranging from 0 to 1:
1. Calculate the mid-way/intermediate shape: The mid-way/intermediate shape and triangulation between the two images were calculated using interpolation with the specific warping ratio requested. This was done such that each point in the midway shape was r * (point in image A) + (1-r) * (point in image B).
2. Warp: Using affine transformations, each triangle in the original images were transformed into the triangles in the midway shape
3. Cross Dissolve: In the final image, the two warped images were cross dissolved such that each pixel in the resulting image was r * (pixel in warped image A) + (1-r) * (pixel in warped image B)
Here are the results for two different morphs(the morph animations may take a minute to load): Clooney Midway Image Me Morph Obama Midway Image Steph Curry Morph
Population Morphing
In this part of the project, we found the average face of a population(50 people). This was done by
1. Calculating the average face shape by averaging all the correspondences in each image
2. Warping each image of the population into the average shape
3. Averaging the warped faces
The result is shown below, along with some examples of warping specific faces into the average shape. Population Average Person 1 in Population Warped into Average Shape Person 12 in Population Warped into Average Shape Person 15 in Population Warped into Average Shape
The result of warping my face into the average population's shape and the average population face into my face shape is shown below. Me Me with the Avg face shape Avg with my face shape
Caricatures
Using the population average from the previous part, I also generated caricatures of my face. To do this, I first calculated the face shape of the caricature using the following formula(extrapolation): pop_mean + alpha * (my_face - pop_mean), where alpha is greater than 1 or less than 0. Then my face was warped into the caricature shape that was computed. Here are the results with alpha = -1 and alpha = 1.5: Caricature 1 Caricature 2
Changing Ethnicity(B&W)
For a bell/whistle, I changed the ethnicity of my face to a spanish male using the same warping/morphing procedure explained above. The average spanish male face was found online. Here is the result of changing both the shape and the appearance of my face. Average Spanish Male Spanish Me Me
Here is the result of changing only my face shape and only my face appearance. Only Changing Shape Only Changing Appearance