This addon for openFrameworks is implementing the face detection and face landmark detection algorithm from dlib. The structure of addon is heavily inspired by ofxFaceTracker, but does have some significant changes, so its not directly compatible with it.
- Face detection - supports multiple faces. This runs by default on a background thread.
- Face landmark detection - runs very fast, and can easily run on high resolution video in realtime. Returns a list of 68 points describing different parts of the face.
- Pose estimation - estimate the 3d position and orientation of the head. Allows you to draw easily in a 3d space relative to the heads position and orientation, and to easily estimate the direction a head is facing.
Currently ofxFaceTracker2 is build and tested on OSX and Android, but DLIB is crossplatform, and should be possible to build for all other major platforms. The current builds are done with Apothecary
Comparison to ofxFaceTracker
The algorithms doing the tracking are very different in the two addons. In the old ofxFaceTracker addon based on Jason Saragih's FaceTracker library, the face detection and landmark detection happended in the same algorithm.
In ofxFaceTracker2, the two stages happens seperately. The face detection is considerably slower then previously, but can easily run on a background thread, on the other hand is the landmark detection (so finding the actualy details in the face), faster and more robust. Running in multithreaded mode (default mode) will give you a better performance with this addon, and better accuracy.
Another big difference is this addon supports multiple faces, whereas the old addon only supports one face at the time.
- The addon depends on ofxCv addon.
- All apps needs a landsmarks training data file. It can be downloaded here shape_predictor_68_face_landmarks.dat, and should be put unzipped in
bin/data
folder of your app or examples.