visageSDK
VisageTrackerUnityPlugin.h
Go to the documentation of this file.
1 //
2 // VisageTrackerUnityPlugin.h
3 // VisageTrackerUnityPlugin
4 //
5 //
6 
7 #pragma once
8 
16 #include "VisageTrackerUnityShared.h"
17 
18 extern "C" {
19 
23  void _initializeLicense(char* license);
24 
29  void _grabFrame();
30 
34  void _initTracker(char* configuration, int numFaces);
35 
38  void _releaseTracker();
39 
44  void _track();
45 
48  void _bindTexture(int texID);
49 
53  void _getTrackerStatus(int* tStatus);
54 
58  float _getTrackingQuality(int faceIndex);
59 
63  float _getFrameRate();
64 
68  long _getTimeStamp();
69 
74 
79 
83  void _getGroupSizes(int* groupSize, int length);
84 
88  int _getFaceScale(int faceIndex);
89 
93  void _getFaceBoundingBox(VsRect* rectangle, int faceIndex);
94 
98  void _getHeadTranslation(float* translation, int faceIndex);
99 
103  void _getHeadRotation(float* rotation, int faceIndex);
104 
108  void _getHeadRotationApparent(float* rotationApparent, int faceIndex);
109 
110 
115 
120 
124  void _getFaceModelTriangles(int* triangles, int faceIndex);
125 
129  void _getFaceModelVertices(float* vertices, int faceIndex);
130 
134  void _getFaceModelVerticesProjected(float* verticesProjected, int faceIndex);
135 
139  void _getFaceModelTextureCoords(float* texCoord, int faceIndex);
140 
141 
145  void _get3DData(float* tx, float* ty, float* tz,float* rx, float* ry, float* rz, int faceIndex);
146 
147 
150  void _getCameraInfo(float *focus, int *ImageWidth, int *ImageHeight);
151 
155  bool _getFaceModel(int* vertexNumber, float* vertices, float* verticesProjected, int* triangleNumber, int* triangles, float* texCoord, int faceIndex);
156 
160  void _getTexCoordsStatic(float* buffer, int* texCoordNumber);
161 
165  int _getActionUnitCount();
166 
170  const char* _getActionUnitName(int au_index);
171 
175  bool _getActionUnitUsed(int au_index);
176 
180  void _getActionUnitValues(float* values, int faceIndex);
181 
185  bool _getGazeDirection(float* direction, int faceIndex);
186 
190  bool _getGazeDirectionGlobal(float* direction, int faceIndex);
191 
195  bool _getEyeClosure(float* closure, int faceIndex);
196 
200  bool _getIrisRadius(float* radius, int faceIndex);
201 
205  void _getFeaturePoints2D(int N, int* groups, int* indices, float* positions, int* defined, int* detected, float* quality, int faceIndex);
206 
210  void _getFeaturePoints3D(int N, int* groups, int* indices, float* positions, int* defined, int* detected, float* quality, int faceIndex);
211 
215  void _getFeaturePoints3DRelative(int N, int* groups, int* indices, float* positions, int* defined, int* detected, float* quality, int faceIndex);
216 
220  void _getAllFeaturePoints2D(float* positions, int len, int faceIndex);
221 
225  void _getAllFeaturePoints3D(float* positions, int len, int faceIndex);
226 
230  void _getAllFeaturePoints3DRelative(float* positions, int len, int faceIndex);
231 
235  void _setTrackerConfiguration(const char *trackerConfigFile, bool au_fitting_disabled = false, bool mesh_fitting_disabled = false);
236 
240  void _setIPD(float value);
241 
245  float _getIPD();
246 
250  bool _frameChanged();
251 
252 }
int _getFP_START_GROUP_INDEX()
Returns index of the first FP group.
void _track()
Performs face tracking on current frame.
void _getFeaturePoints2D(int N, int *groups, int *indices, float *positions, int *defined, int *detected, float *quality, int faceIndex)
Returns the feature point positions in normalized 2D screen coordinates, indication of whether the po...
void _getHeadRotationApparent(float *rotationApparent, int faceIndex)
Returns the current apparent head rotation in radians for the given faceIndex.
bool _frameChanged()
Returns true if frame parameters have changed, e.g.
int _getFP_END_GROUP_INDEX()
Returns index of the last FP group.
void _getFaceModelTextureCoords(float *texCoord, int faceIndex)
Returns texture coordinates.
float _getTrackingQuality(int faceIndex)
Estimated tracking quality for the current frame for the given faceIndex.
void _getAllFeaturePoints2D(float *positions, int len, int faceIndex)
Returns feature point position in normalized 2D screen coordinates, indication of whether the point i...
void _initializeLicense(char *license)
Initializes the license.
int _getFaceScale(int faceIndex)
Returns scale in pixels of facial bounding box for the given faceIndex.
bool _getEyeClosure(float *closure, int faceIndex)
Returns eye closure value for the given faceindex.
void _getCameraInfo(float *focus, int *ImageWidth, int *ImageHeight)
Returns camera info.
void _get3DData(float *tx, float *ty, float *tz, float *rx, float *ry, float *rz, int faceIndex)
Returns the current head translation in meters and rotation in radians for the given faceIndex...
long _getTimeStamp()
Returns timestamp of the current video frame, in milliseconds, measured from the moment when tracking...
void _getFeaturePoints3D(int N, int *groups, int *indices, float *positions, int *defined, int *detected, float *quality, int faceIndex)
Returns the global 3D feature point positions, indication of whether the point is defined and detecte...
int _getFaceModelVertexCount()
Returns number of vertices in the 3D face model.
float _getIPD()
Returns the current inter pupillary distance (IPD) setting.
void _getAllFeaturePoints3DRelative(float *positions, int len, int faceIndex)
Returns the relative 3D feature point position, indication of whether the point is defined and detect...
const char * _getActionUnitName(int au_index)
Returns the name of the action unit with the specified index.
int _getActionUnitCount()
Returns the action unit count.
bool _getIrisRadius(float *radius, int faceIndex)
Returns iris radius values for the given faceindex.
void _setTrackerConfiguration(const char *trackerConfigFile, bool au_fitting_disabled=false, bool mesh_fitting_disabled=false)
Sets tracking configuration.
void _getAllFeaturePoints3D(float *positions, int len, int faceIndex)
Returns the global feature point position, indication of whether the point is defined and detected an...
int _getFaceModelTriangleCount()
Returns number of triangles in the 3D face model.
void _getTrackerStatus(int *tStatus)
Returns tracker status.
void _getFaceModelTriangles(int *triangles, int faceIndex)
Returns triangles coordinates.
bool _getGazeDirection(float *direction, int faceIndex)
Returns the gaze direction for the given faceIndex.
void _getFaceModelVertices(float *vertices, int faceIndex)
Returns vertex coordinates.
void _getHeadTranslation(float *translation, int faceIndex)
Returns the current head translation in meters for the given faceIndex.
void _getFeaturePoints3DRelative(int N, int *groups, int *indices, float *positions, int *defined, int *detected, float *quality, int faceIndex)
Returns the relative 3D feature point positions, indication of whether the point is defined and detec...
void _bindTexture(int texID)
Binds a texture with the given native hardware texture id through OpenGL.
void _releaseTracker()
Releases memory allocated by the tracker in the _initTracker function.
void _getGroupSizes(int *groupSize, int length)
Returns size of each FP group.
void _initTracker(char *configuration, int numFaces)
Initialises the tracker with configuration file and a desired number of tracked faces.
void _getActionUnitValues(float *values, int faceIndex)
Returns all action unit values.
bool _getGazeDirectionGlobal(float *direction, int faceIndex)
Returns the global gaze direction for the given faceIndex.
void _setIPD(float value)
Sets the inter pupillary distance.
void _grabFrame()
Grabs current frame from the camera.
void _getFaceBoundingBox(VsRect *rectangle, int faceIndex)
Returns facial bounding box for the given faceIndex.
void _getHeadRotation(float *rotation, int faceIndex)
Returns the current head rotation in radians for the given faceIndex.
float _getFrameRate()
Returns the frame rate of the tracker, in frames per second, measured over last 10 frames...
bool _getActionUnitUsed(int au_index)
Returns true if the action unit is used.
void _getFaceModelVerticesProjected(float *verticesProjected, int faceIndex)
Returns projected (image space) vertex coordinates.
bool _getFaceModel(int *vertexNumber, float *vertices, float *verticesProjected, int *triangleNumber, int *triangles, float *texCoord, int faceIndex)
Returns data needed to draw 3D face model for the given faceIndex.
void _getTexCoordsStatic(float *buffer, int *texCoordNumber)
Returns static texture coordinates of the mesh.