|
visageSDK
|
Objective-C wrapper of the native VisageSDK::VisageGazeTracker class. More...
#import <objc_VisageGazeTracker.h>
Inherits NSObject.
Instance Methods | |
| (VisageGazeTracker *) | - initWithConfigFile: |
| Constructor. More... | |
| (void) | - initOnlineGazeCalibration |
| Initializes online screen space gaze tracking. More... | |
| (void) | - addGazeCalibrationPoint:withY: |
| Passes a calibration point to the tracker in online screen space gaze tracking mode. More... | |
| (void) | - finalizeOnlineGazeCalibration |
| Finalizes online screen space gaze tracking calibration. More... | |
| (void) | - initOfflineGazeCalibration: |
| Initializes offline screen space gaze tracking. More... | |
| (float) | - getGazeEstimations: |
| Returns screen space gaze estimation data obtained in offline gaze tracking mode. More... | |
Objective-C wrapper of the native VisageSDK::VisageGazeTracker class.
Definition at line 21 of file objc_VisageGazeTracker.h.
| - (void) addGazeCalibrationPoint: | (float) | x | |
| withY: | (float) | y | |
Passes a calibration point to the tracker in online screen space gaze tracking mode.
This method is used in online gaze tracking mode to pass the position of the currently displayed calibration point to the tracker. This method should be called once for each calibration point, after the calibration point is displayed on the screen. Position of the calibration point is in normalized screen coordinates. The origin of the coordinate system is in the upper left corner of the screen; the lower right corner has coordinates (1, 1).
NOTE: Application is responsible for synchronization between the frequency of passing calibration points to the tracker and the frequency at which the tracker processes video frames. If calibration points are passed faster than the tracker works, it may happen that two (or more) calibration points are passed while the tracker is processing a single video frame. In such case, if the difference in speed is large enough, it is possible that the tracking data for the processed frame does not match to the calibration point. This reduces the quality of calibration and, consequently, estimation.
| x | x coordinate of the calibration point in normalized screen coordinates |
| y | y coordinate of the calibration point in normalized screen coordinates |
| - (void) finalizeOnlineGazeCalibration |
Finalizes online screen space gaze tracking calibration.
This method should be called after all calibration data is displayed and passed to the tracker. After this method is called the tracker performs calibration of gaze tracking system using the provided calibration data and the tracking data collected during the calibration phase.
After the calibration is finished, screen space gaze position is obtained as a part of FaceData object passed to the track() function. The FaceData object contains gaze position stored in ScreenSpaceGazeData object, specifically in FaceData::gazeData.
| - (float) getGazeEstimations: | (ScreenSpaceGazeRepository *) | repository |
Returns screen space gaze estimation data obtained in offline gaze tracking mode.
This function is used for obtaining estimation data in offline mode (in online mode estimation data is a part of the FaceData object passed to the track() function). It returns the repository containing screen space gaze data for each non - calibration frame of processed sequence.
The method returns an empty array if called during tracking.
Note that each time this method is called, the memory for returned ScreenSpaceGazeRepository object is deallocated and reallocated.
| repository | to be filled with screen space gaze data for last tracked sequence |
| - (void) initOfflineGazeCalibration: | (ScreenSpaceGazeRepository *) | calibrator |
Initializes offline screen space gaze tracking.
Offline mode is used when tracking from video file. This method must be called before tracking is started using VisageTracker::track(). Calibration data is passed to the tracker as a ScreenSpaceGazeRepository object containing a number of calibration points, each consisting of the position of the calibration point in normalized screen coordinates and the frame index in which the calibration point was displayed to the user. The data for each calibration point is stored as a ScreenSpaceGazeData object.
During the calibration phase tracker reads calibration points from the provided ScreenSpaceGazeRepository and collects tracking data in corresponding frames of the tracked video sequence. The gaze tracking system is calibrated automatically after all calibration points from the provided repository are used. After the tracking of the whole video sequence is finished, the screen space gaze positions can be obtained by calling GetGazeEstimations() method.
| calibrator | Pointer to ScreenSpaceGazeRepository containing calibration data. |
| - (void) initOnlineGazeCalibration |
Initializes online screen space gaze tracking.
Online mode is used when tracking from camera. This method starts the calibration phase of screen space gaze tracking. In the calibration phase the application displays the calibration data on the screen and passes it to the tracker using AddGazeCalibrationPoint(). Application is responsible for finishing the calibration phase by calling FinalizeOnlineGazeCalibration().
| - (VisageGazeTracker *) initWithConfigFile: | (NSString *) | configFile |
Constructor.
| configFile | the name of the tracker configuration file (.cfg; default configuration files are provided in Samples/data folder. Constructor must be called with the full path to the configuration file. The configuration file is in the same directory as other data files needed by the tracker. Because it is in the same directory its path can be parsed to set the path for the other data files. For further details see VisageTracker Configuration Manualand section on device-specific configuration selection.). |
1.8.15