HMDBasedCalibration

Provides methods and properties for managing calibrations for HMD based eye trackers.

calib = HMDBasedCalibration(tracker)

Contents

Enter Calibration Mode

Enters the Calibration Mode and the Eye Tracker is made ready for collecting data and calculating new calibrations.

calib.enter_calibration_mode()

Leave Calibration Mode

Leaves the Calibration Mode.

calib.leave_calibration_mode()

Collect Data

Starts collecting data for a calibration point. The argument used is the point the calibration user is assumed to be looking at and is given in the HMD coordinate system. Parameters: coordinates (x, y, x) of the calibration point.

calib.collect_data(coordinates)

Compute and Apply Calibration

Uses the collected data and tries to compute calibration parameters. If the calculation is successful, the result is applied to the eye tracker. If there is insufficient data to compute a new calibration or if the collected data is not good enough then calibration is failed and will not be applied.

Returns: an instance of the class HMDCalibrationResult

calib.compute_and_apply()

Code Example

%% HMD Calibration Sample
Tobii = EyeTrackingOperations();

eyetracker_address = 'Address of the desired device';
% Example:
% eyetracker_address = 'tobii-ttp://VRG02-010107022072';

eyetracker = Tobii.get_eyetracker(eyetracker_address);

calib = HMDBasedCalibration(eyetracker);

calib.enter_calibration_mode()

points_to_collect = [[0,0,100];[0,20,100];[20,0,100]];

% When collecting data a point should be presented on the HMD in the
% appropriate position.
for i=1:size(points_to_collect,1)
    collect_result = calib.collect_data(points_to_collect(i,:));
    fprintf('Point [%.2f,%.2f,%2f] Collect Result: %s\n',points_to_collect(i,:),char(collect_result));
end

calibration_result = calib.compute_and_apply();
fprintf('Calibration Status: %s\n',char(calibration_result.Status));

if calibration_result.Status == CalibrationStatus.Success
        % Add when we have a calibration result.
end

calib.leave_calibration_mode()

See Also

Eyetracker, HMDCalibrationResult, CalibrationStatus

Version

1.1.0.23

Copyright 2017 Tobii Pro