The purpose of this project was to create morphing sequences between faces. I morphed my face into my roommate's face, the average Brazilian female's face, and my face in various emotions.
Using matplotlib's ginput, I collected points to serve as the control points or vertices of triangles defining the shape of the image. I then used scipy's Delaunay triangulation function.
Now that I have triangulated both faces, for each pair of triangles between the two images, I calculated the affine transformation from the first triangle vertices to the others by transforming and changing the basis from each triangle to the mean triangle. Next, I set the image at the mean triangle shape to be the pixels of the mean of the transformed triangles.
|
|
|
Using the same algorithm as above except with some t ranging between 0 and 1 instead of strictly 0.5, I created a morph sequence from my roommate's face to my face.
Video LinkI grabbed out all female faces from the provided Brazilian dataset. I then computed the average face by using the same technique with the mid-way face except this time with all female faces instead of just two images.
|
I extrapolated my face to the average face by about 0.3 so that it is still distinctly my face but a slight twist.
|
|
|
I morphed myself into four different emotions
Morph from happy to neutral to annoyed to frustrated