Eye tracking with Native SDK
USING THE EYE TRACKING DATA
You can acccess the following eye tracking data through the Varjo API:
- leftEye [varjo_ray]
- rightEye [varjo_ray]
- gaze [varjo_ray]
varjo_ray returns data about eye position coordinates [origin (x, y, z)] and vector direction [forward (x, y, z)]. Data is recorded for the left eye (leftEye), right eye (rightEye), and their combined value (gaze). Gaze data is given in the left-hand coordinate system (X points right, Y points top, Z points forward) and relative to head pose.
focusDistance returns the distance between eye and focus point. It has a value between 0 and 2 meters.
stability returns the stability of the user’s focus. It has a value between 0.0 and 1.0, where 0.0 indicates least stable focus and 1.0 most stable.
captureTime captureTime returns a timestamp, in nanoseconds, of when the eyes video frame was recorded.
leftStatus and rightStatus return a value for each eye as follows:
- 0 – eye is not tracked and not visible (e.g., the eye is shut)
- 1 – eye is visible but not reliably tracked (e.g., during a saccade or blink)
- 2 – eye is tracked but quality is compromised (e.g., the headset has moved after calibration)
- 3 – eye is tracked
status returns a value for the status of eye tracking in the Varjo headset as follows:
- 0 – data unavailable; user is not wearing the device or eyes cannot be found
- 1 – user is wearing the device, but gaze tracking is being calibrated
- 2 – data is valid
frameNumber returns a unique identifier of the frame when the data was recorded.
leftPupilSize and rightPupilSize return values for the size of the pupil, calculated according to the pupil size range detected by the Varjo headset. Values are between 0 and 1.
Data Stream Options
When using the Varjo gaze tracking system via public API, you can choose between smoothed (default) and raw gaze tracking output and between 100Hz (default) and 200Hz tracking data rates.
For the default data stream settings, call the
GazeInit function with no arguments.
For custom stream settings, use the
GazeInitWithParameters function with the
GazeParameters argument filled according to your desired data stream mode:
OutputFilterTypeto Standard for smoothed output and None for raw output.
OutputFrequencyMaximumSupported(for the maximum data rate supported by your headset).
There are three types of calibration available in the Varjo gaze tracking system: quick one-dot, Fast and Legacy.
One-dot quick calibration is launched automatically every time the user puts on the headset. After calibration, eye tracking data is immediately available via the API functions
The other two advanced gaze calibration algorithms are available via the
RequestGazeCalibrationWithParameters function. Choose between Fast (default) and Legacy calibration by filling the
GazeCalibrationType parameter appropriately.
Fast calibration is a quick five-point calibration that uses observations from the current user as well as statistical priors generated from diverse, previously collected and processed observations from other people.
Legacy calibration takes longer and only uses observations from the current user to train the eye tracking algorithm. Legacy calibration can be appropriate, for example, in medical research use cases where the use of statistical priors may not be advisable.