title: detecting sleeping eyes with openCV
body: <p>i'm using openCVSharp, it is a OpenCV binding for C#, i want to detect the eye state (opened/closed)</p>
  
  <p>my current process works fine in a certain lightness and doesn't work other wise, i depend on detecting the eye line when sleeping as the eye form 1 horizontal line when closed and many lines when opened.</p>
  
  <p>the process is </p>
  
  <ol>
  <li>detect face with haar cascade</li>
  <li>detect left and right eyes separately with haar cascade (works more precise if detected separately)</li>
  <li>apply in range filter with min=0 and max=Average_intensity_of_eye_region-offset </li>
  <li>smooth the eye region </li>
  <li>use HoughLines to detect number of lines</li>
  <li>make statistics with lines numbers </li>
  <li>if there is 1 lines most of the recent frames then eye is closed</li>
  </ol>
  
  <p>note that i'm working with dell laptop webcam which has low resolution.
  any better algorithm to apply? as i mentioned that works is certain lightness and doesn't in other lightness.</p>
  
  <p>Note: i noticed that in higher lightness the in range filter produce a white spot instead on horizontal line, so i think the solution would be adjusting inrange filter with lightness but i can't figure out how.</p>