CS 194-26: Image Manipulation and Computational Photography

Project 4: Face Morphing

Ryan El Khoury, CS196-26-aah

Overview

Part 1: Defining Correspondences

The first step in our face morph is determining what exactly we are merging. A pupil located at coordinates (100, 100) in one face may be located at (106, 87) in another face. Correspondence pairs align the features of the two distinct faces with each other. The total number of correspondence points I defined for my two images was 72, with 4 being the corners of the image. With the mean of these correspondence points, we can create a triangular mesh using delaunay triangulation. We choose to work with the mean of the correspondence points because we want to fill in the pixels in the mid-point image with what we think would have come from the source and target images. More on that next section. Essentially, the triangles in the source image will slowly be warped to resemble the triangles in the target image.

Source image

Target image
Source image with correspondence points.
Target image with correspondence points
Midpoint - delaunay points calculated on this mean of correspondence points

Part 2: Computing the "Mid-Way Face"

Talk about process of calculating midway face (3 steps), delaunay hijinks (thin triangles)

The mid-way face starts with the delaunay triangulation as its base. Each triangle in the mid-way face represents what the corresponding triangles in the source and target images will morph into. The transition from the start triangles to the mid-way triangles changes the facial structure of the source image. This is because the features represented by the pixels in the source shift (not change!) to their new positions in the mid-way face. Calculating where the pixel values should shift to requires an inverse transformation on the pixels in the mid-way triangles. Since the movement from the source triangle to its corresponding mid-way triangle can be classified as an affine transform, we can invert this transform. Applying the inverse transform to a pixel within the mid-way triangle will give us the approximate location of the corresponding pixel in the source image. Since this location is not exact, we need to interpolate to find the best match. We perform the same calculations on all triangles in the target image. The appearance of the face changes when we interpolate between the pixel intensities of the start and target image. We have already calculated which pixels "ended up" at this mid-way face so by interpolating between the intensities of these source and target pixels, we can convey the appearance transformation of the source image and target image to the mid-way image.

Source image, with shape transformed to mid-way face.
Target image, with shape transformed to mid-way face.
Midpoint image, with both shape and appearance transformed.

Part 3: The Morph Sequence

The morph sequence consists of interpolating both the shape and appearance transformation over an interval of [0 1]. The "mid-way" image we calculated is the midpoint of this sequence, with the interval being around 1/2. As the interval nears 1, the image will resemble the target image more, in both shape and appearnace. The step size of the interpolation was 1/45. This results in 45 frames, with frame 0 being the start image and frame 45 being the end image.

Animated gif of transformation

Part 4: The "Mean Face" of a Population & Caricatures

I drew from the Danes dataset to create my "mean face". To qualify for my subpopulation, candidates had to have somewhatdark hair and be facing right. The mean face was the mean of all corresponding points in my subpopulation. I created a triangle mesh from the mean points. From there, I blended the appearance and shape of each face in my subpopulation with the same "mid-way face" technique.

Example man from subpopulation

Example woman from subpopulation

Me!
Delaunay triangluation of mean points.

Shape of man warped into mean.

Shape of woman warped into mean.
Mean face.

Mean face merged into my facial structure.
My face warped into mean face structure.

Part 5: Gender Change & Caricature

To make myself resemble a woman, I found a picture of the average blonde woman. I created corresponding points between my face and the average blonde woman and created a delaunay triangulation from the mean of these points (much like part 1). The results speak for themselves.

I chose to perform the caricature with this average because 1. it was head on and 2. it sampled from a greater number of faces (albeit not my gender). Unfortunately, my facial structure was a decent match with the average blonde woman's so the caricature is not as exagerrated as it should be. I performed it with the shape warp set to 1.5 and the appearance set to 0.7

My face!

My face, with points.

Average face of a blonde woman.

Average blonde, with points.

My facial structure altered.

My appearance altered.

Me as a blonde lady.

My facial structure exagerrated.

Me as a super blonde lady.