In this project, we will morph a face into someone else's face(shown in a .gif file), compute the mean of a population of faces, and extrapolate from a population mean to create a caricature face.
We choose facial key points by hand and use Delaunay() to create a triangulation mesh of these points. The figure is shown as below.
Then, we compute the mid-way face by first averaging the facial keypoints of two images:
Then, we use the source and destination triangles to calculate a matrix, which is used to warp the axes within the triangle. Here is what computeAffine(src_pts, dst_pys) mainly performs:
We wrap the triangles one by one.
The color change doesn’t require the matrix since the two images are already aligned and can be averaged directly.
After generating the mid-face, we could generate the images, which are wrapped from image1 to image2 slowly with 0.1 steps.
Then, use these 11 images to make a gif.
Next, compute the mean face of a Brazilian population using images and key points given in their data.
Then, warp my face into the average face's geometry and the average face into my face's geometry.
Last, I compute the difference between me and Brazil people, and times 1.5 to amplification the difference.
The caricature image looks like an extra-terrestrial.