SLProject
4.2.000
A platform independent 3D computer graphics framework for desktop OS, Android, iOS and online in web browsers
|
OpenCV face & facial landmark tracker class derived from CVTracked. More...
#include <CVTrackedFaces.h>
Public Member Functions | |
CVTrackedFaces (string faceClassifierFilename, string faceMarkModelFilename, int smoothLength=5) | |
Constructor for the facial landmark tracker. More... | |
~CVTrackedFaces () | |
bool | track (CVMat imageGray, CVMat imageBgr, CVCalibration *calib) final |
Tracks the a face and its landmarks. More... | |
Public Member Functions inherited from CVTracked | |
CVTracked () | |
virtual | ~CVTracked ()=default |
void | drawDetection (bool draw) |
bool | isVisible () |
bool | drawDetection () |
CVMatx44f | objectViewMat () |
Static Public Member Functions | |
static void | delaunayTriangulate (CVMat imageBgr, const CVVPoint2f &points, bool drawDetection) |
Static Public Member Functions inherited from CVTracked | |
static cv::Matx44f | createGLMatrix (const CVMat &tVec, const CVMat &rVec) |
Create an OpenGL 4x4 matrix from an OpenCV translation & rotation vector. More... | |
static void | createRvecTvec (const CVMatx44f &glMat, CVMat &tVec, CVMat &rVec) |
Creates the OpenCV rvec & tvec vectors from an column major OpenGL 4x4 matrix. More... | |
static CVMatx44f | calcObjectMatrix (const CVMatx44f &cameraObjectMat, const CVMatx44f &objectViewMat) |
static CVVec3f | averageVector (vector< CVVec3f > vectors, vector< float > weights) |
static SLQuat4f | averageQuaternion (vector< SLQuat4f > quaternions, vector< float > weights) |
static void | resetTimes () |
Resets all static variables. More... | |
Private Attributes | |
CVCascadeClassifier * | _faceDetector |
Viola-Jones face detector. More... | |
cv::Ptr< CVFacemark > | _facemark |
Facial landmarks detector smart pointer. More... | |
vector< AvgCVVec2f > | _avgPosePoints2D |
vector of averaged facial landmark 2D points More... | |
CVRect | _boundingRect |
Bounding rectangle around landmarks. More... | |
CVVPoint2f | _cvPosePoints2D |
vector of OpenCV point2D More... | |
CVVPoint3f | _cvPosePoints3D |
vector of OpenCV point2D More... | |
int | _smoothLength |
Smoothing filter lenght. More... | |
Additional Inherited Members | |
Static Public Attributes inherited from CVTracked | |
static AvgFloat | trackingTimesMS |
Averaged time for video tracking in ms. More... | |
static AvgFloat | detectTimesMS |
Averaged time for video feature detection & description in ms. More... | |
static AvgFloat | detect1TimesMS |
Averaged time for video feature detection subpart 1 in ms. More... | |
static AvgFloat | detect2TimesMS |
Averaged time for video feature detection subpart 2 in ms. More... | |
static AvgFloat | matchTimesMS |
Averaged time for video feature matching in ms. More... | |
static AvgFloat | optFlowTimesMS |
Averaged time for video feature optical flow tracking in ms. More... | |
static AvgFloat | poseTimesMS |
Averaged time for video feature pose estimation in ms. More... | |
Protected Attributes inherited from CVTracked | |
bool | _isVisible |
Flag if marker is visible. More... | |
bool | _drawDetection |
Flag if detection should be drawn into image. More... | |
CVMatx44f | _objectViewMat |
view transformation matrix More... | |
HighResTimer | _timer |
High resolution timer. More... | |
OpenCV face & facial landmark tracker class derived from CVTracked.
Tracking class for face and facial landmark tracking. The class uses the OpenCV face detection algorithm from Viola-Jones to find all faces in the image and the facial landmark detector provided in cv::facemark. For more details see the comments in CVTrackedFaces::track method.
Definition at line 34 of file CVTrackedFaces.h.
|
explicit |
Constructor for the facial landmark tracker.
The Constructor loads the training files for the face and the facial landmarks. It also defines an averaged set of facial landmark points in 3D used for pose estimation.
faceClassifierFilename | Name of the cascaded face training file |
faceMarkModelFilename | Name of the facial landmark training file |
smoothLength | Length of averaging filter |
Definition at line 31 of file CVTrackedFaces.cpp.
CVTrackedFaces::~CVTrackedFaces | ( | ) |
Definition at line 81 of file CVTrackedFaces.cpp.
|
static |
Returns the Delaunay triangulation on the points within the image
imageBgr | OpenCV BGR image |
points | 2D points as OpenCV vector of points 2D |
drawDetection | Flag if detection should be drawn |
Definition at line 241 of file CVTrackedFaces.cpp.
|
finalvirtual |
Tracks the a face and its landmarks.
Implements CVTracked.
Definition at line 100 of file CVTrackedFaces.cpp.
|
private |
vector of averaged facial landmark 2D points
Definition at line 53 of file CVTrackedFaces.h.
|
private |
Bounding rectangle around landmarks.
Definition at line 54 of file CVTrackedFaces.h.
|
private |
vector of OpenCV point2D
Definition at line 55 of file CVTrackedFaces.h.
|
private |
vector of OpenCV point2D
Definition at line 56 of file CVTrackedFaces.h.
|
private |
Viola-Jones face detector.
Definition at line 51 of file CVTrackedFaces.h.
|
private |
Facial landmarks detector smart pointer.
Definition at line 52 of file CVTrackedFaces.h.
|
private |
Smoothing filter lenght.
Definition at line 57 of file CVTrackedFaces.h.