Search code examples
javaandroidopencvface-detectioneye-tracking

open eye and closed eye in android by Android eye detection and tracking with OpenCV


i made application eye detecting by following this link link and it work
how can i detect the eye is opened or closed ? is there library in android to detect closed or opened


Solution

  • I've no idea whether there is any library for that, but using technique descirbed in article Eye-blink detection system for human–computer interaction by Aleksandra Królak and Paweł Strumiłło (you can download it here and here and here is some simplified version) in my opinion is a good option. Generally this technique is quite simple:

    1. Find eye (or both eyes). Remember this part of image as a template.
    2. In next frame use some kind of corellation (authors used normalized cross correlation method, but you can try with other types - OpenCV has few types of correlation methods implemented) to find region similar to your template. Place with highest correlation value (most likely) will be eye.
    3. If correlation value > some_threshold_value than eye is open, otherwise it is closed.

    Threshold value used by authors is in the article, but when i was using this technique i've used other value so most likely you will need to find value for your case on your own.