0

Is there a way to store and view eye tracking data like the size of the users pupils or the eye motion speed?

I am currently building a hololens 2 application in unity using MRTK. Now I would like to "record", store and view eye tracking data of the user.

Ruzihm
  • 19,749
  • 5
  • 36
  • 48
  • [Available Eye tracking data](https://learn.microsoft.com/windows/mixed-reality/design/eye-tracking#available-eye-tracking-data) -> No. The only available information is the eye gaze ray (source point + direction) for each eye -> yes you can compare the given rays to the previous sample in order to calculate the "speed" .... in general though: Usually eyes don't "move" too much ^^ mine are more rotating ;) – derHugo Dec 02 '21 at 16:56

2 Answers2

0

I don't believe you can get pupil diameter but it looks like you could estimate angular speed by measuring the change in gaze direction between frames:

Vector3 previousGazeDir;

// ...

Vector3 newGazeDir = CoreServices.InputSystem.EyeGazeProvider.GazeDirection;

if (previousGazeDir != Vector3.zero)
{
    float gazeAngle = Vector3.Angle(previousGazeDir, newGazeDir);

    float gazeAngularVelocity = gazeAngle/Time.deltaTime;

    // .. do stuff with gazeAngularVelocity
}

previousGazeDir = newGazeDir;

Depending on your exact use case you may want to account for changes in the direction the head is facing.

Ruzihm
  • 19,749
  • 5
  • 36
  • 48
  • This helps a lot, thank you for the short code snippet. I noticed MRTK also offers a script called "BasicInputLogger" that already tracks and saves some eye gaze information. Have you already worked with that script? – Schlauchman Dec 02 '21 at 17:44
  • No, haven't actually worked with MRTK at all :D I put this together just from reading the docs :) – Ruzihm Dec 02 '21 at 17:55
0

Hololens 2 does appear to support eye tracking, and also appears to integrate with Unity via the Mixed Reality Toolkit. While I haven't used eye tracking tools for Hololens, I can say by tracking gaze direction frame over frame it is possible to gather "eye motion speed". Pupil size I have not seen in the eye tracking API's I've used, nor do I see it in the documentation linked.

Pretty much anything you can track in code can be "recorded".

NSJacob1
  • 509
  • 3
  • 12
  • Thank you for the quick reply. Sadly I rely on pupil diameter. I want to use that data in order to automatically detect emotions. Looks like I have to find another way like head movement tracking or tone of voice. – Schlauchman Dec 02 '21 at 17:42