Project 4: Image Morphing


I. Introduction

In this project, we are primarily deals with image morphing, a process to transfer the semantic content of one image to another image with the same content. On a high level, it involves three processes: finding the corresponding points, construct the triangulation from the points, affine transformation between each triangles.

My LinkedIn profile
Tom Hanks in Classy glasses

II. Finding the Correspondence and Delaunay Triangulation

In this point, we find the correspondence points by hand. By allowing the user to click alternately between two images, we obtain the list of correspondence points between two images. Since these points will be used for Delaunay Triangulation, the best effects will be achieved if each triangle has the same semantic content, i.e. eyebrow triangle should match eyebrows, ear triangle should match ear triangles.

Correspondence points with Delaunay Triangulation.

III. Affine Transformation.

While we can obtain triangulation on each image separately, we run the Delaunay algorithm on the interpolated points and use the triangulation order on the original points to make sure that the triangulation in the results is as reasonable as possible. That is, for two images, we have three sets of triangulation, one on the interpolated points and two on the original points. Once we have this, for each original image, all we need to do is to transform the corresponding triangles from the original image and halfway midpoint triangles.

Me tranformed to the halfway geometry
Tom transformed to the halfway geometry
Two image overlayed together,weighting 0.5 on each pixel

To obtain the above results, we calculate the middle points between the correspondence points in each image, i.e. we use a alpha weight of 0.5. Then for each triangle, we find the inverse transformation from the midway triangles back to its original triangle. Lastly, we fill up the result image by taking the points in the result image, apply the inverse transformation, and obtain the color in the original image.

By varying the alpha weight, we obtain a morph sequence from me to Tom Hanks.


75% Me + 25% Tom
25% Me + 75% Tom
The morph sequence

IV. Average Face

In previous part, we are dealing with a binary image morphing. However, there really is nothing that stops us from going to multiple images. Here we use the Dane's dataset and compute the average geometry of 33 male computer scientist. Then, we morph all of them to this average and overlay them together to produce the average face.

Average male computer scientists from the Dane dataset

Here are some examples of faces morphed to the average.

Original
Original
Original
Morphed
Morphed
Morphed

Based on the average feature points we calculated for the average male, we can also morph my image to the average male or morph the average male to my feature points

Me original
Me morphed to the average male (bad feature points)
Average male
Average morphed to me (Notice that smile!)

Instead of intrapolate the feature points, we can also extrapolate such that we emphasize the features in one image.

My face emphasized with average male features.
Average face caricatured with my face.

V. Bells and Whitsles

If we morph a girl onto the average male look, we might have some interesting gender changing effect. So I pick my favorite Hong Kong actress, Chingmy Yau, who looks quintessentially feminine to me and did some experimentation.

Chingmay Yau
Male Chingmay Yau
Chingmay Yau male