Project 3: Face Morphing by Lisa (Qi) Hou

In this project, I played around with morphing and cross-dissolving to generate new images based on different faces and populations.

Part 1: Face Morphing

Defining Correspondences

I decided to create a morphing sequence using pictures of myself (Left) and my sister Lin (Right), possibly to see what we would look like if we were identical twins.

Finite Difference Operator Result
Finite Difference Operator Result

I first manually defined 91 corresponding points on each image using plt.ginput, and then calculated the mid-point of the corresponding points for the two images to create a triangulation (using the Delaunay triangulation algorithm from the python scipy library) for morphing.

Finite Difference Operator Result
Finite Difference Operator Result

Computing the "Mid-way Face"

The mid-way face was computed by first calculating the average shape from the keypoints of the two images. An affine transformation was applied for each triangle in the Delaunay triangulation to warp both faces into the average shape. This process involved the computeAffine function, which constructs a system of linear equations based on triangle coordinates and solves it using np.linalg.solve to determine the transformation parameters. The inverse transformation matrix was then used to map pixels from the original images to create the warped versions. While scipy.interpolate.griddata was initially considered for bilinear interpolation, it proved inefficient, and scipy.ndimage.map_coordinates was used instead for faster interpolation between the four nearest neighbors. Finally, the pixel values of the warped faces were averaged to produce the mid-way face.

Derivative of Gaussian Filter Result 1

The Morph Sequence

Lastly, a morphing sequence from my face to Lin’s was created with 45 intermediate images. The intermediate shape was created based on the warp_frac parameter and cross-dissolves the pixel values according to dissolve_frac. By varying these parameters across frames, I generated a continuous morph sequence from my face to Lin’s with both shape and appearance transitions smoothly.

Derivative of Gaussian Filter Result 1

Part 2: The Mean Face

Computing the Average Face

Using the spatially normalized happy face data from the FEI Face Database, an average happy face was generated. The average shape was calculated by averaging the correspondence points across all faces. Each face was then warped to this average shape (examples shown below):

Example of images warped into mean face
Examples of warping faces into the average shape

Then, final average happy face was obtained by averaging the pixel values of the warped faces. In addition, 1) My face warped into the average geometry, and 2) the average face warped into my geometry were also displayed.

Hybrid Image 1
Average Face for Happy Expression
Hybrid Image 2
My Face Warped into the Average
Hybrid Image 3
The Average Warped into Mine

Caricatures: Extrapolating from the mean

A caricature was created by exaggerating the differences between the original face and the population mean. The keypoints were extrapolated by scaling the difference between the original keypoints and the mean, and the face was morphed to these new keypoints, with positive alpha exaggerating my feature, and negative alpha exaggerating the population mean feature.

Hybrid Image 1 Hybrid Image 2 Hybrid Image 3 Hybrid Image 3
Hybrid Image 1 Hybrid Image 2 Hybrid Image 3 Hybrid Image 3

Part 3: Bells and Whistle

Change of Gender

I experimented with changing the gender of my face by morphing my face to match the average Chinese male face. First, the set of correspondences are first defined on both images. Then, I tried 1) only morphing the shape by warping my face to match shape of the average Chinese male face, 2) only morphing the appearance which is done by warping the average Chinese male face to match my face shape and then cross-dissolve the pixel values. 3) morphing both shape and appearance to obtain the final result.

Hybrid Image 3
Hybrid Image 1
Shape Only
Hybrid Image 2
Appearance Only
Hybrid Image 3
Shape and Appearance

Me in Time

I also created a series of transformation from my childhood photos to now by defining the same set of correspondence points for each photo and warping and cross-dissolve between the adjacent ones: