visageSDK
FaceData.h
1 //
3 // (c) Visage Technologies AB 2002 - 2023 All rights reserved.
4 //
5 // This file is part of visage|SDK(tm).
6 // Unauthorized copying of this file, via any medium is strictly prohibited.
7 //
8 // No warranty, explicit or implicit, provided.
9 //
10 // This is proprietary software. No part of this software may be used or
11 // reproduced in any form or by any means otherwise than in accordance with
12 // any written license granted by Visage Technologies AB.
13 //
15 
16 #ifndef __FaceData_h__
17 #define __FaceData_h__
18 
19 #ifdef VISAGE_STATIC
20  #define VISAGE_DECLSPEC
21 #else
22 
23  #ifdef VISAGE_EXPORTS
24  #define VISAGE_DECLSPEC __declspec(dllexport)
25  #else
26  #define VISAGE_DECLSPEC __declspec(dllimport)
27  #endif
28 
29 #endif
30 
31 #include "vs_main.h"
32 #include "FDP.h"
33 #include "TrackerGazeCalibrator.h"
34 
35 namespace VisageSDK
36 {
259 struct VISAGE_DECLSPEC FaceData
260 {
261  //data while tracking
262 
263  /* Estimated probability of wearing a protective face mask.
264  * <i>This variable is set only while tracker is tracking (TRACK_STAT_OK) or if the detector has detected a face.</i>
265  *
266  * The probability is a value between 0.0 and 1.0.
267  */
268  float hasMask;
269 
276 
277  float trackingQualityBdts;
278 
282  float frameRate;
283 
291  long timeStamp;
292 
293  // translation and rotation data
294 
320  float faceTranslation[3];
321 
322  /* Translation of the head, compensated.
323  * <i>This variable is set only while tracker is tracking (TRACK_STAT_OK).</i>
324  *
325  * Translation is expressed with three coordinates x, y, z.
326  * The coordinate system is such that when looking towards the camera, the direction of x is to the
327  * left, y iz up, and z points towards the viewer. The global origin (0,0,0) is placed at the camera.
328  *
329  * Translation of the head relative to its position in the first video frame.
330  * This is compensated translation estimated by the tracker.
331  * Compensated translation values take into account the fact that the tracker
332  * uses a relatively flat face model for tracking, so the center of rotation of this model
333  * is in the front area of the head, while the anatomical center
334  * of rotation is behind, in the base of the neck. Therefore, when the rotation
335  * is applied to a 3D head model with anatomically correct center of rotation, the
336  * face naturally translates as well. When this translation is compounded with
337  * the translation values obtained from the tracker, the total resulting translation
338  * is exaggerated. To avoid this exaggerated translation of the animated head,
339  * the translation can be compensated. The compensation algorithm
340  * estimates how much the translation would be exaggerated, and makes it that much
341  * smaller. The compensated translation can directly be applied to animated head
342  * models that use the neck base as the center of rotation, and is expected to give
343  * better results than the uncompensated translation.
344  *
345  * @see faceTranslation, faceRotation
346  */
347  float faceTranslationCompensated[3];
348 
369  float faceRotation[3];
370 
386  float faceRotationApparent[3];
387 
398  float gazeDirection[2];
399 
434  float gazeDirectionGlobal[3];
435 
442  float eyeClosure[2];
443 
450  float irisRadius[2];
451 
452  // shape units data
461 
474  float *shapeUnits;
475 
476  // action units data
486 
497 
510  float *actionUnits;
511 
520  const char **actionUnitsNames;
521 
522  // feature points data
572 
619 
661 
662  // face model mesh data
669 
690 
701 
708 
717 
727 
737 
740 
746 
763  float cameraFocus;
764 
765  bool isDataInitialized; // true if tracking data is initialized, false otherwise
766 
767  // data range, currently unused
768  int* dataRange;
769 
778 
783  float gazeQuality;
784 
785  //float screenSpaceGazeQuality[2];
786 
787  FaceData();
788  FaceData(const FaceData& faceData);
789  ~FaceData();
790 
791  FaceData& operator=(FaceData faceData);
792  void reinit();
793 
794 private:
795  void swap(FaceData& first, FaceData& second);
796 };
797 }
798 
799 #endif
VisageSDK::FaceData::timeStamp
long timeStamp
Timestamp of the current video frame.
Definition: FaceData.h:291
VisageSDK::FaceData::shapeUnits
float * shapeUnits
List of current values for facial Shape Units, one value for each shape unit.
Definition: FaceData.h:474
VisageSDK::FaceData::featurePoints3DRelative
FDP * featurePoints3DRelative
Facial feature points (3D coordinates relative to the face origin, placed at the center between eyes)...
Definition: FaceData.h:618
VisageSDK
Definition: linux_header.h:1
VisageSDK::FaceData::actionUnits
float * actionUnits
List of current values for facial Action Units, one value for each Action Unit.
Definition: FaceData.h:510
VisageSDK::FaceData::faceModelTriangleCount
int faceModelTriangleCount
Number of triangles in the 3D face model.
Definition: FaceData.h:707
VisageSDK::FaceData::actionUnitsNames
const char ** actionUnitsNames
List of facial Action Units names.
Definition: FaceData.h:520
VisageSDK::FaceData::trackingQuality
float trackingQuality
Tracking quality level.
Definition: FaceData.h:275
VisageSDK::FaceData::faceModelVerticesProjected
float * faceModelVerticesProjected
List of projected (image space) vertex coordinates of the 3D face model.
Definition: FaceData.h:700
VisageSDK::FaceData::actionUnitCount
int actionUnitCount
Number of facial Action Units.
Definition: FaceData.h:485
VisageSDK::FaceData::actionUnitsUsed
int * actionUnitsUsed
Used facial Action Units.
Definition: FaceData.h:496
VisageSDK::FaceData::faceModelVertices
float * faceModelVertices
List of vertex coordinates of the 3D face model.
Definition: FaceData.h:689
VisageSDK::FaceData::faceModelVertexCount
int faceModelVertexCount
Number of vertices in the 3D face model.
Definition: FaceData.h:668
VisageSDK::FaceData::gazeData
ScreenSpaceGazeData gazeData
Structure holding screen space gaze position and quality for current frame.
Definition: FaceData.h:777
VisageSDK::FaceData::faceScale
int faceScale
Scale of facial bounding box expressed in pixels.
Definition: FaceData.h:739
VisageSDK::FDP
Feature points of a face.
Definition: FDP.h:191
VisageSDK::FaceData::cameraFocus
float cameraFocus
Focal distance of the camera, as configured in the tracker/detector configuration file.
Definition: FaceData.h:763
VisageSDK::FaceData::frameRate
float frameRate
The frame rate of the tracker, in frames per second, measured over last 10 frames.
Definition: FaceData.h:282
VisageSDK::FaceData::featurePoints3D
FDP * featurePoints3D
Facial feature points (global 3D coordinates).
Definition: FaceData.h:571
VisageSDK::FaceData::shapeUnitCount
int shapeUnitCount
Number of facial Shape Units.
Definition: FaceData.h:460
VisageSDK::FaceData::faceModelTextureCoords
float * faceModelTextureCoords
Texture coordinates for the 3D face model.
Definition: FaceData.h:726
VisageSDK::FaceData::featurePoints2D
FDP * featurePoints2D
Facial feature points (2D coordinates).
Definition: FaceData.h:660
VisageSDK::FaceData::gazeQuality
float gazeQuality
The session level gaze tracking quality in online mode.
Definition: FaceData.h:783
VisageSDK::ScreenSpaceGazeData
ScreenSpaceGazeData is a container structure used to hold the gaze point location,...
Definition: TrackerGazeCalibrator.h:180
VisageSDK::FaceData::faceModelTextureCoordsStatic
float * faceModelTextureCoordsStatic
Static texture coordinates of the mesh from the configuration file parameter mesh_fitting_model.
Definition: FaceData.h:736
VisageSDK::FaceData::faceBoundingBox
VsRect faceBoundingBox
Face bounding box.
Definition: FaceData.h:745
VisageSDK::FaceData::faceModelTriangles
int * faceModelTriangles
Triangles list for the 3D face model.
Definition: FaceData.h:716
VisageSDK::FaceData
Face data structure, used as container for all face tracking and detection results.
Definition: FaceData.h:259