Home Forums Software Development Blink detection Reply To: Blink detection

#1870
Robert [Tobii]
Participant

Hi Dwayne,

The Eye Position data stream should fire events also when both eyes are open. I wrote a little test app for that, based on the MinimalGazeDataStream.

namespace MinimalEyePositionStream
{
    using EyeXFramework;
    using System;

    public static class Program
    {
        public static void Main(string[] args)
        {
            using (var eyeXHost = new EyeXHost())
            {
                eyeXHost.Start();

                using (var eyePositionDataStream = eyeXHost.CreateEyePositionDataStream())
                {
                    eyePositionDataStream.Next += (s, e) => Console.WriteLine("IsValid: (Left :{0}, Right: {1}) @{2:0}", e.LeftEye.IsValid, e.RightEye.IsValid, e.Timestamp);

                    Console.WriteLine("Listening for eye position data, press any key to exit...");
                    Console.In.Read();
                }
            }
        }
    }
}

Most of the time when my eyes are open, I see IsValid: (Left:True, Right:True). However, this data is a bit glitchy and requires filters and timers to be useful in blink detection.

Have you tried using the EyeXHost.UserPresenceChanged event instead? That gives a more robust event when eyes disappear and come back again. If you can compare the event timestamp between UserPresense=false and UserPresence=true and detect a blink based on that, it might be an easier alternative.

But as you say, native blink detection in the EyeX Engine would be easiest. It is on the backlog, but the priority is not so high at the moment.