A kind of Study in Driver Fatigue State Surveillance System based on intelligent movable mobile phone
Technical field
The present invention relates to a kind of automotive safety aid, be specially a kind of Study in Driver Fatigue State Surveillance System based on intelligent movable mobile phone.
Background technology
In today of intellectualized technology fast development, car steering, towards future development intelligent, safe, is also the auxiliary key technology of driving of automobile intelligent to the detection of driver fatigue state.This patent is mainly realized monitoring, tracking and the tired judgement of driver face state, for safe driving vehicle provides safeguard.
Fatigue driving is the one of the main reasons that causes vehicle accident.According to American National expressway traffic safety portion (NHSA) report, U.S. domestic in 2000 only because driver is absent minded, tired, lack the death that the reasons such as sleep cause and approximately have 4700 people.The data demonstration providing according to China Ministry of Public Security, there is altogether once 27 of the great road traffic accidents below dead 30 people, more than 10 people in whole nation road transportation industry in January, 2002 to November.In these 27 major traffic accidents, having the direct or indirect risk factor of 19 is fatigue driving.
Due to ultra-long time driving, nighttime driving or lack the reasons such as sleep, driver there will be tired or sleepy state when driving.Driver fatigue is that the confounding factor of physiological fatigue and psychological fatigue causes, generally comprise following characteristics: absent minded, sleepiness, yawn, react slow, eyes are ached or tired, be sick of sense, have the sensation that will get angry, the number of times of rotation steering wheel reduces and angle becomes large, cannot see road sign, in track, drives and have any problem, and microsleep dormancy etc.Medical expert points out, tired response speed, judgement and the vision that not only can affect driver also can affect his Vigilance and the disposal ability to problem.Particularly " microsleep dormancy " phase of about 2/3rds seconds tired and that produce increases, and is the major incentive that vehicle accident occurs.
Existing fatigue detecting scheme one is to rely on to detect physiological signal, as variations such as electric wave, frequency of wink, heart rate, pulse frequency and skin voltages.This scheme is accurately better, but cannot collect these information by equipment easy to use in reality.
First scheme is the driving behavior that detects driver.As dynamics and the speed of steering dish, accelerator, brake pedal, gear etc.This scheme be because will read driving behavior data from automotive system, so will carry out to a certain degree integrated with automotive system, cannot independently on equipment, realize.
For example patent CN103465857 discloses a kind of method for early warning of the automobile active safety based on mobile phone, main by monocular cam integrated on mobile phone to road ahead, vehicle, pedestrian's information is carried out image acquisition, and the graphical analysis of the photographic head by mobile phone, the intelligent processing units such as algorithm for pattern recognition to camera collection to information is carried out real-time analysis calculating, thereby the position in estimation track, place, distance with front vehicles, whether the place ahead has the results such as pedestrian, and result is presented on mobile phone screen, in adventurous situation, remind in time driver, prevent that driver is tired or vehicle accident occurs absent-minded in the situation that, can effectively reduce the incidence rate of vehicle accident.But, this application is the detection based on external environment, driver's fatigue detecting itself is not related to, and driver's fatigue driving is to cause to drive unsafe key factor, when driver is during in fatigue state, even if the extraneous early warning detecting may not cause driver's attention.
For example patent CN2461804 discloses a kind of doze-proof warner for automobile driver, according to driver, the variation of steering wheel grip force is judged to driver is whether tired, detects inaccurately, and wrong report is many.
Patent CN101763711 discloses a kind of anti-doze device for driving, according to the motion frequency of hand of driver, judges whether in doze state, when automobile, keeps straight on, and hand of driver motion frequency is low, and misinformation probability is large.
Patent CN202855027 discloses the anti-fatigue doze alarming device of a kind of driver, detects driver's state by the reaction of driver's head, requires driver's head always in identical state, practical inconvenient.
In prior art, face recognition technology is a preface problem, people's face has complicated three-dimensional surface structure, the motion of facial muscle simultaneously makes people's face become a kind of non-rigid object, identification difficulty, human face expression is abundant, simultaneously, people's image that face becomes is subject to the impact of illumination, imaging angle and image-forming range, and people's face and eye recognition system are very complicated.
In recent years, it is movable that automotive safety aid field starts to explore by detecting eye, a kind of Study in Driver Fatigue State Surveillance System is provided, for example the research and implementation > > of the driving fatigue detection system of paper < < based on DSP discloses a kind of eye detection of passing through, follow the tracks of and tired recognition methods, human-eye positioning method based on active infrared light, improved the accuracy of human eye detection, can guarantee the real-time detecting, but this paper directly detects eyes, image is processed, high to image collecting device pixel request, and need to carry out parity frame difference processing to video sequence, process complicated, if the image pixel gathering is lower, Gaussian smoothing filtering likely filtering critical data, cause detecting unsuccessfully.
At present, intelligent movable mobile phone is widely used, if image acquisition and processing system that can be based on intelligent movable mobile phone, provide a kind of cost low, detection speed is fast, and check accurately, driver is fettered to few Study in Driver Fatigue State Surveillance System, can greatly solve the problems of the prior art.
Summary of the invention
Goal of the invention: for addressing the above problem, the invention provides a kind of check accurately fast, implement a kind of Study in Driver Fatigue State Surveillance System based on intelligent movable mobile phone easily.The present invention can realize based on mobile device, the detection of photographic head based on mobile phone to people's face and eyes, realizing driver fatigue detects, it is convenient to implement, do not increase extra cost, with the abundant combination of image collecting function of smart mobile phone, provide a kind of Study in Driver Fatigue State Surveillance System based on intelligent movable mobile phone easy to use.
Technical scheme of the present invention is:
A Study in Driver Fatigue State Surveillance System based on intelligent movable mobile phone, comprises video acquisition module, image pre-processing module, the detection of people's face and locating module, face tracking module, eye detection module, eye feature parameter extraction module, tired judge module and alarm module; Video acquisition module, image pre-processing module, the detection of people's face and locating module, face tracking module, eye detection module, eye feature parameter extraction module, tired judge module and alarm module are linked in sequence.
Video acquisition module comprises the photographic head of intelligent movable mobile phone, for the image acquisition to driver people's face and eyes.
Image pre-processing module is by the gray scale adjustment of image slices vegetarian refreshments is removed to picture noise, for illumination compensation.
People's face detects and locating module is realized the detection of people's face and location, the boundary rectangle of the facial image behaviour face face finally drawing based on image pixel nonlinear color transformation.
Face tracking module, according to there being the feature of larger dependency between the successive frame of video image, is utilized the dependency of adjacent two two field pictures, obtains face's boundary rectangle, adopts Kalman filter tracking method to improve the speed that driver's face area detects; In order to improve detection speed, in face tracking process, tracking be face's boundary rectangle.
The method binary image of eye detection module based on improved horizontal Sobel rim detection, detect eye areas, by the image approximate of eye areas, it is eyes rectangular area, in the application, the detection of people's face and eyes is not processed for all image pixels of eyes, only the pixel in respective rectangular region and profile are detected, detection efficiency is high.
Eye feature parameter extraction module is extracted the pupil aperture characteristic parameter of eyes.
Tired judge module, according to the percentage ratio of pupil aperture and eyes size, based on PERCLOS method, judges whether driver is fatigue driving.
Alarm module comprises audio alert and display alarm, and alarm module, when receiving the fatigue of tired judge module and judgment result is that fatigue, starts audio alert and display alarm.
Image pre-processing module illumination compensation specifically comprises the following steps:
The brightness of all pixels in the entire image of video acquisition module collection is arranged from high to low,
If maximum brightness threshold value is I, preset reference brightness is x*I, and wherein x represents the percentage ratio of maximum brightness threshold value, and the span of x is 0~100%; Generally, x value is 95%;
If the ratio that in image, the brightness value of pixel is greater than the pixel number of preset reference brightness and the total pixel number of image arrives preset ratio limit value, general preset ratio limit value is 2%, by preset reference brightness adjustment, be reference white, the gray value of reference white is 255, and the gray value of other pixels of entire image is converted by the yardstick of the brightness adjustment of preset reference brightness and reference white.Image pre-processing module illumination compensation can strengthen the marginal information of image, improves people's face and detects tracking efficiency, and people's face and eye detection speed are fast.
People's face detects and locating module executor face detects and location specifically comprises the following steps,
301, use nonlinear color transformation, the color value of each pixel is projected to Cb ' Cr ' two-dimensional sub-spaces from three-dimensional YCbCr color space, in Cb ' Cr ' two-dimensional sub-spaces, the pixel that represents the colour of skin flocks together, thereby is easy to separated with non-skin pixel point.
302, after detecting skin pixel point, the algorithm that adopts method based on border and the method based on region to combine, carries out cutting apart of human face region; First the algorithm based on border obtains a series of borders by brightness step, and border, for the generation of initial rectangular sequence in early stage, can obtain the boundary rectangle that comprises human face region fast; Then use the method based on region, to belonging to each pixel on border, the brightness value of the pixel of the restriction quantity of inspection pixel periphery, if brightness value surpasses boundary threshold, pixel is also comprised into border, border closed after region merges is facial contour, obtains final output face boundary rectangle.The application identifies facial contour fast, the three-dimensional surface structure to people's face, and Fast transforms, to two-dimensional space, is removed unnecessary face image, quick obtaining facial contour.
Face tracking module specifically comprises the following steps for face tracking,
401, during according to driver drives vehicle, between facial movement successive frame, there is larger dependency, in two continuous frames image, people's face does not have significant change in location, the motion that is people's face is linear, therefore adopts and from predicted current frame, goes out the position of face next frame based on Kalman (Kalman) filter tracking method;
402, Kalman filter tracking method is estimated the position of moving target in next frame image and the uncertainty of position prediction with one group of recursive algorithm, determines adaptively search window position and size in next frame, and Kalman filter tracking specifically comprises:
Face is described by position and the speed of frame in the motion of each frame, with (m
tn
t) position constantly of t that represents a pixel in face's rectangular image, (u
t, v
t) represent that described pixel is at the t speed on m and vertical direction n in the horizontal direction constantly, x
tfor the state vector of moment t is expressed as formula (1),
x
t=[m
tn
tu
tv
t]
T (1)
Rectangle [m wherein
tn
tu
tv
t]
tfor rectangle [m
tn
tu
tv
t] transposed matrix;
Face tracking model representation is formula (2),
x
t+1=Ax
t+w
t (2)
Wherein, A is state transition matrix, w
tfor described pixel t state error amount constantly, described w
tnormal Distribution, is expressed as w
t~N (0, Q), N (0, Q) represent normal distribution, Q is state covariance matrix;
In driver's video, think that the motion of face is linear, so state transition matrix A is formula (3):
After correctly detecting face location in initial two frames continuously, start Kalman filter tracking, establish the state vector x of described initial two frames
0and x
1,
Dependency during due to driver drives vehicle between facial movement successive frame,,
m
0=m
1,n
0=n
1,u
0=m
1-n
0,v
0=n
1-n
0
403, state covariance matrix Q calculates,
According to the observation to driver's facial movement, the noise of supposing system is as follows: the standard deviation of position system error is all 6 pixels in the horizontal and vertical directions, the standard deviation of supposing velocity error is 0.5 pixel/frame, and therefore, state covariance matrix Q is formula (4):
404, bring formula 4 into normal distribution N (0, Q), obtain t state error amount wt functional relation constantly, formula (2) is obtained the state vector of a pixel moment t in face's boundary rectangle image, wherein (mtnt) represents the position in the t moment of a pixel in face's boundary rectangle image, pass through the method, get all pixel t position constantly in face's boundary rectangle image, obtained the position of face's boundary rectangle image, by the Kalman filter tracking method of step 402, recurrence goes out the t+1 position of face's boundary rectangle image constantly, realizes face tracking.Based on Kalman (Kalman) filtering, with one group of recursive algorithm, estimate the position of moving target in next frame image and the uncertainty of position prediction, determine adaptively search window position and size in next frame, check accurately, corresponding speed is fast, and kalman filter method can better be followed the tracks of target.
Eye detection module specifically comprises the following steps eye detection process,
501, the pretreated driver's face image of image pre-processing module 2 is adopted to the method binary image of improved horizontal Sobel rim detection, by the method for connected component labeling, detect candidate's eye areas, obtain eyes boundary rectangle;
502, for described detected eyes boundary rectangle, remove and disturb rectangle, disturb rectangle to comprise the rectangular area that is highly greater than length, be less than or equal to 2mmx2mm, be greater than the rectangle of face area 5%;
503, remove and disturb after rectangle, obtain the center of gravity of each eyes circumscribed rectangular region, center of gravity for each region, take this center of gravity as summit, what the face's boundary rectangle of take was high 20%~30% searches the center of gravity in other region in high isosceles right triangle, if successfully search the center of gravity in other region, these two regions can be considered a pair of eyebrow-eye areas;
504, after completing the whole eyebrow-eye areas of searching, according to the relation of the two pairs of eyebrow-eyes in left and right, finally determine eye position;
505, after step 504, if detect eyes failure, point out user to adjust photographic head angle, photographic head reenters 501 steps after adjusting.
Eye feature parameter extraction module accounts for the percentage ratio of eyes size for the tired eye feature parameter of judging as pupil aperture, image in Preset Time is arranged from more to less by the percentage ratio of the shared number of pixels of eye areas, get front 5%~10% image of percentage ratio, the size of eyes when the meansigma methods of eye areas pixel count is considered as opening, the pupil aperture of eye areas is the pixel value that current eye detection module detects eye areas.
The percentage ratio that tired judge module definition eye pupil aperture accounts for eyes size is greater than 20% and opens for eyes, be equal to or less than 20% for eyes closed, fatigue detecting adopts PERCLOS (Percentage of EyeIid CIosure over the PupiI, over Time, be called for short PERCLOS, tolerance tired/sleepy physical quantity) method, according to PERCLOS method, when the time of eyes closed detected within continuous 2~5 second time, be judged to be fatigue while surpassing 1.6~2 seconds.PERCLOS method is not the invention improvement of this patent, the research and implementation > > of the implementation step of PERCLOS method driving fatigue detection system based on DSP referring to paper < <.
Compared with prior art, beneficial effect of the present invention comprises:
The present invention is detected and is followed the tracks of by people's face, what follow the tracks of is face and eye image, the image pretreatment of passing through, people's face detects and location, after face tracking, and then eye detection is realized to driver tired driving and detect, not directly to following the tracks of eyes, face detection quickly, efficiently and accurately, not high to pixel request, common mobile phone camera can be realized collection and the detection of image, conveniently apply, need to be by other external devices, cost is low, accuracy is high, the driver fatigue of realization based on intelligent movable mobile phone detects, the application's image pre-processing module illumination compensation, people's face detects and location, based on Kalman (Kalman) filter tracking method, carry out the steps such as face tracking and jointly solved design complexity in prior art, accuracy is low, to equipment performance, require high, the problem that monitoring velocity is slow, be conducive to apply on intelligent movable mobile phone.
Further, the application passes through nonlinear color transformation, the color value of each pixel is projected to Cb ' Cr ' two-dimensional sub-spaces from three-dimensional YCbCr color space, in Cb ' Cr ' two-dimensional sub-spaces, quick obtaining facial contour, simplicity of design, fast response time, and it is general by video sequence difference processing in prior art, human eye in positioning video sequence, design is complicated, committed memory is large, the application identifies facial contour fast, three-dimensional surface structure to people's face, Fast transforms is to two-dimensional space, remove unnecessary face image, quick obtaining facial contour.
Further, the application passes through illumination compensation denoising, first denoising, then identify people's face, in denoising process, do not affect the quality of image, in general prior art, by difference processing, obtain after human face structure feature, adopt gaussian filtering smoothing processing, image pixel reduces, and impact detects quality.
Further, the applicant's face tracking module is based on Kalman (Kalman) filtering, with one group of recursive algorithm, estimate the position of moving target in next frame image and the uncertainty of position prediction, determine adaptively search window position and size in next frame, accurately, corresponding speed is fast in check.
Accompanying drawing explanation
Fig. 1 is modular structure schematic diagram of the present invention.
The specific embodiment
Below in conjunction with accompanying drawing and specific embodiment, technical solution of the present invention is described in further detail, so that those skilled in the art can better understand the present invention also, can be implemented, but illustrated embodiment is not as a limitation of the invention.
As shown in Figure 1, a Study in Driver Fatigue State Surveillance System based on intelligent movable mobile phone, comprises that video acquisition module 1, image pre-processing module 2, people's face detect and locating module 3, face tracking module 4, eye detection module 5, eye feature parameter extraction module 6, tired judge module 7 and alarm module 8; Video acquisition module 1, image pre-processing module 2, people's face detect and locating module 3, face tracking module 4, eye detection module 5, eye feature parameter extraction module 6, tired judge module 7 and alarm module 8 are linked in sequence.
Video acquisition module 1 comprises the photographic head of intelligent movable mobile phone, for the image acquisition to driver people's face and eyes; Image pre-processing module 2 is by the gray scale adjustment of image slices vegetarian refreshments is removed to picture noise, for illumination compensation; People's face detects and locating module 3 is realized the detection of people's face and location based on image pixel nonlinear color transformation; Face tracking module 4, according to there being the feature of larger dependency between the successive frame of video image, is utilized the dependency of adjacent two two field pictures, adopts the method for following the tracks of to improve the speed that driver's face area detects; The method binary image of eye detection module 5 based on improved horizontal Sobel rim detection, detects eye areas; Eye feature parameter extraction module 6 is extracted the pupil aperture characteristic parameter of eyes; Tired judge module 7, according to the percentage ratio of pupil aperture and eyes size, based on PERCLOS method, judges whether driver is fatigue driving; Alarm module 8 comprises audio alert and display alarm, and alarm module 8, when receiving the fatigue of tired judge module 7 and judgment result is that fatigue, starts audio alert and display alarm.
Image pre-processing module 2 illumination compensations specifically comprise the following steps,
The brightness of all pixels in entire image is arranged from high to low,
If maximum brightness threshold value is I, preset reference brightness is x*I, and wherein x represents the percentage ratio of maximum brightness threshold value, and the span of x is 0~100%; X value is 95%;
If the ratio that in image, the brightness value of pixel is greater than the pixel number of 95%I and the total pixel number of image arrives preset ratio limit value 2%, by preset reference brightness adjustment, be reference white, the gray value of reference white is 255, and the gray value of other pixels of entire image is converted by the yardstick of the brightness adjustment of preset reference brightness and reference white.
People's face detects and locating module 3 executor's faces detect and location specifically comprises the following steps,
301, use nonlinear color transformation, the color value of each pixel is projected to Cb ' Cr ' two-dimensional sub-spaces from three-dimensional YCbCr color space, in Cb ' Cr ' two-dimensional sub-spaces, the pixel that represents the colour of skin flocks together, thereby is easy to separated with non-skin pixel point.
302, after detecting skin pixel point, the algorithm that adopts method based on border and the method based on region to combine, carries out cutting apart of human face region; First the algorithm based on border obtains a series of borders by brightness step, and border, for the generation of initial rectangular sequence in early stage, can obtain the boundary rectangle that comprises human face region fast; Then use the method based on region, to belonging to each pixel on border, the brightness value of the pixel of the restriction quantity (the present embodiment is used 8 pixels) of inspection pixel periphery, if brightness value surpasses boundary threshold, pixel is also comprised into border, border closed after region merges is facial contour, obtains final output face boundary rectangle.
Face tracking module 4 specifically comprises the following steps for face tracking,
Face is described by position and the speed of frame in the motion of each frame, with (m
tn
t) position constantly of t that represents a pixel in face's rectangular image, (u
t, v
t) represent that described pixel is at the t speed on m and vertical direction n in the horizontal direction constantly, x
tfor the state vector of moment t is expressed as formula (1),
x
t=[m
tn
tu
tv
t]
T (1),
Rectangle [m wherein
tn
tu
tv
t]
tfor rectangle [m
tn
tu
tv
t] transposed matrix;
Face tracking model representation is formula (2),
x
t+1=Ax
t+w
t (2)
Wherein, A is state transition matrix, w
tfor described pixel t state error amount constantly, described w
tnormal Distribution, is expressed as w
t~N (0, Q), N (0, Q) represent normal distribution, Q is state covariance matrix;
In driver's video, think that the motion of face is linear, so state transition matrix A is formula (3):
After correctly detecting face location in initial two frames continuously, start Kalman filter tracking, establish the state vector x of described initial two frames
0and x
1, the dependency during due to driver drives vehicle between facial movement successive frame,,
m
0=m
1,n
0=n
1,u
0=m
1-n
0,v
0=n
1-n
0
403, state covariance matrix Q calculates,
According to the observation to driver's facial movement, the noise of supposing system is as follows: the standard deviation of position system error is all 6 pixels in the horizontal and vertical directions, the standard deviation of supposing velocity error is 0.5 pixel/frame, and therefore, state covariance matrix Q is formula (4):
404, by formula (4) bring into normal distribution N (0, Q), obtain t state error amount w constantly
tfunctional relation, formula (2) is obtained the state vector of a pixel moment t in face's boundary rectangle image, wherein (m
tn
t) position constantly of t that represents a pixel in face's boundary rectangle image, pass through the method, get all pixel t position constantly in face's boundary rectangle image, obtained the position of face's boundary rectangle image, by the Kalman filter tracking method of step 402, recurrence goes out the t+1 position of face's boundary rectangle image constantly, realizes face tracking.
5 pairs of eye detection processes of eye detection module specifically comprise the following steps,
501, the pretreated driver's face image of image pre-processing module 2 is adopted to the method binary image of improved horizontal Sobel rim detection, by the method for connected component labeling, detect candidate's eye areas, obtain eyes boundary rectangle;
502, for described detected eyes boundary rectangle, remove and disturb rectangle; Disturb rectangle to comprise the rectangular area that is highly greater than length, be less than or equal to 2mmx2mm, be greater than the rectangle of face area 5%;
503, remove and disturb after rectangle, obtain the center of gravity of each eyes circumscribed rectangular region, center of gravity for each region, take this center of gravity as summit, what the face's boundary rectangle of take was high 20%~30% searches the center of gravity in other region in high isosceles right triangle, if successfully search the center of gravity in other region, these two regions can be considered a pair of eyebrow-eye areas;
504, find after whole eyebrow-eye areas completing, according to the relation of the two pairs of eyebrow-eyes in left and right, two center of gravity lines are less than 30 ° with the angle of image X-axis, finally definite eye position;
505, after step 504, if detect eyes failure, point out user to adjust photographic head angle, photographic head reenters 501 steps after adjusting.
The eye feature parameter that eye feature parameter extraction module 6 is judged for fatigue accounts for the percentage ratio of eyes size as pupil aperture, image in Preset Time is arranged from more to less by the percentage ratio of the shared number of pixels of eye areas, get front 5%~10% image of percentage ratio, the size of eyes when the meansigma methods of eye areas pixel count is considered as opening, the pupil aperture of eye areas is the pixel value of 5 pairs of current eye areas of eye detection module.
The percentage ratio that tired judge module 7 definition eye pupil apertures account for eyes size is greater than 20% and opens for eyes, be equal to or less than 20% for eyes closed, fatigue detecting adopts PERCLOS method, according to PERCLOS method, when the time of eyes closed detected within continuous 2~5 second time, be judged to be fatigue while surpassing 1.6~2 seconds.PERCLOS method is not the invention improvement of this patent, the research and implementation > > of the implementation step of PERCLOS method driving fatigue detection system based on DSP referring to paper < <.
Below be only the preferred embodiment of the present invention; be noted that for those skilled in the art; under the premise without departing from the principles 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.