CS 194-26 Project 1

Project 2

Michael Wang

Overview

This project attempts to utilize convolutions to create and optimize an assortment of visual effects on images. These effects range from edge detection to image sharpening, to hybrid images and image blending.

The Mid-Way Morph

The strategy to morph an image of one face to another is surprisingly simple. The first step is to define a consistent mapping of feature points between faces. By doing so, we are able to create a map of triangles that cover all relevant points of the image through Dalaunay triangulation, as seen below:

Triangle mappings for Obama
Triangle mappings for Clooney

Once we have sets of point mappings between both faces, we find the midway point between both pairs of correspondances in order to calculate the mappings for the mid-way point of the morphings. Once we have that, we can create affine transformations for each corresponding pair of triangles in order to warp not just the triangle shape but also the colors within the images so that they match the midpoint. Once we warp every triangle in both images to the midway face, we simply cross dissolve the two by takign the average and we are left with the midway face:

The midway face

The Morph Sequence

We can extend our morph to beyond just the midway point. Rather than taking halfway point between the two face's correspondances, we can instead use interpolation to take any 0 <= p <= 1 proportion between points. This allows us to create morphed faces at any time step between both faces, resulting in the below gif:

GIF of obama turning into Goerge Clooney

Mean Face of Population

Of course, we can extend this even further to beyond just two faces. Say we want to the average of all the faces in a population. Then we can simply compute the average correspondances across all faces, getting us the mean face shape of a correspondance. Then, we apply the same morph in the mid-way shape computation to the mean face shape, weighting each morphed face to be 1/(pop. size) so we can sum all of the morphed faces to create one final mean face, shown below on the Danes set:

The average face of the Danes facial dataset

We now show my face warping into the average Dane's shape and vice versa:

Unmorphed Dane
Dane morphed to avg
Dane morphed to avg
Unmorphed Dane
Dane morphed to avg
Unmorphed Dane
The Danes average warped to my facial structure
My facial structure warped to the Danes average

Caricature

While we use interpolation to calculate midway faces between two images, we can also use extrapolation in order to enhance certain characteristics of a face in a given direction. For example, here is my face with facial features enhanced to those that are prominent in the Danes dataset:

My face extrapolated towards the Danes average with values of 1.5
My face extrapolated towards the Danes average with values of 2

Note the more rounded face, eyes, and thinner nose.

Bells and Whistles: Gender Change

We can also enhance certain gender traits within faces as well! We simply calculate the deviation between the average male and female's shape and color scheme, and we can then apply it to morph a given male face to a more feminine appearance: (The correspondances chosen were only around the face; hair and other extensions were not taken into consideration, hence the odd images)

me
Female Shape
Female Color
Female Face