Opencv c ++ eye detection

I need to detect only closed eyes, as well as both eyes separately. This means that I need to say whether the left eye is open or closed, also about the right eye.

I tried several ways. One of them is detecting the eyes with haarcascade_eye and haarcascade_eye_tree_eyeglasses separately, and then comparing the results. If both detect the eye, then the eyes open, if one is detected and the other cannot, then the eye is 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 this does not work as expected. Cascading detectors do not work as indicated in the link. Very close results are found with those haarcascade, about which I spoke above. Sometimes he gives the correct result, sometimes he cannot. I do not know why. In addition, with this method it cannot be said that the eye is open and which eye is closed.

Now can someone help me solve this? At the very least, I need a way to say that one of the eyes is closed, regardless of which one needs to be done exactly. Please, help.......

+6
source share
1 answer

If you want to avoid training Haar’s own Qagad to detect a single eye, you can try simpler methods, such as detecting the pupil. If you do not find a black circle, the eye is closed. If you have a small area of ​​interest, this probably works very well. Another option may be color histograms of the eye area, which can look quite different for open and closed states.

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 to prepare your own cascade, which I think.

+1
source

All Articles