CS 194-26, Fall 2021

Intro to Computer Vision and Computer Photography

Project 3: Face Morphing

Prom Putthisri, cs194-26-aaw

Background

The objectives of this project is to utilize knowledge on affine transformation and geometric manipulation to create face morphing animation. We acieve this through selecting representative features of of the face through control points. Then, we create a Delaunay Triangulation mesh over the control points. After which we can compute affine matrix and warp the image into any other Delaunay Triangulation with the same oreintation. This will result in face morphing.

Part 1: Defining Correspondences

In this part we will be using the cpselect method in matlab to define coresponding features on each faces. Through out the entirity of this project the cpselect method will be our only method of choosing control points other than just downloading it.

After controls points are being represent, we will create the Delaunay triangle on the target face (mean, wrap factor, etc.).




P1
P1 Delaunay Triangles
P2
P2 Delaunay Triangles

Part2: Computing the "Mid-way Face"

In this part, we are going to compute the midway face of the image. This is done by fiinding the everage shape of the image. Then warp the image of both face into the shape. And finally, average all the color. The hardest part in this section is the warping, which is done through multiplication of affine matrix and the use of polygon function.



P1 Midway Warp
P2 Midway Warp
Midway Face (After Average)

Part3: The Morph Sequence

Morphing is very similar to finding midway face. THe only different is that we do not find the midway (0.5 warp factor, or mean) of the face. We rather iterate through increasing sequence of warping factor. The equation us is (disolve_factor) * warp(img1, warp_factor) + (1 - disolve_factor) * warp(img2, warp_factor) when warp() find the weighted distance between two control point rather than the average distance.

20 Sequence Morphing

Part4: The "Mean face" of a population

In this part, we are computing the average face from "Danes" dataset. The way we achieve this is through finding the mean of all faces' control points to get the average control points. We, then, morph all images to the average before averaging all the color.

Male Average in "Danes"
Here are some of the individual morphing of face before average combination to get the image presented above. Since there are a lot of faces I am going to present 30 faces only for the purpose of showing the face morphing.






Morphed Sample Face #1
Morphed Sample Face #2
Morphed Sample Face #3
Morphed Sample Face #4
Morphed Sample Face #5







Morphed Sample Face #6
Morphed Sample Face #7
Morphed Sample Face #8
Morphed Sample Face #9
Morphed Sample Face #10







Morphed Sample Face #11
Morphed Sample Face #12
Morphed Sample Face #13
Morphed Sample Face #14
Morphed Sample Face #15







Morphed Sample Face #16
Morphed Sample Face #17
Morphed Sample Face #18
Morphed Sample Face #19
Morphed Sample Face #20







Morphed Sample Face #21
Morphed Sample Face #22
Morphed Sample Face #23
Morphed Sample Face #24
Morphed Sample Face #25







Morphed Sample Face #26
Morphed Sample Face #27
Morphed Sample Face #28
Morphed Sample Face #29
Morphed Sample Face #30
Here are some of the Mean face of some other faces type in Danes dataset. Note: I think it is very interesting that the smiling and none smiling face of the mean is for sure the same person.



Female Mean Face
Smiling Female Mean Face
Smile Male Mean Face
Now, we can try warping our face into the average face and the other way around. I also choose the best looking midway face to show as well.



My face to average face
Average face to my face
Very good looking warp
Notice that my head is a bit cut from "My face to average face" this is due to the fact that the control points in Danes dataset doesn't cover for head and hair but rather focus on face only. Adding more control points on that area would help smoothing my face.

Part5: Caricatures: Extrapolating from the mean

Not only that we can morph our face through interpolation, we can also extrapolate as well. In this case, the warp_factor we use will be either more than 1 or less than 0. The effect it gives should be along the line of overly exaggerate or overly dexaggerate specific features of a face into or away from the target image. Using the average male from Dane dataset, I am going to exagerate and dexaggerate my face into the mean.


-0.5 warp_factor
1.5 warp_factor
Notice that my head is a bit cut from the 1.5 warp_factor this is due to the fact that the control points in Danes dataset doesn't cover for head and hair but rather focus on face only. Adding more control points on that area would help smoothing my face.

Part6: Bells and Whistles

This project is a fun project so it is only appropriate to have a section dedicate to how fun face morphing can be.

Part6.1: Change age/gender/ethnicity

Lets turn my face into a Ukrainian Women's!!!





My face
Average Ukrainian Women's face
My face warp to Average Ukrainian Women's face
Midway Face of the Warp
Morphing Sequence

Part6.2: Do something else that is fun in this space

My girl freind and I often refer to one another as "Pero" and "Gato", latin for dog and cat. SO I will dedicate this space to morph my face into a dog and my girlfriend into a cat. Notice that our head morph into an ears. To acieve this, we also need a lot more control points. I actually use 127 control points for the morph.





My face
Pero
My girlfriend's face
Gato
Control Points
The results are as follow!!!




Pero Prom
Pero Prom Gif
Gato Ice
Gato Ice Gif
Notice the sholder morphing of Ice Gato Gif, Amazing!!!