Embodiment
The below describes embodiments of the invention in detail, and the example of described embodiment is shown in the drawings, is exemplary below by the embodiment that is described with reference to the drawings, and only is used for explaining the present invention, and can not be interpreted as limitation of the present invention.
With reference to figure 3, the human eye recognition system of the embodiment of the present invention comprises: human eye regional identification module 100 to be measured, human eye detection module 200 and human eye weights identification module 300.
Described human eye regional identification module 100 to be measured is used for drawing from human face region and gets left eye and right eye zone to be detected.
Described human eye detection module 200 is used for detecting from left eye and right eye zone to be detected left eye and right eye target area.In embodiments of the present invention, described human eye detection module comprises human eye feature extraction module and eye recognition module, be used for to extract the feature in left eye and right eye zone to be detected by described human eye feature extraction module, the non-human eye area of feature that is used for getting rid of described extraction by described eye recognition module is to obtain left eye and right eye target area.
Described human eye weights identification module 300, be used for calculating human eye area by weights are carried out in left eye and right eye target area, described weights comprise resonable degree and right and left eyes interocular distance line and the horizontal direction angle of big or small degree of closeness, the right and left eyes zone length of side and the right and left eyes interocular distance ratio of right and left eyes.
According to process flow diagram shown in Figure 3, can realize by following step and method the eye recognition of described human eye recognition system.
At step S01, by detecting at the enterprising pedestrian's face of the portrait picture that gathers, obtain people's face rectangular area.
At step S02, draw from human face region and get left eye and right eye zone to be detected.
At step S03, extract the feature in left eye and right eye zone to be detected.In embodiments of the present invention, can be by extracting the Haar feature as the feature of identification people's face and human eye, the Haar feature is divided three classes usually: edge feature, linear feature, central feature and diagonal line feature, be combined into feature templates, as shown in Figure 2, adularescent and two kinds of rectangles of black in feature templates, and can be by the eigenwert that defines this template the white rectangle pixel and deduct the black rectangle pixel and, therefore can distinguish human eye and non-human eye by select suitable feature on the Haar of picture characteristic set.
At step S04, get rid of non-human eye area in the feature of described extraction, to obtain left eye and right eye target area.In embodiments of the present invention, can pass through the AdaBoost algorithm, adopt wipe-out mode to remove non-human eye area based on the Haar characteristic information, obtain left eye and right eye target area.The AdaBoost algorithm is a kind of method of cascade sort, and it is combined some more weak sorting techniques, the very strong sorting technique that combination makes new advances.In embodiments of the present invention, at first, can select effective Haar feature by the AdaBoost algorithm from the Haar feature and train the right and left eyes detecting device.Training sample is divided into positive example sample and negative data, wherein the positive example sample refers to target sample to be checked (left eye and right eye), negative data refers to other any image, all samples pictures all are normalized to same size, size in samples pictures described in one embodiment of the invention can be 20*20, the size of described samples pictures can be come to determine as required, can also be 30*30 or other suitable sizes.After sorter has been trained, can be applied to the detection in the zone to be detected of left eye in input picture and right eye, described zone to be detected has identical size with training sample.In the image detection process, with image convergent-divergent, the then subwindow of exhaustive each 20*20 of the picture after convergent-divergent successively in proportion.By each grade sorter, in which floor detection, most candidate region just has been excluded window so in front successively, and all the zone by each grade detection of classifier is the target area.Then, adopt wipe-out mode to remove non-human eye area based on the Haar characteristic information, what testing process finished to obtain is all zones that are not excluded.But in the bad situation of light, the zone such as canthus eyebrow and human eye have similar Haar feature, are easy to be identified as human eye by mistake, the situation that people's face one side identifies a plurality of human eyes occurs.
At step S05, weights are carried out in left eye and right eye target area calculate human eye area, the present invention calculates accurate human eye area by three weights, described three weights comprise big or small degree of closeness, the right and left eyes zone length of side of right and left eyes and resonable degree and right and left eyes interocular distance line and the horizontal direction angle of right and left eyes interocular distance ratio, by judge two human eye degrees of closeness, eyes size and interpupillary distance ratio whether near 0.6 and interpupillary line and horizontal sextant angle obtain a human eye area the most accurate near these three weights of level.In the embodiment of the present invention, described weight calculation method is:
The big or small degree of closeness of described left eye and right eye: W
1=1-|S
l-S
r|/(S
l+ S
r), S
lRepresent the left eye region length of side, S
rRepresent the right eye region length of side.If S
lAnd S
rSize approaches so | S
l-S
r| near 0, thus W
1Close to 1, therefore, for the big or small degree of closeness W of described left eye and right eye
1Value more close to 1, the size of left eye and right eye is more approaching.
The length of side in described right and left eyes zone and the resonable degree of right and left eyes interocular distance ratio: W
2=1-|L
p-L|/(L
p+ L), L
pRepresent the spacing of two pupils, L is by L=(S
l+ S
r) * 5/6 calculates and get, in embodiments of the present invention, than whether judges described weights W near 0.6 by the regional length of side of right and left eyes with the right and left eyes interocular distance
2Resonable degree, L wherein
pRepresent the distance of two pupil actual measurements, L is the reference value that calculates by the empirical value that the right and left eyes length of side is interocular distance 0.6, with reference to figure 4, L
pMore approaching with L, W
2Value more close to 1, the length of side in described right and left eyes zone than more reasonable, thinks that right and left eyes more meets normal eye's standard with the right and left eyes interocular distance.
The angle of described right and left eyes pupil center's line and horizontal direction: W
3=D
x/ (D
x+ D
y), D
xRepresent the horizontal range of two pupils; D
yRepresent the vertical range of two pupils, with reference to figure 5, if people's eye coordinates (x of pair of right and left human eye
l, y
l) and (x
r, y
r) the difference in height of two eyes be D
x, D
yIf human eye is in normal condition, D
yClose to 0, described weights W
3Close to 1, described weights W
3Be 1 to the maximum.
For above each weights, too small irrational data appear sometimes, can as required it be screened out, for example, keep the data near 1, give less negative value with too small data, the data of-10 left and right in the end during Weight selected, will not considered in for example-10.
For better explanation the present invention, below will be elaborated with the embodiment based on the frightened Expression Recognition of head movement.Described embodiment need to set up an expression database in advance, and in database, each expression comprises start frame and exaggerates frame most, and the equal mark of the expression in database.
In identifying, at first, take out all expression start frames and exaggerate frame most, advanced pedestrian's face detects in every width picture, the rectangle human face region that obtains detecting, and the height of rectangular area: height, wide: width.
Then, determine the human eye target area.Get top left region: (x ∈ [0, width/2], y ∈ [0,0.6*height]) from the human eye detection algorithm of top left region application based on Haar feature and AdaBoost sorter, detects M human eye; In like manner, use identical algorithms in right regions (x ∈ [width/2, width], y ∈ [0,0.6*height]), N human eye detected.
Then, determine accurate human eye area.If M*N=0; The failure of human eye detection algorithm; If M*N=1; The success of human eye detection algorithm; If M*N>1, all human eyes that detect form M*N to human eye; According to the every pair of human eye that detects calculate three weights and.Weighting value and maximum human eye are to as net result.The success of human eye detection algorithm.
According to the human eye that has detected, calculate the head movement information characteristics.Adopt sorter that feature is classified, and then whether identification is frightened expression.
Above human eye recognition system of the present invention and method are described in detail, the resonable degree of the big or small degree of closeness by right and left eyes, the right and left eyes zone length of side and right and left eyes interocular distance ratio and right and left eyes interocular distance line and these three weights of horizontal direction angle are located human eye, effectively solve the orientation problem of a plurality of human eyes target area, improved accuracy and the automaticity of eye recognition.
One of ordinary skill in the art will appreciate that and realize that all or part of step that above-described embodiment method is carried is to come the relevant hardware of instruction to complete by program, described program can be stored in a kind of computer-readable recording medium, this program comprises step of embodiment of the method one or a combination set of when carrying out.
In addition, each functional unit in each embodiment of the present invention can be integrated in a processing module, can be also that the independent physics of unit exists, and also can be integrated in a module two or more unit.Above-mentioned integrated module both can adopt the form of hardware to realize, also can adopt the form of software function module to realize.If described integrated module realizes with the form of software function module and during as independently production marketing or use, also can be stored in a computer read/write memory medium.
The above-mentioned storage medium of mentioning can be ROM (read-only memory), disk or CD etc.
The above is only embodiments of the present invention; should be pointed out that for those skilled in the art, under the prerequisite that does not break away from the principle of the invention; can also make some improvements and modifications, these improvements and modifications also should be considered as protection scope of the present invention.