Project 3: Face Morphing

Justin Chen

Overview

The primary goal of this project is to explore how we can exploit image transformations to produce face morphs. Throughout this project, we use a variety of image processing techniques such as inverse warping and cross-dissolving to produce results such as "mid-way" faces, morphing, and caricatures.

Defining Correspondences

Before we can warp two images together into some average or midway shape, we first need the corresponding points defined for each image to ensure that similar features (nose, eyes, etc.) get matched up correctly. To do this, I first resized the images in a photo editor to ensure that the dimensions were the same, then used matplotlib's ginput() function to define n points on each image by hand. We only need to do this once, as we can save these points and then run the Dulaunay Triangle algorithm on these points to output triangulations.

JChen
Original Image 1: JChen
JchenTru
JChen Triangulation
FedTri
Federer Triangulation
Fed
Original Image 2: Federer

Computing the "Mid-Way" Face

To compute the midway face, we use the triangulations from the previous part to compute affine transformations in matrix for each corresponding triangle. Then, we inverse warp by generating a mask with polygon() so that we can derive the new values of each pixel from the corresponding pixel(s) given by the affine transformation.

JChen
Original Image 1: JChen
JchenTru
JChen Warped
JChenFedMid
JChen-Federer Midway Face
FedTri
Federer Warped
Fed
Original Image 2: Federer

The Morph Sequence

The morph sequence is created from running the warping and cross-dissolving methods from the last section on increasing warp/dissolve fractions (in this case, I chose 45 images and 1/45 increments).

Morph
JChen – Federer Morph Sequence

The "Mean Face" of a Population

The same techniques and methods from the two previous sections are applied to the "Danes" photo set, specifically the males.

Some sample morphs of Danish men to the average shape
20M
Dane 20-1m
23M
Dane 23-1m
28M
Dane 28-1m
33M
Dane 33-1m
39M
Dane 39-1m
Final Products
AvgDane
Average Dane
JChenDane
JChen Warped Onto Average Dane Shape
DaneJChen
Average Dane Warped Onto JChen Shape

Caricatures: Extrapolating from the mean

As seen above, warping my face onto the shape of the average Dane already produces some comical results. Here are a couple more examples with varying warp proportions.

Caricature0.7
Caricature; warp_frac=0.7
Caricature0.8
Caricature; warp_frac=0.8
Caricature0.9
Caricature; warp_frac=0.9

Bells and Whistles

For my Bells and Whistles, I changed my race (Asian->Indian) and added a smile!

JCHENBW
JchenKaranGIF
New ME!
KARANBW