There are many kinds of blink detection algorithms, but the accuracy rate has a great increase in space. This excerpt has several simple methods of judging:
One: Based on the valve value
Http://www.cpe.ku.ac.th/~jeab/papers/chinnawat_JCSSE2009.pdf
When the eye is completely closed, a higher threshold is needed to find a connecting area (after media Blur)
Second: Simple logical Judgment method
Https://github.com/madhurjain/TrackNoseBlinkEye/blob/master/TrackNoseBlinkEye/TrackNoseBlinkEye.cpp
The simple point is to judge that the eye center is not in the current Unicom area
/* Eye Blink Code goes-here & checks-bounding rects to determine whether-is-blinked or not.
*/int Is_blink (cvseq* comp, int num, cvrect window, Cvrect eye) {if (comp = = 0 | | num! = 1)
return 0;
Cvrect r1 = cvboundingrect (comp, 1);
/* component is within the search window */if (r1.x < window.x) return 0;
if (R1.y < WINDOW.Y) return 0;
if (r1.x + r1.width > window.x + window.width) return 0;
if (r1.y + r1.height > window.y + window.height) return 0;
/* Get the centroid of Eye */Cvpoint pt = cvpoint (eye.x + EYE.WIDTH/2,
Eye.y + EYE.HEIGHT/2); /* component is located at theEye ' s centroid */if (pt.x <= r1.x | | pt.x >= r1.x + r1.width) return 0;
if (pt.y <= r1.y | | pt.y >= R1.Y + r1.height) return 0;
return 1; }
The algorithm of the individual based on experience is as follows
Features: When the eye is open, the shape is like a rectangle and a triangle when closed.
/**
trianglelikely highly
open graphics like rectangles eye height
closed like high triangular eyes low
openeyelikely = max (up and down value /2) * high)
f (x) = max (openeyelikely)
normalization:
highly normalized: highly = float (brightcount)/rowmean.rows, 1 in the eyes, When you close your eyes, the experimental data is about 0.3
rectanglelikely normalization: rectanglelikely = (up + Down)/2/middle. When the eyes are 1, close eyes less than 0.5
openeyelikely = rectanglelikely * highly;
*/
In fact, the blink point has many characteristics: the lower eyelid rarely moves, is upper eyelid downward blink. This makes it possible to make an estimate of the blink cycle, which upper eyelid in one cycle.
There will be many other problems in the real situation.
One: It's hard to catch a real close eye moment.
Two: Blink will be a drag.
These situations are difficult to solve, can only say slow blink, too fast to deal with.