High-level algorithm:
- Beginning with a triangulation that remains consistent across all images
- However, ensure that the vertices of the triangles are adjusted to fit the unique features of each face
- The morphing effect is created by transitioning from the triangulation of one image to that of the next while simultaneously fading the images of each triangle
Delaunay triangulation:
- It utilizes a professional library for incremental Delaunay triangulation, which I translated into Java from a C++ implementation I found online based on an algorithm developed by researchers in the field.
- Added feature: option to undo the last vertex insertion, allowing users to have a tentative vertex on the fly until they formalize it in the triangulation (demo).
- Added bonus feature: define the initial domain as a rectangle instead of a triangle, which is not trivial, especially considering my background!
- Added function that allows for traversing the triangles in a triangulation using the Visitor design pattern.
Functions that are worth noting:
- Basic algebra: Transformation of the coordinates of a point inside a triangle to the coordinates inside another triangle, knowing the vertices of both triangles.
- Basic mathematics: Use the Visitor design pattern to traverse the pixels in a triangle.
- Option to create the video sequence using multi-threading.
With the release of version v1.1, creating triangulation has become much easier for users by integrating a face detection library powered by AI. Users can access the library via a REST API to a cloud server.
With this library, users can begin with triangulating the 68 detected vertices for each face and continue adding vertices if necessary.