Eye blink detection in C# or Python [closed]

asked 2017-05-07 04:46:26 -0600

mrpmorris gravatar image

updated 2020-11-06 00:14:10 -0600

I have a friend who had a stroke last year and now has locked-in-syndrome (he has limited eye movement and can blink). This is Richard https://youtu.be/F7dxInIzcEE

I wrote some software for him to help him to communicate by blinking, but now I want to enable him to control it himself rather than depending on someone else to operate the software for him.

I need an OpenCV example of how to reliably detect if his eyes are open or closed. I tried DLib but it was too slow, so I am looking for an OpenCV solution. I'd prefer a C# example, but if I have no other options then Python looks intuitive enough for me to attempt a translation.

If anyone can help me I would appreciate it very much, and so would Richard.

Thanks

Pete

PS: From the video you might ascertain the fact that Richard cannot wink :D

edit retag flag offensive reopen merge delete

Closed for the following reason the question is answered, right answer was accepted by sturkmen
close date 2020-10-10 03:45:43.611524

Comments

nice project, best of luck there !

what did you try, using dlib ? (the face-detection is grossly slow, but the facial landmarks are really fast.)

i guess, this will need some kind of machinelearning, either on the distance of the upper/lower eye landmarks, or on plain cropped eye images, so, the more video / image footage you have , the better.

berak gravatar imageberak ( 2017-05-07 06:23:38 -0600 )edit

Have you try acat?

LBerger gravatar imageLBerger ( 2017-05-07 06:43:57 -0600 )edit

I hadn't heard of ACAT before. I just tried it and it's accuracy is awful, how does anyone use that?

As for detection, I thought something simple like if I can detect eyes but I cannot detect pupils then the eyes are closed.

mrpmorris gravatar imagemrpmorris ( 2017-05-07 14:50:20 -0600 )edit
LBerger gravatar imageLBerger ( 2017-05-07 15:03:16 -0600 )edit

Have you tried it?

mrpmorris gravatar imagemrpmorris ( 2017-05-07 17:56:12 -0600 )edit

yes and it works but not in 5 minutes if you have question about acat it's here

LBerger gravatar imageLBerger ( 2017-05-07 21:49:52 -0600 )edit

Was it the latest build you tried? For me it just kept recalibrating the camera, and when it wasn't doing that it was either triggering false positives or missing genuine trigger indications.

mrpmorris gravatar imagemrpmorris ( 2017-05-08 04:14:17 -0600 )edit

again that's not right place to talk about acat

LBerger gravatar imageLBerger ( 2017-05-08 04:42:46 -0600 )edit