The goal of this project is to produce 'morph' animations from my face to a different face, compute the mean of faces of the population to create a caricature of myself.
To pinpoint the points for triangulation, we must pick the same points for both my face and the target face. I've personally assigned 41 points that would be considered as features of a human face. Here is the point assignment mock up for the images.
I've also added 2 additional points that points towards the left top edge and the right top edge, thus filling out the whole image. This results in total of 43 points to be saved for triangulation. I would save the point data in a text file with spaces and newlines to parse. Here are the points for each image.
hyunjae.jpg with points
george.jpg with points
To produce a 'morph' animation, we must first be able to compute the "Mid-way Face".
To compute this, we should first find the average points of each point in George
and myself. Then, we would compute a Delaunay triangulation of the average point.
Using the average points and triangulation, we can warp both images into the average
image through affine transformation and cross-dissolve with 50% each.
Summary:
1. Find the average points of two images.
2. Compute Delaunay triangulation of the average points.
3. Compute Affine Transformation for each points in the image to the average point.
4. Warp the Image with equal magnitude of colors.
Me!!
Average WOW
george.jpg
As you can see, the average image did display a promising result.
In this part, we will actually generate a 'morph' animation from my face to
George's face in a GIF file. The idea is simple. We would use the same triangulation,
with different intermediate points to warp to. While warping happens, the degree of
cross-dissolve will slowly fade towards the target image. To be specific, frame 1 is
a image of myself, frame 2-22 are the morph animation from my image to the average image,
frame 23 is the exact average image, frame 24-44 are the morph animation from the average
image to image of George, and frame 45 is the image of George.
Here is the morph animation from my image to George's.
In this part, we will compute the "Mean face" of a sub-population of the Danes
dataset. I've filtered all the male images, which led to 30 images total. Given
the correspondences of each image, I would average all the points to find the shape
of the "Mean face" and warp to find the average face image.
Here are some images I used from the dataset and the warped image to fit the average
shape:
10-1m.bmp
19-1m.bmp
26-1m.bmp
33-1m.bmp
40-1m.bmp
warped
warped
warped
warped
warped
Here is the average shape and the resulting average image:
Average Shape
The "Mean face"
Here is my face warped into the average geometry, and the average face warped into my geometry:
My face warped into "Mean face"
"Mean face" warped into my geometry
The warping of my face and the "Mean face" doesn't look that great. It may be because the correspondences for my face isn't perfectly pinpointed, but also it could be the matter of vastly different traits that is in my face in contrast to the ones in the Danes dataset. Another explanation could be that the alignment wasn't good. I've tried my best to crop and resize my image to match the average image's alignment, but it requires more precision than just manual labor. Feature alignment is definitely something to look forward to.
The objective of this section is to portray the difference between my image and
the mean image. To do this, I would compute the differences in triangular points
between my image and mean image, and I would add a factor of that to my image.
I will still use the triangulation of the average image to make it constant.
Here is the formula: caricature_pts = pts + frac * (pts - mean_pts)
The following images are the results in different factor.
My face
"Mean face"
Factor = 0.1
Factor = 0.3
Factor = 0.5
I've found an average face image of K-POP Idols. I do not have any intentions whatsoever to offend K-POP fans, but as a Korean, I find it interesting to see an K-POP Idol version of myself. I've used the same correspondences that I've used for the "Mean face" portion of the project. So here it goes.
My face
Average K-POP Idol face
Here is the result of warping my face to the average K-POP idol face. And with a better result, here is also the result of finding the midway face between my face and the K-POP idol face, which looks phenomenal.
My face warped into K-POP idol face geometry
Midway face from my face to K-POP Idol face