CS 180 Proj 3: Face Morphing

Part 1: Defining Correspondences

First, I defined pairs of corresponding points for the two images using the correspondence tool from the CS180 website. In order to lessen the potential for triangle deformations, I took the average of the two sets of points and used the averaged set to create the Delaunay triangulation. I have displayed both of the images I will use for the face morphing along with their respective keypoints below:

Delauney Triangulation of Both Images

Monastery Image

Part 2: Computing the "Mid-Way" Face

Before computing the entire morph sequence for the two faces, I computed the average face between the two faces. In order to do this, I performed the following steps: 1. I first computed the average shape using the average of each keypoint location in the two faces. 2. I then warped both faces into the average shape. To do this, I defined the function computeAffine(tri1_pts,tri2_pts) to compute affine transformation matrices A between two triangles from each of the images. This transformation matrix was then used to implement an inverse warp of all pixels. I used sk.draw.polygon to find all points within a given triangle and applied the inverse transformation matrix to the points. 3. Lastly, I averaged the colors of the two faces together using a dissolve fraction of 0.5.

Wesley Image

Monastery Image

Wesley Jeremy Midway Image

Monastery no crop Image

Jeremy Image

Monastery no crop Image

Part 3: The Morph Sequence

To create a GIF of the transformation from one image to another, I computed 45 different frames with steadily increasing warp and dissolving factors. I also implemented the morph(im1, im2, im1_pts, im2_pts, tri, warp_frac, dissolve_frac) function, which takes in two images, their respective keypoints, the triangulation structure, the warp fraction, which controls the shape warping, and the dissolve fraction, which controls cross-dissolving.

Wesley Jeremy Frames

Monastery Image

Wesley Jeremy Gif

Monastery Image

Part 4: The "Mean face" of a population

For this part, I used faces from the FEI Face Database. I first computed the average face of the dataset which is shown below. I did this by computing the average face shape of the whole population, then morphing each of the faces in the dataset into the average shape, and finally computing the average of all of the warped faces.

Average Person

Monastery Image

Then, using the average face I computed, I warped some example faces to the shape of the average face. The results are shown below:

Warped 1

Monastery Image

Warped 2

Monastery Image

Warped 3

Monastery Image

I then warped my own face to the shape of the average face, and I also warped the average face to the shape of my own face:

My Face Warped to Average Face

Monastery Image

Average Face Warped to My Face

Monastery Image

Part 5: Caricatures: Extrapolating from the mean

To create a caricature of my own face, I extrapolated from the population mean I calculated in the last step by setting the warp fraction value to be outside the bounds of 0 and 1. I used an alpha value = 1.5:

Caricature of My Face

Monastery Image

Bells and Whistles: Changing Ethnicity

For this part, I decided to change the ethinicity of my face to be that of a Caucasian person. The images I used for this part are shown below:

Image of My Face

Monastery Image

Image of Average English Man Face

Monastery no crop Image

First, I morphed my face to the face shape of the Average English Male using the techniques in the previous parts:

Morphing My Shape to Average English Face

Monastery Image

Next, I morphed my appearance to that of the Average English Male. First, I warped the Average English Male face to my own face shape. I then averaged together my own face with the warped Average English Male:

Morphing My Appearance to Average English Face

Monastery Image

Lastly, I morphed both my shape and appearance to that of the Average English Male:

Morphing Both Shape and Appearance to Average English Face

Monastery Image