MATLAB: How to calculate eye area and height

areaeyesheightImage Processing Toolboxskin

I've attached 2 images, one with open eyes and another one with close eyes. How to calculate the eyes area and height ? so I can compare the height values between open and close eyes, then detect when the eyes are close. As if the eyes height value is big it indicate that eyes are open and vice versa.

Best Answer

You can use the Color Thresholder app on the Apps tab of the MATLAB tool ribbon to look for skin tones, then invert that mask and get the eyes mask. Then use regionprops() to get the bounding box. But what are you going to do if the woman is wearing eye shadow so that her eyes are dark (non-skin tone) regardless of whether her eyes are open or closed. See attached skin detection demo.
Related Question