|
visageSDK
|
VisageTracker is a face tracker capable of tracking the head pose, facial features and gaze for multiple faces in video coming from a video file, camera or other sources. More...
Public Member Functions | |
| VisageTracker (String trackerConfigFile) | |
| Initializes tracker with specified configuration file. More... | |
| int[] | Track (int frameWidth, int frameHeight, Byte[] imageData, FaceData[] faceData, int format=VISAGE_FORMAT.RGB, int origin=VISAGE_ORIGIN.TL, int widthStep=0, long timeStamp=-1, int maxFaces=-1) |
| Performs face tracking (one or more faces) in the given image and returns tracking results and status. More... | |
| void | SetTrackerConfiguration (String trackerConfigFile, bool au_fitting_disabled=false, bool mesh_fitting_disabled=false) |
| Set configuration file name. More... | |
| void | SetTrackerConfiguration (VisageConfiguration configuration) |
| Apply a new Tracker configuration. More... | |
| VisageConfiguration VisageConfiguration | GetTrackerConfiguration () |
| Obtain a copy of the active Tracker configuration. More... | |
| void | Stop () |
| void | Reset () |
| Reset tracking. More... | |
VisageTracker is a face tracker capable of tracking the head pose, facial features and gaze for multiple faces in video coming from a video file, camera or other sources.
Frames (images) need to be passed sequentially to the VisageTracker::Track method, which immediately returns results for the given frame.
The tracker offers the following outputs as a part of FaceData object:
The tracker requires a set of data and configuration files, available in Samples/data folder. For the list of required data files please consult VisageTracker() constructor description or simply copy the complete contents of this folder into your application's working folder.
The tracker is fully configurable through comprehensive tracker configuration files and VisageConfiguration class allowing to customize the tracker in terms of performance, quality and other options. The configuration files are intended to be used for tracker initialization while the VisageConfiguration class allows the specific configuration parameter to change in runtime.
visage|SDK contains optimal configurations for common uses such as head tracking, facial features tracking and ears tracking.
TheVisageTracker Configuration Manual (later in text referred to as VTCM) provides the list of available configurations and full detail on all available configuration options.
Specific configuration parameters are used to enable features such as:
Ear tracking includes tracking of additional 24 points (12 points per ear). Detailed illustration of the points' location can be found in the description of the FaceData::FeaturePoints2D member. Ears' feature points are part of the group 10 (10.1 - 10.24). Tracking the ears' points require the 3D model with defined ears vertices, as well as corresponding points mapping file that includes definition for group 10. visage|SDK containes examples of such model files within Samples/data/vft/fm folder: jk_300_wEars.wfm and jk_300_wEars.fdp.
For the list of model's vertices and triangles see chapter 2.3.2.1 The jk_300_wEars of VTCM.
A set of three configuration parameters is used to configure ear tracking:
visage|SDK provides optimal configuration for ear tracking. Please consult Facial Features Tracker - With Ears.cfg configuration file, located in Samples/data, for more details on the set configuration values.
Pupil refinement improves the precision of pupil center-point detection and provides iris radius information.
See process_eyes in chapter 2.1. Configuration parameters of VTCM.
Landmarks refinement improves tracking accuracy and robustness and minimizes tracking jitter at the cost of reduced tracking speed (performance).
refine_landmarks configuration parameter is used to configure the tracking accuracy. See refine_landmarks in chapter 2.1. Configuration parameters of VTCM.
The tracker can apply a smoothing filter to tracking results to reduce the inevitable tracking noise. Smoothing factors are adjusted separately for different parts of the face. The smoothing settings in the supplied tracker configurations are adjusted conservatively to achieve optimal balance between smoothing and delay in tracking response for a general use case.
See smoothing_factors in chapter 2.1. Configuration parameters of VTCM.
Tracking features are determined by their own set of data files contained within Samples/data folder. In addition to the set values of the configuration parameters, it is also necessary to ensure that the data of each feature is available. Default configuration files set the path to 3D models and data files within Samples/data folder as follows:
| TRACKING ALGORITHM DATA FILES |
ff/ ff.vino.* fa/ d1qy.vino.* aux_file.bin fm/ *.fdp *.wfm |
The list of tracking features available to use:
| TRACKER FEATURES | REQUIRED DATA FILES |
| Ear tracking | er/ efa.lbf efc.lbf |
| Pupil refinement | pr/ pr.vino.* |
| Landmarks refinement | fa d2.vino.* |
NOTE: .fdp and .wfm files correspond to the 3D model (configuration parameters *_fitting_model, *_fitting_fdp).
For further details on 3D models used in tracking and configuration parameters see VisageTracker Configuration Manual.
Definition at line 185 of file VisageTracker.cs.
| VisageCSWrapper.VisageTracker.VisageTracker | ( | String | trackerConfigFile | ) |
Initializes tracker with specified configuration file.
Configuration file is used to modify tracker behavior and set paths to the required data files. Default configuration files are provided in the Samples/data folder.
| trackerConfigFile | The name of the tracker configuration file (.cfg), relative to the current working directory, e.g. "Samples\data\Facial Features Tracker.cfg", considering visageSDK as a working directory. |
| VisageConfiguration VisageConfiguration VisageCSWrapper.VisageTracker.GetTrackerConfiguration | ( | ) |
Obtain a copy of the active Tracker configuration.
| void VisageCSWrapper.VisageTracker.Reset | ( | ) |
Reset tracking.
Resets the tracker. Tracker will reinitialise.
| void VisageCSWrapper.VisageTracker.SetTrackerConfiguration | ( | String | trackerConfigFile, |
| bool | au_fitting_disabled = false, |
||
| bool | mesh_fitting_disabled = false |
||
| ) |
Set configuration file name.
The tracker configuration file name is set and this configuration file will be used for next tracking session (i.e. track() is called). Default configuration files (.cfg) are provided in Samples/data folder. Please refer to the VisageTracker Configuration Manual for further details on using the configuration files and all configurable options.
| trackerConfigFile | The name of the tracker configuration file. |
| au_fitting_disabled | Disables the use of the 3D model used to estimate action units (au_fitting_model configuration parameter). If set to true, estimation of Action Units shall not be performed, and Action Units released data in the returned FaceData structure will not be available (FaceData::ActionUnits etc.). Disabling will result in a small performance gain. |
| mesh_fitting_disabled | Disables the use of the fine 3D mesh (mesh_fitting_model configuration parameter). If set to true, the 3D mesh shall not be fitted and the related information shall not be available in the returned FaceData structure (FaceData::FaceModelVertices etc.). Disabling will result in small performance gain. |
| void VisageCSWrapper.VisageTracker.SetTrackerConfiguration | ( | VisageConfiguration | configuration | ) |
Apply a new Tracker configuration.
The tracker configuration object is set and this configuration will be used for next tracking session (i.e. track() is called).
| configuration | The VisageConfiguration object to apply. |
| void VisageCSWrapper.VisageTracker.Stop | ( | ) |
| int [] VisageCSWrapper.VisageTracker.Track | ( | int | frameWidth, |
| int | frameHeight, | ||
| Byte[] | imageData, | ||
| FaceData[] | faceData, | ||
| int | format = VISAGE_FORMAT.RGB, |
||
| int | origin = VISAGE_ORIGIN.TL, |
||
| int | widthStep = 0, |
||
| long | timeStamp = -1, |
||
| int | maxFaces = -1 |
||
| ) |
Performs face tracking (one or more faces) in the given image and returns tracking results and status.
This function should be called repeatedly on a series of images in order to perform continuous tracking.
If the tracker needs to be initialized, this will be done automatically before tracking is performed on the given image. Initialization means loading the tracker configuration file, required data files and allocating various data buffers to the given image size. This operation may take several seconds. This happens in the following cases:
The tracker results are returned in an array of FaceData objects, one FaceData object for each tracked face. Contents of each FaceData element depend on the corresponding tracker status (tracker statuses are returned as return value from the function).
The tracking of multiple faces is performed in parallel ( using OpenMP) and performance (speed) may vary depending on the number of CPU cores, the number of faces in the current image and the value of maxFaces argument.
| frameWidth | Width of the frame. |
| frameHeight | Height of the frame. |
| imageData | Pointer to image pixel data; size of the array must correspond to frameWidth and frameHeight. |
| faceData | FaceData instance that will receive the tracking results. No tracking results will be returned if NULL pointer is passed. On first call of this function, the memory for the required member variables of the passed FaceData object will be allocated and initialized automatically. |
| format | Format of input images passed in imageData. It can not change during tracking. Format can be one of the following:
|
| origin | No longer used, therefore, passed value will not have an effect on this function. However, the parameter is left to avoid API changes. |
| widthStep | Width of the image data buffer, in bytes. |
| timeStamp | The timestamp of the the input frame in milliseconds. The passed value will be returned with the tracking data for that frame (FaceData.timeStamp). Alternatively, the value of -1 can be passed, in which case the tracker will return time, in milliseconds, measured from the moment when tracking started. |
| maxFaces | The maximum number of faces that will be tracked (tracker currently supports up to 20 faces). |
1.8.10