CS 184 Final Milestone Report

Face Morphing

Daiwei Liu, Provi Zhang



Summary of Progress

In the past week we successfully implemented algorithm for Delaunay Triangulation, Image Interpolation, and Alpha Blending. Our executable now is capable of generating a blended image of morphing two images of faces, given that the two photos are shot in a controlled environment (lighting, pose, size).

Implementation Walkthrough

With the help of dlib, we first implemented facial feature detection, which marks out dominant points that outlines one's face using machine learned data. To make it better, we manually added 15 points. Thereafter, we perform Delaunay Triangulation on these points to triangulate the two images. Note that for the convenience of later use, we first acquire the triangles of one image in the form of indices, then map them to acquire that of the other image, so each index will map to the corresponding triangles of two images. For each point, we perform linear interpolation between two images to generate control points. After we have the triangles and points, we calculate the affine transformation needed for one triangle to become the shape of its corresponding one to warp each of them. Finally, we perfrom alpha blending on each warped triangle to produce the result image.

Preliminary Results

Dzeko
Messi
Ribery

Reflection

We can see some transparent residue from each original image in the final result. That is a drawback of the alpha blending algorithm. To help reduce them in the future, we are still considering improvements or alternatives for the alpha blending algorithm.

The machine learned library still can underperform on many images, and can only produce a few points. We calculated and added 15 more feature points to help triangulation. And there's still space for improvement. In the future, we can implement manual adding feature to let user add points by point and click.

Other

Presentation Slides
Milestone Video:

For project idea and description please see project proposal.