17 #ifndef __VisageTracker_h__
18 #define __VisageTracker_h__
21 #define VISAGE_DECLSPEC
25 #define VISAGE_DECLSPEC __declspec(dllexport)
27 #define VISAGE_DECLSPEC __declspec(dllimport)
33 #include "SmoothingFilter.h"
34 #include "VisageConfiguration.h"
46 VISAGE_DECLSPEC
void _loadVisageVision();
52 #include <sys/types.h>
53 #define HANDLE pthread_t*
64 int VISAGE_DECLSPEC initializeLicenseManager(
const char *licenseKeyFileFolder);
73 #define TRACK_STAT_OFF 0
74 #define TRACK_STAT_OK 1
75 #define TRACK_STAT_RECOVERING 2
76 #define TRACK_STAT_INIT 3
78 #define VISAGE_CAMERA_UP 0
79 #define VISAGE_CAMERA_DOWN 1
80 #define VISAGE_CAMERA_LEFT 2
81 #define VISAGE_CAMERA_RIGHT 3
83 #define VISAGE_FRAMEGRABBER_FMT_RGB 0
84 #define VISAGE_FRAMEGRABBER_FMT_BGR 1
85 #define VISAGE_FRAMEGRABBER_FMT_LUMINANCE 2
86 #define VISAGE_FRAMEGRABBER_FMT_RGBA 3
87 #define VISAGE_FRAMEGRABBER_FMT_BGRA 4
89 #define VISAGE_FRAMEGRABBER_ORIGIN_TL 0
90 #define VISAGE_FRAMEGRABBER_ORIGIN_BL 1
92 class VisageTrackerInternal;
94 class TrackerInternalInterface;
95 class TrackerGUIInterface;
334 virtual int* track(
int frameWidth,
int frameHeight,
const char* p_imageData,
FaceData* facedata,
int format = VISAGE_FRAMEGRABBER_FMT_RGB,
int origin = VISAGE_FRAMEGRABBER_ORIGIN_TL,
int widthStep = 0,
long timeStamp = -1,
int maxFaces = 1);
346 void setTrackerConfiguration(
const char* trackerConfigFile,
bool au_fitting_disabled =
false,
bool mesh_fitting_disabled =
false);
362 void setIPD(
float value);
389 const char* getSDKVersion();
412 void setDataBundle(NSBundle *bundle);
417 bool shouldReset(
int resetFlag);
419 static void processEyesClosure(
const VsImage* frame,
FDP* fdp,
float* t,
float* r,
float* out);
420 static void GetPupilCoords(
FDP* points, VsMat* eyes_coords,
int w,
int h);
422 TrackerGUIInterface *guiIface;
423 TrackerInternalInterface *internalIface;
425 float recovery_timeout;
428 friend class VisageTrackerInternal;
434 VsMat *smoothing_factors;
435 unsigned int enable_smoothing;
436 unsigned int temporally_denoise_input;
447 unsigned long initialTime;
448 unsigned long last_times[10];
451 volatile bool active;
457 long getCurrentTimeMs(
bool init);
458 void deNoiseFrameGray();
459 bool grabFrame(
bool init);
461 static void AugmentFDP(
FDP* src,
FDP* dst);
462 static void unProjectStuff(
FDP* fp2D,
FDP* fp3D,
int w,
int h,
float f);
463 static void removeTransform(
FDP* fp3D,
FDP* fp3DR,
const float* r,
const float* t);
464 static void setPose(
float pose[6],
float t[3],
float r[3]);
465 static float getAvgQuality(
const FDP &fdp);
467 bool init_successful;
469 std::string configuration_filename;
472 NSBundle *dataBundle;
475 volatile bool tracking_ok;
476 float trackingFrameRate;
484 void initTrackerInternal();
486 bool loadModel(Candide3Model **model,
int modelType);
490 #if defined(IOS) || defined(ANDROID) || defined(MAC_OS_X) || defined(LINUX)
491 pthread_mutex_t track_mutex;
492 pthread_mutex_t config_mutex;
496 CRITICAL_SECTION track_mutex;
497 CRITICAL_SECTION config_mutex;
500 std::string vfd_data_path;
501 std::string vft_data_path;
502 std::string pr_data_path;
503 std::string er_data_path;
505 public: VisageDetector* m_DetectorBDFS;
508 VisageDetector* m_DetectorBDFS;
512 Candide3Model* model;
514 Candide3Model* au_model;
516 Candide3Model* mesh_model;
518 bool use_single_model;
523 bool au_fitting_disable;
524 bool mesh_fitting_disable;
532 char m_trackCfgDataPath[1024];
538 VisageTrackerInternal **tracker;
543 #endif // __VisageTracker_h__
VisageTracker is a face tracker capable of tracking the head pose, facial features and gaze for multi...
Faces and facial features detector implementation.
VisageConfiguration is a class used to change, apply, load and save configuration parameters used by ...
const VISAGE_DECLSPEC char * getVisageSDKVersion(void)
Returns visageSDK version and revision number.
Face data structure, used as container for all face tracking and detection results.
Feature points of a face.