Ask Your Question

Detecting how much eyes are open

asked 2013-05-31 04:24:57 -0500

Alby87 gravatar image


I'm pretty new at OpenCV, sorry if the question is trivial :)

I need to recognize, as much precise as possible, how much an eye is open. I found examples about detecting if open or closed. My program already have a image of the eye to study, for example this image

Eye to study

I don't need to recognize to eye from the face, I already have it. From that very image, how I can calculate a value (I don't need a measure value i.e. in centimeters, a consistent value would be good)? I've tried to convert in grayscale and using a threshold, but don't seem to work (my idea was to recognize only the white of the eye, of the black of the pupil), but maybe I'm doing it wrong. Im doing it in C# (Emgu) if you need to know it.

Many, many thanks!


edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted

answered 2013-05-31 04:33:21 -0500

updated 2017-08-17 05:47:10 -0500

As a first comment, this is OpenCV, not EmguCV, so we won't supply you with C# code here, since that is a different community.

On the other hand, what you could do is to look into the iris detection/recognition algorithms. They are used to define first the region of the iris, but they also define the location of the eyelids, in order to compensate for them, by creating a mask. This information could be interesting for you to define a measurement.

Mostly it is based on Hough lines and Hough circles.

This paper could get you some more insight into the problem. It is the original approach by John Daugman to detect and recognize irises.

Update 17/08 - updated paper link as requested

edit flag offensive delete link more



Oh, don't worry about C# code, I know there similar but not equal, but I tought this was plus a "Computer Vision" problem than a OpenCV/EmguCv problem

To be honest, I searched all about "eyes", but not about "iris". I'll start searching about it.

Hough Lines and Hough Circles? At least I know what to search to try to study the problem :)

About the paper... I saw that the eye is at a wonderfull risolution... you think I could do some filtering to improve the image? Many many thanks :)

Alby87 gravatar imageAlby87 ( 2013-05-31 05:16:07 -0500 )edit

The quality of your eye will always influence the algorithm, however, the iris is clear there because you need the detail for a unique representation. The methods for detecting the sclera, iris and eyelids however can be reused on lower resolution images.

StevenPuttemans gravatar imageStevenPuttemans ( 2013-05-31 06:10:17 -0500 )edit

Ok, I'll start working here... many, many thanks!! :)

Alby87 gravatar imageAlby87 ( 2013-05-31 14:13:59 -0500 )edit

*Hey steven thanks for providing this answer. Can you please update the link for the paper you provided in the answer. I got 404 - Page not found error Many Thanks *

Ahmad Khalid gravatar imageAhmad Khalid ( 2017-08-16 10:33:10 -0500 )edit

Provided a corresponding update! Should work again!

StevenPuttemans gravatar imageStevenPuttemans ( 2017-08-17 05:47:45 -0500 )edit

Thanks , link works :)

Ahmad Khalid gravatar imageAhmad Khalid ( 2017-09-13 12:13:44 -0500 )edit
Login/Signup to Answer

Question Tools

1 follower


Asked: 2013-05-31 04:24:57 -0500

Seen: 1,603 times

Last updated: Aug 17 '17