Project 3: Face Morphing

Warping/ Miaway Image/ Morphing/ Average Face/ Extrapolation

Yuqin Jiao


Overview

This project is for producing a "morph" animation of my face into someone else's face, compute the mean of a population of faces and extrapolate from a population mean to create a caricature of my face.

Part 1: Defining Correspondences

For part 1, I cropped the image from me and another person (Margarita Bazyluk) and imported the two images. And I used the tool from a last year's student (as described in the project instruction) to label the points on both faces following the same order. Then I imported these two point sets to compute the points in the midway image with this formula "mid_points = (im1Points + im2Points) / 2". After creating the triangle using Delaunay, I got this midway triangle image [figure1_1]. Also I got the triangle diagram on both faces [figure1_2] [figure1_3].

Description of figure1_1
[figure1_1] Midway Triangulation
Description of figure1_2
[figure1_2] Triangulation on Image1
Description of figure1_3
[figure1_3] Triangulation on Image2

Part 2: Computing the "Mid-way Face"

To compute the "Mid-way Face", I followed this steps: (1) computing the average shape (have been done in part 1), (2) warping both faces into that shape, (3) averaging the colors together. For part 2, since we don't need to show the morphing process, I just computed the mean value of both points and colors of both images. Also, I set the affine transformation matrix in compute_affine function, after getting the affine transformation matrix then I computed the inverse of the affine transformation matrix, finally used RegularGridInterpolator (similar as the griddata) to interpolate the value of color on the midway image.
I implemented the above approached on each three channels separately, so after getting the blended color on each channel, I then used np.dstack to get the final midway image[figure2_2].

Description of figure2_1
[figure2_1] Image1
Description of figure2_2
[figure2_2] Midway Image
Description of figure2_3
[figure2_3] Image2

Part 3: The Morph Sequence

For morphing process, I defined the morphing function and got the morphing image using "morphed_im = morph(im1, im2, im1_pts, im2_pts, tri, warp_frac, dissolve_frac);" as described in the instruction. I set the warp_fraction and dissolve_fraction as the same value change from 0 to 1. After getting 45 frames, I made the 45 images into a gif format to show the morphing process[figure3].

Description of figure3
[figure3] Triangulation on Image1

Part 4: The "Mean face" of a population

For part 4, I used the FEI dataset with the points provided correspondingly. I choosed the first 100 faces (1a, 2a, ..., 100a) to compute the average shape(compute the mean points coordinates, getting triangulation). After getting the average shape, I warpped each faces into the average shape, the examples are shown in the following from [figure4_1] to [figure4_8]. After finishing the color blending, I got the average face [figure4_9]. Also, I warped my face into the average shape [figure4_10], inversely, I warped the average shape into my face[figure4_11].

Description of figure2_1_9
[figure4_1] original image
Description of figure2_1_10
[figure4_2] warped image
Description of figure2_1_11
[figure4_3] original image
Description of figure2_1_12
[figure4_4] warped image
Description of figure2_1_9
[figure4_5] original image
Description of figure2_1_10
[figure4_6] warped image
Description of figure2_1_11
[figure4_7] original image
Description of figure2_1_12
[figure4_8] warped image
Description of figure2_1
[figure4_9] Population Average Face
Description of figure2_2
[figure4_10] My Face warped into Average Shape
Description of figure2_3
[figure4_11] Average Shape warped into My Face

Part 5: Caricatures: Extrapolating from the mean

To produce a caricature of my face, I used extrapolation from the population mean I calculated in Part 4. Say "p" is my face, "q" is the average face, the formula is: caricature = q + alpha(p-q). In this case, if alpha = 1, the result of caricature is my face, if alpha = 0, the result of caricature is the average face, if alpha is greater than 1, the result of caricature will have more my_face's features, if alpha is less than 1, the result of caricature will have more the average_face's features. I choosed alpha = 1.5, 1, 0.5, generated the caricature images correspondingly.

Description of figure2_1
[figure5_1] Caricature Image with Alpha = 1.5
Description of figure2_2
[figure5_2] Caricature Image with Alpha = 1
Description of figure2_3
[figure5_3] Caricature Image with Alpha = 0.5

Bells and Whistles 1

For part 1 of Bells and Whistles, I chose a face from difference gender and ethnicity to try morphing.

Description of figure2_1
[figure6_1] Image1 from FEI Dataset
Description of figure2_2
[figure6_2] Image2 from FEI Dataset
Description of figure2_1
[figure6_3] Morphing just the Shape(warping)
Description of figure2_2
[figure6_4] Morphing just the Appearance(color)
Description of figure2_3
[figure6_5] Morphing both Shape and Color

Bells and Whistles 2

For part 2 of Bells and Whistles, I made a video morphing five skaters' faces. The video theme is "Romeo and Juliet", which means the five skaters all have had skating programs using "Romeo and Juliet" theme.
I believe the "Romeo and Juliet" theme is not only about LOVE, it's more about FREEDOM.


Bells and Whistles 3

For part 3 of Bells and Whistles, I tried a different morphing algorithm, especially a different color blending algorithm. Instead of using t in range(0, 1) as the dissolve_frac, I used sigmoid function to implement t value. the value of t is "1 / (1 + np.exp(- k * (t - 0.5)))", with k = 10. In this case, the morphing process is not evenly and gradually change, it changing speed following the sigmoid function curve instead.

Description of figure2_1
[figure7_1] Original Morphing Process Frame15
Description of figure2_2
[figure7_2] New Morphing Process Frame15
Description of figure2_2
[figure7_3] New Morphing Process