Hi Uril,
Please take a look at the
calibration sample from the
tet-cshap-samples on Github.
To start a calibration in your own project (first include controls dll) then call the CalibrationRunner:
In the example I compiled below you can either wait for the results in the same method, or receive a callback on the ICalibrationResultListener interface when a new calibration occurs.
- Code: Select all
public class MyClass : ICalibrationResultListener
{
public MyClass()
{
GazeManager.Instance.Activate(GazeManager.ApiVersion.VERSION_1_0, GazeManager.ClientMode.Push);
GazeManager.Instance.AddCalibrationStateListener(this);
}
private void Calibrate()
{
//Run the calibration on 'this' monitor
var ActiveScreen = Screen.FromHandle(new WindowInteropHelper(this).Handle);
// Initialize and start the calibration
CalibrationRunner calRunner = new CalibrationRunner(ActiveScreen, ActiveScreen.Bounds.Size, 9);
bool isCalibrated = calRunner.Start();
if (!isCalibrated) return;
// Show overall accuracy (in degrees) of last calibration (wait here for it)
Console.Out.WriteLine(GazeManager.Instance.LastCalibrationResult.AverageErrorDegree);
}
// Interface method (callback)
public void OnCalibrationChanged(bool isCalibrated, CalibrationResult calibResult)
{
Console.Out.WriteLine(calibResult.AverageErrorDegree);
}
}
We're preparing more complete documentation and samples to illustrated key concepts such as calibration, trackbox, cursor redirection, selection etc. Aiming at having it ready by Monday (week from today).