Closed eye detection opencv C++
Asked Answered
O

1

6

I need to detect closed eyes only and also both eyes separately. That means I need to tell if left eye is open or closed, also same about the right eye.

I tried few ways. One of them is to detect eyes with haarcascade_eye and haarcascade_eye_tree_eyeglasses separately and then compare the results. If both detect eye, then eye open, if one detect and another can't,then eye closed. This trick was taken from this link:

http://tech.groups.yahoo.com/group/OpenCV/messages/87666?threaded=1&m=e&var=1&tidx=1

But it doesn't work as expected.eye cascade detectors don't work as mentioned in the link. Much close results are found with those haarcascade that I mentioned above. Sometimes it gives correct result, sometimes it can't. I don't know why. Besides it can't be told with this method that which eye is open and which eye is closed.

Now can someone help me to solve this?? At least I need a way to tell that one of the eyes is closed regardless which one and need to do that accurately. Please help.......

Oringas answered 9/3, 2013 at 14:32 Comment(5)
"accurately" is difficult with image processing. Also take into consideration that the eye shape of some people is naturally quite narrow, so you'll likely end up with a lot of false positives/negativesTrifle
I see. Can you tell me which haarcascade detect both open & closed eye and which detect only open eye? Then I could manage some for now.Oringas
you may apply template matchingCheryl
you mean by training the openCV for object recognition? Isn't that going be too difficult?Oringas
** Isn't that going to be too difficult?I found it hard, that's why I was trying to find an alternative.Oringas
M
1

If you want to avoid training your own Haar cascade to detect a single eye, you can attempt simpler techniques such as pupil detection. If you fail to detect a black circle, the eye is closed. If you have a smallish region of interest, this probably works very well. Another option would be color histograms of the eye region, which may look pretty different for the open and closed state.

If you cannot predict with reasonable accuracy where the eyes can be found in the image, these approaches are doomed and your best shot is training your own cascade I think.

Matrilineage answered 19/4, 2013 at 9:44 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.