Linear eye calibrator

Christopher Stawarz's Avatar

Christopher Stawarz

22 Apr, 2021 02:48 PM

Hi Yasmine,

Following up on your questions about MWorks' linear eye calibrator:

For each eye coordinate (horizontal and vertical), the calibrator fits three parameters: a constant offset, and two gain factors, one for the coordinate itself, one for the other coordinate. In equation form, the conversion from raw to calibrated coordinates looks like this:

h_cal = offset_h + gain_hh * h_raw + gain_hv * v_raw
v_cal = offset_v + gain_vh * h_raw + gain_vv * v_raw

The "mixing factors" (gain_hv and gain_vh) account for contributions to one coordinate from the other coordinate. Obviously, if the horizontal and vertical positions are independent (as you'd expect for digital data from an EyeLink), then those factors should always be close to zero.

MWorks stores the calibrator parameters in an automatically-generated system variable named #privateCalibrator<calibrator_name>, where <calibrator_name> is the name you gave the calibrator in your experiment. For example, if your experiment declares the calibrator like this:

linear_eye_calibrator my_calibrator (...)

then its parameters will be stored in a variable named #privateCalibratormy_calibrator.

You can extract the calibrator's parameters from its associated variable, either online via MWClient's variables window, or offline from your event file. The value is a dictionary (or a struct in MATLAB) with keys params_H and params_V. The value associated with each key is a three-element list, where the elements are floating-point values representing the offset, horizontal gain, and vertical gain, respectively, for the given coordinate. If the calibrator is reset to its default parameters, then the variable's value will be

    "params_H": [0, 1, 0],
    "params_V": [0, 0, 1]

That is, the "self" gains (gain_hh and gain_vv) are one, and the other parameters are zero. In other words, the default parameters are just an identity transformation.

If you have other questions, please let me know!


  1. Support Staff 1 Posted by Christopher Sta... on 22 Apr, 2021 02:54 PM

    Christopher Stawarz's Avatar

    I forgot to mention that only the offsets and "self" gains are exposed via MWClient's eye calibrator window. The "mixing" gains are not displayed and cannot be changed via that interface. Also, updating or resetting parameters via the calibrator window will cause the "mixing" gains to be set to zero.


  2. Christopher Stawarz closed this discussion on 25 May, 2021 04:20 PM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts


? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac