Face Morphing and Warpinng

Published in National Chung Cheng University, 2020

Swapping face gradually using image morphing and warping technique.

This project is the final work of the “Introduction to Multimedia Technology” class in the junior year. In order to avoid ghost effect when overlapping different faces, we need to make proper deformations. I will record a video with my head moving up and down, left and right, and another classmate will also. In the pre-processing part of the data, I want to cut the overlapping part of the two videos into a frame. And mark the same number of feature points on the faces of two people in each frame. Then write a program to form all the feature points into equal triangles. I use the triangles to affine the triangles. Because the superposition is to transform my face into the face of another classmate, the feature points interpolated by the affine transformation change over time. The points interpolated in the first few frames that are superimposed will be closer to my triangle, and the points interpolated in the later frames will be more biased towards the triangle of another classmate. Each triangle piece will form a transformation matrix, and the points on the same triangle piece will go through the transformation matrix to the interpolated point, and the colors of the two faces will be superimposed. The color and the feature points are superimposed and change over time. Finally, these generated superimposed frames can be combined into a video.

Here is the code:

Here is the demo video: