Custom Eye-Tracker Calibration
Soon there will be a year when we released the product with Custom ' eye-tracker calibration ' on board. Unfortunately, for various reasons, it still did not work to finish off this article. However, a funny incident has recently occurred that prompted to complete what was started. But first things first. I hope someone will still benefit from our experience, despite the fact that the post turned out to be damp.
In short, Eye-tracker is a device that allows you to track the direction of view, as well as the position of the eyes and head.
At an Eye-tracker 's quite a lot of applications, one of them - is the computer games industry ( a bit more ).
Often, gaze detection is responsible for secondary (auxiliary), but important actions in games:
- camera movement;
- selection of objects for interaction;
- weapon selection;
- automatic pause call upon loss of sight;
In most cases, standard calibration (we will talk about the Tobii Eye Tracker 4C device ) is enough for comfortable use of the Eye Track 'era.
But, unfortunately, for our purposes, the accuracy of the device achieved by standard calibration is not enough, because, in our project, the look is the main control mechanics.
From the foregoing, the task was formed : to improve the standard calibration;
conditions : Tobii Eye Tracker 4C device , development language is C # (WPF) .
It seems to be a solution on the surface: if you want more accuracy - add more calibration points, but it's not so simple.
Tobii AB has quite a lot of tools for working with its devices. Joy knew no bounds when the Tobii Pro SDK was discovered , which has all the buns for working with calibration , but as it turned out later, this SDK is not suitable for working specifically with the eye tracker model'which we have (although it is strange that the device’s gaze detection when using this SDK was still present). I had to take simpler tools - Tobii.EyeX.Client .
Empirically, the optimal number of calibration points and their location were revealed: a 4x3 matrix with 12 calibration points located (each in the center of the cell).
The following parameters were also found empirically:
- time for calibration at one calibration point - 3 seconds;
- the index of the point under consideration is 5 (if the index of the point received from the device is a multiple of this, then we take it into account when calculating the calibration);
- the maximum permissible deviation from the calibration point ( px ) is calculated by the formula:
Where and - width and height of the cell of the calibration matrix, respectively
Calibration Algorithm (Simple to Madness)
Calibration is performed sequentially, for each cell of the calibration matrix:
- if the distance between the current calibration point and the point received from the device is less than the maximum permissible deviation , then such a point (received from the device) falls into the collection for further processing, otherwise - the calibration for the current cell is reset to its original state (and all over again) ;
- after the time for calibration by one calibration point has been exhausted, we obtain the average value of the displacement from the previously collected data.
Upon completion of the calibration, we have a collection of 12 averaged bias values by region (matrix cells).
Use (even easier)
- determine which region the point received from the device falls into;
- We shift the point received from the device by the average value of the offset in this region.
Thus, it was possible to programmatically improve the accuracy of the Tobii Eye Tracker 4C device (by making an add-on over the standard calibration).
Unfortunately, due to the non-disclosure agreement, I can not specify the name of the software, nor lay out the source or screenshots. Fortunately, they allowed to share the algorithm. I hope that someone post will still be useful.
The article provides the simplest description of the main calibration process. In addition, there is a bunch of something else:
- averaging the point value with the previous one (for smoothness);
- checking for overflowing the screen;
- loss of sight tracking;
- tracking changes in the position of the eyes in space;
- Eye Tracker status tracking ;
- tracking changes in screen resolution;
- calibration cancellation tracking;
- random selection of the type of calibration marks;
- and much more.
And here is the very event that contributed to the "completion" of the article: for some inconceivable coincidence, my friend ( from the previous post ) had the chance to chat live with the developer from Tobii AB . During the conversation, the developer mentioned the imperfection of the standard calibration and that our efforts were not in vain.