A kind of lane-departure warning system and method based on machine vision
Technical field
The present invention discloses a kind of vehicle warning system, particularly a kind of lane-departure warning system and method based on machine vision.
Background technology
Along with the development gradually of automobile industry, automobile pollution increases day by day, and automobile is lived the convenience brought with fast self-evident to people, and the flourish of auto trade brings very large contribution to economy, but also produce a series of social concerns, wherein traffic accident is the most serious problem simultaneously.According to statistics, in 2011, Kuomintang-Communist occurs 210812, death toll: 62387 people.Wherein the cause of most accidents is that driver drives rashly, due to not observing traffic rules and regulations, in this, be that driver crosses over two tracks and causes in driving procedure greatly, although highway is provided with track warning line, but in driving procedure, whether line ball of vehicle, relies on driver's driving experience judgement completely, very inaccurate.
Summary of the invention
For easy line ball in the above-mentioned vehicle drive process of the prior art of mentioning, cause the shortcoming of traffic accident, the invention provides a kind of new lane-departure warning system based on machine vision and method, it adopts advanced computer vision algorithm for pattern recognition, in conjunction with high speed digital signal processor to vehicle-mounted camera driving road-condition real-time analysis, can predict vehicle will run-off-road, also in unconscious situation about doing like this, send vision to chaufeur but driver is actual, the warning of the sense of hearing or sense of touch aspect, take care and travel with prompting driver, effectively minimizing accident occurs.
The technical scheme that the present invention solves its technical matters employing is: a kind of lane-departure warning system based on machine vision, system comprises interface processing unit, forward sight camera, digital signal processing unit and power module, described forward sight camera is arranged on shield glass middle and upper part and does not block the position that driver's sight line and windscreen wiper can clean, gather vehicle front image, and by image transmitting to digital signal processing unit, whether digital signal processing unit intelligent decision vehicle will run-off-road, through digital signal processing unit image transmission after treatment to interface processing unit, interface is processed the work of unit controls warning device, power module is given other module for power supply.
Adopt above-mentioned system to realize blind spot detecting test of vehicle and the method for warming based on machine vision, the method comprises the steps:
A, igniting: system powers on;
B, enter idle pulley in the do not walk front or too low system of speed of automobile, now can't start lane departur warning function;
After C, disengaging idle condition, system detects side-marker lamp's on off state, if side-marker lamp does not open, camera enters a day inter mode;
If D side-marker lamp opens, enter night vision pattern;
E, system open camera and carry out AGC to road conditions Real-time Collection and according to light power, and the image of distortion is corrected, the information collecting with 25 frames the per second or 30 frames digital signal processing unit that is sent to per second;
F, digital signal processing unit are converted into the vision signal of receiving the colour picture of rgb format;
G, YUV coding: the image of rgb format is converted into yuv format through matrixer: obtain brightness signal Y and two colour difference signal R-Y, i.e. U, B-Y, i.e. V, separates brightness signal Y with carrier chrominance signal U, V;
H, picture breakdown are upper and lower two parts, only retain the latter half and use as calculating when processing;
I, pattern analysis: confirm weather conditions;
If J wiper system or fog lamp system are opened, system will be analyzed as rain, mist, snow weather, now adopt digital filter to carry out image noise reduction; If wiper system or fog lamp system, without unlatching, directly enter K flow process;
K, lane identification analysis: adopt Hough mapping algorithm, rim detection identification is carried out in track: track enters deviation identification process L if detected; If otherwise there is no track, system enters idle condition;
L, deviation identification:
The track identifying is analyzed, take 1 pixel as unit, in the time that X1 > α and θ 1 are greater than β and spend, deviation left-lane;
When X2 is less than α ', and θ 2 deviation right lane while being greater than β ';
Wherein α, β, α ', and the value of β ' is according to different automobile types, different installation sites timing is set;
If vehicle does not have run-off-road, this returns to idle condition and again detects;
If deviation detected, enter into step M;
M, in the time that track is about to depart from, detect turn signal swich state:
If the steering indicating light of corresponding orientation is opened, think initiatively circuit switched of driver, return to idle condition;
Otherwise, if without opening corresponding orientation steering indicating light, think the unconscious tangent line of driver;
N, steering wheel inclination angle detect: whether assistant analysis vehicle turns to behavior;
If O system analysis result is unconscious tangent line, according to different hazard levels sound, image or vibrations warning signal.
The technical scheme that the present invention solves its technical matters employing further comprises:
The invention has the beneficial effects as follows: the present invention adopts advanced computer vision algorithm for pattern recognition, in conjunction with high speed digital signal processor to vehicle-mounted camera driving road-condition real-time analysis, can predict vehicle will run-off-road, also in unconscious situation about doing like this, send vision to chaufeur but driver is actual, the warning of the sense of hearing or sense of touch aspect, take care and travel with prompting driver, effectively minimizing accident occurs.
Below in conjunction with the drawings and specific embodiments, the present invention will be further described.
Accompanying drawing explanation
Fig. 1 is system block diagram of the present invention.
Fig. 2 is mounting structure schematic diagram of the present invention.
Fig. 3 is method of calculating schematic diagram of the present invention.
Fig. 4 is system flowchart of the present invention.
In figure, 1-car body, 2-forward sight camera, 3-warns panel, 4-road, the road route mark after 5-Hough conversion.
The specific embodiment
The present embodiment is the preferred embodiment for the present invention, and other all its principles are identical with the present embodiment or approximate with basic structure, all within protection domain of the present invention.
Please refer to accompanying drawing 1 and accompanying drawing 2, the lane-departure warning system based on machine vision in the present invention, comprise interface processing unit, forward sight camera 2, digital signal processing unit and power module, forward sight camera 2 is arranged on car body 1 front windshield middle and upper part and does not block the position that driver's sight line and windscreen wiper can clean, gather vehicle front image, and by image transmitting to digital signal processing unit, whether digital signal processing unit intelligent decision vehicle will run-off-road, through digital signal processing unit image transmission after treatment to interface processing unit, interface is processed the work of unit controls warning device, power module is given other module for power supply, in the present embodiment, power module is power interface, power interface is connected with automobile power source, (be automobile batteries by automobile power source, 12V or 24V) to system power supply.In the present embodiment, interface microcontroller processing unit is connected with the sensor in automobile by I/O mouth or CAN bus bus, whether obtain information of vehicles, in the present embodiment, the signal that need to obtain comprises: (1) turn signal swich: be driver's active steering for analyzing; (2) vehicle speed signal: for activation or the sleep pattern of decision system; (3) steering wheel angle: whether assistant analysis vehicle turns to; (4) side-marker lamp's signal: for identifying pattern switching at day/night; (5) fog lamp signal: for identifying mist synoptic model; (6) windscreen wiper signal: for identifying rainy day gas switch mode; (7) ignition signal: whether light a fire for identifying vehicle launch.In the present embodiment, digital signal processing unit adopts DSP high speed digital signal processor, DSP high speed digital signal processor does not block the position that driver's sight line and windscreen wiper can clean forward sight camera 2 by being arranged on car body 1 front windshield middle and upper part obtains the road conditions image in driving, carry out complicated Machine Vision Recognition in conjunction with speed information, whether intelligent decision vehicle will run-off-road.DSP high speed digital signal processor can according to vehicle shift situation make interface microcontroller processing unit by CAN bus bus send different brackets warning message to warning panel 3, independently warn panel 3 receiving after warning message and will on panel, show different warning messages to chaufeur.
The present invention is connected to power supply and warning panel 3 by wire harness and adaptor union.User only need plug adaptor union, and plug and play is without carrying out complexity setting, convenient and swift.
Please refer to accompanying drawing 4, the method for the lane departur warning based on machine vision of the present invention comprises the steps:
A, igniting: system powers on;
B, power on after because car is moving, or speed is too low without starting lane departur warning function, thus system enters idle condition; When speed during higher than 10KPH (i.e. 10 kilometer per hours are defined as the moving and motionless demarcation line of car in the present invention) system depart from idle condition;
After C, disengaging idle condition, system detects side-marker lamp's on off state, if side-marker lamp does not open, camera enters a day inter mode;
If D side-marker lamp opens, camera enters night vision pattern;
E, system are opened camera and are carried out AGC (i.e. braking gain is controlled) to road conditions Real-time Collection and according to light power, and the image of distortion is corrected (in the present embodiment, AGC and image are corrected and are automatically completed by camera module), and the information collecting is sent to dsp processor with 25 frames (pal mode) per second or 30 frames (TSC-system formula) per second;
F, dsp processor are converted into the vision signal of receiving the colour picture of rgb format;
G, YUV coding: the image of rgb format is converted into yuv format through matrixer: obtain brightness signal Y and two colour difference signal R-Y (being U), B-Y (being V), brightness signal Y is separated with carrier chrominance signal U, V, there is no U, V signal component if only have Y-signal component, the image so representing is exactly black and white gray level image;
H, picture breakdown are two parts: due to camera collection to picture useful information be: track is in image the latter half, for reducing the calculated amount of arithmetic and logic unit, reduce track analysis (being step K) the erroneous judgement interference that the first half data produce, in the present embodiment, picture is divided into upper and lower two parts, when processing, only retains the latter half and use as calculating;
I, pattern analysis: confirm weather conditions: fine, rain, mist, snow, etc.;
If J wiper system or fog lamp system are opened, system will be analyzed as rain, mist, snow weather, now, due to misty rain snow block vision, cause drawing unintelligible, need to adopt digital filter to carry out image noise reduction, if without unlatching, this directly enters K flow process;
K, lane identification analysis: adopt Hough mapping algorithm, rim detection identification is carried out in track, if detected, track enters deviation identification process L; If otherwise there is no track, system enters idle condition;
L, deviation identification:
Please refer to accompanying drawing 3, in the present invention, the track identifying analyzed, take 1 pixel as unit, in the time that X1 > α and θ 1 are greater than β and spend, deviation left-lane is described,
When X2 is less than α ', and θ 2 deviation right lane while being greater than β ';
In the present embodiment, X1 is the extended line of left-lane and the intersection point of the image bottom line distance to image left side edge, X2 is that the intersection point of right lane extended line and image bottom line is to the distance of image left side edge, θ 1 is the extended line of left-lane and the angle of image bottom line, θ 2 is angles of right lane extended line and image bottom line, when α is normal vehicle operation, the intersection point of the extended line of left-lane and image bottom line is to the maximum limit of the distance of image left side edge, when β is normal vehicle operation, the maxim of the angle of the extended line of left-lane and image bottom line, when α ' is normal vehicle operation, when the intersection point of the extended line of right lane and image bottom line is normal vehicle operation to the minimum limit value of the distance of image left side edge and β ', the maxim of the angle of the extended line of right lane and image bottom line, α, β, the value of α ' and β ' need be set (according to different automobile types according to actual installation timing, different installation sites, its numeral is different),
If vehicle does not have run-off-road, return to idle condition and again detect;
If deviation detected, enter into step M;
M, in the time that track is about to depart from, detect turn signal swich state:
If the steering indicating light of corresponding orientation is opened, think initiatively circuit switched of driver, return to idle condition;
Otherwise, if without opening corresponding orientation steering indicating light, think the unconscious tangent line of driver;
N, steering wheel inclination angle detect: whether assistant analysis vehicle turns to behavior;
If O system analysis result is unconscious tangent line, according to different hazard levels sound, the warning signal such as image, vibrations, or three kinds of signals send simultaneously.
The present invention adopts advanced computer vision algorithm for pattern recognition, in conjunction with high speed digital signal processor to vehicle-mounted camera driving road-condition real-time analysis, can predict vehicle will run-off-road, also in unconscious situation about doing like this, send vision to chaufeur but driver is actual, the warning of the sense of hearing or sense of touch aspect, take care and travel with prompting driver, effectively minimizing accident occurs.