Summary of the invention
The susceptibility disturbing for reducing lane detection algorithm road pavement icon, shelter or illumination variation etc., strengthen the adaptivity that algorithm changes road environment, the invention provides a kind of adaptive straight turning of road environment road detection method based on connected component and circulation Hough conversion.Its main thought is: first, according to the feature on road surface, image is done to self-adaptation depreciation filtering processing, to reduce the noise effect producing due to Uneven road, shade etc. in image; Secondly, be the feature of connected component according to interference icon borders such as road surface word, direction arrows in image, propose the interference cancellation algorithm based on connected component, strengthen the antijamming capability of road pavement icon and shelter; Finally, use circulation Hough conversion to find the suitableeest Hough conversion threshold value, improve the adaptivity of algorithm to environmental change.
Suppose that video camera is arranged in the middle of vehicle front windshield and towards dead ahead, the angle of pitch of video camera, angle of drift, rotation angle are zero.The technical scheme that the present invention solves its technical matters is:
Step 1-passage extracts and intercepts:
Color characteristic according to lane line in picture, extracts the red channel of former picture, and then level intercepts the road picture within the scope of certain distance.
Border is processed and is extracted in the filtering of step 2-self-adaptation depreciation:
According to the road picture contents selection adaptive threshold after intercepting, by pixel value in picture therewith threshold value do difference operation, and by the negative value pulverised after difference operation, use Canny method to extract border.
The interference cancellation processing of step 3-based on connected component:
If historical lane information is effective, be history of existence data and nearer apart from the present frame time, picture after treatment step 2 is divided into the region that may have lane line and the region that can not have lane line, point another name they be Probability Area and non-Probability Area, by the pixel value pulverised in non-Probability Area; Regulation, if the equal non-zero of two pixel point values being close to is thought that they are adjacent, otherwise is thought that they are non-conterminous; If 2 non-zero pixels points can be linked to be a path by a series of neighbor pixels, think that they are communicated with, establish the non-zero crossing composition point set of Probability Area and non-Probability Area
ptsSet, by Probability Area with point set
ptsSetin the pixel value pulverised of point of some composition connected component.
Step 4-circulation Hough conversion:
If historical lane information is effective, choose the threshold value slightly larger than nearest frame, otherwise choose a larger threshold value, use this threshold value to carry out Hough conversion, obtain a series of scattered straight lines, if historical data effectively, is extracted road end point, otherwise regard former center picture point as end point, abandon and in scattered straight line, approach level or the straight line far away apart from end point, according to the density situation between scattered straight line and picture base intersection point, these straight lines are carried out to cluster again, and the straight line in every class is merged into straight line, if the straight line number after merging is greater than 2, extract two straight lines that gradient approaches 90 degree most, be two boundary lines in current track, if otherwise do not reach maximum iteration time, reducing threshold value re-starts Hough and converts and do same processing.
The checking of step 5-history is calculated with end point:
If if upper step obtains two straight lines and historical lane information is effective, whether reasonable according to width and the direction in historical lane information checking gained track, if rationally, calculate the intersection point of these two straight lines, be end point, these two straight lines and end point are stored in historical lane information.
The beneficial effect that the present invention has is:
1, use the denoise processing method of self-adaptation depreciation filtering to effectively reduce road rumble and shadow interference, overcome conventional smooth denoise processing method and can reduce lane line border and highlight the drawback of degree.
2, by analyzing road surface icon etc. compared with strong jamming and the disconnected characteristic of lane line, picture is done to the interference cancellation processing based on connected component, effectively removed these interference, strengthened the accuracy of detection method.
3, by historical lane information, meet the Hough conversion threshold value of current road environment by using circulation Hough conversion to obtain, make the present invention there is the adaptive ability that road environment is changed.
Embodiment
Below in conjunction with accompanying drawing with specifically practice process the present invention is further described:
Perform step to illustrate implementation process of the present invention with reference to Fig. 1:
Step 1-passage extracts and picture segmentation:
Extract original image
orgImgred channel, and do level according to the road surface within the scope of certain distance and cut apart, obtain picture
roadImg.
Step 2-depreciation is processed and Boundary Extraction:
The general smothing filtering that adopts carries out noise reduction process, but it can reduce the degree that highlights on lane line (be lane line, do not reresent later) border, and the present invention uses self-adaptation depreciation filtering method to carry out picture noise reduction process.If image roadImg, roadImg (i, j) represents the value of the capable j row of its i pixel, and the value of picture Road image surface vegetarian refreshments can be regarded as Normal Distribution by approximate, and according to the characteristic of normal distribution, depreciation is processed as follows:
Wherein,
αarbitrary number between desirable 0.5-1, the present embodiment is got
α=0.8.
Use Canny method to extract
roadImgborder, obtain picture
edgeImg, as Fig. 2 (a).
Step 3-interference cancellation:
Road surface word, arrow vehicle etc. all can produce compared with strong jamming, can cause Hough conversion to produce many error-detecting, and the present invention proposes interference cancellation algorithm based on connected component by its cancellation.From Fig. 2 (a), can see, usually, it is disconnected disturbing with lane line, so the present invention proposes the interference cancellation algorithm based on connected component.Regulation: if the equal non-zero of two pixel point values being close to is thought that they are adjacent, otherwise thought that they are non-conterminous; If 2 non-zero pixels points can be linked to be a path by some row neighbor pixels, think that they are communicated with.In the time that historical lane information is effective, the concrete implementation step of algorithm is as follows:
Step01: order
dstLinesNum=0 divides according to historical lane information
edgeImgin Probability Area
area1(non-white portion in Fig. 2 (b)) and non-Probability Area
area2(white portion in Fig. 2 (b));
Step02: will
area1with
area2the non-zero pixels point coordinate of adjacent edge is stored in
edgePts;
Step03: will
edgeImgin belong to
area2the value of pixel be made as 0, order
i=0;
Step04:
edgeImgin belong to
area1and with point
edgePts[i]the point composition connected component being communicated with, travels through this connected component, and the value of the pixel that all traversals are crossed is made as 0;
Step05: order
i=
i+ 1, if
i<
edgePts.size, forward the 04th step to, otherwise algorithm finishes.
After above five steps,
edgeImgin interference be eliminated, result is as Fig. 2 (c).
Step 4-circulation Hough conversion:
The traditional Hough conversion of fixed threshold can not adapt to the road environment of real-time change, and the present invention Hough that proposes to circulate varies one's tactics and adapts to the road environment that constantly changes.If array
thresholdVectorfor one group of selected non-negative threshold value, and by the arrangement of successively decreasing.Concrete implementation step is as follows:
Step01: if historical lane information is effective, extract so the threshold value that nearest frame uses
shresholdVector[k],if
k<=0, order
k=0, otherwise order
k=
k-1; If historical lane information is invalid, order
k=0;
Step02: use threshold value
shresholdVector[k]right
edgeImgdo Hough conversion, scattered gained straight line is deposited in
linesStoragein;
Step03: if historical lane information is effective, extract the end point of nearest frame to historical end point variable
vp, otherwise will
degeImgin with
orgImgthe coordinate of the point that central point is corresponding deposits in
vp;
Step04:
line=?
linesStorage.get(0);
Step05: calculate
lineangle with level
θwith with
vpdistance
dif,
θless or
dlarger, will
linefrom
linesStoragemiddle deletion;
Step06: if
linesStoragethe straight line that middle existence was not traversed, extracts its lower straight line and is assigned to
lineand forward the 05th step to, otherwise forward the 07th step to;
Step07: calculate
linesStoragein all straight lines with
edgeImgthe intersection point on base, is deposited in
ptsin,
ptsin point with
linesStoragein straight line corresponding one by one;
Step08: according to
ptsthe sparse situation of mid point will
lineStoragein straight line carry out cluster, be assigned to
linesClass,
linesClass[j]represent the set of a class straight line,
j=1,2 ...,
linesClass.size;
Step09: if
linesClass.size>=1, forwards the 10th step to, otherwise forwards the 12nd step to;
Step10: order
l[j]=
aVERAGE(
linesClass[j]),
j=1,2 ...,
linesClass.size, wherein
aVERAGE(...) represent a straight line set to do average calculating operation, obtain an average straight line;
Step11: if
linesClass.size>=2, finds out
lin approach two straight lines of 90 degree most, be assigned to respectively
leftLine,
rightLine, order
dstLinesNum=2; Otherwise order
thresholdVector[thresholdVector.size-1]=
thresholdVector[k], object is to prevent that the lane line from, compared with clear and make lane line damaged severe, may not occur the situation of two class straight lines always, needs to retain inferior good situation that detects a class straight line, makes
dstLinesNum=1 forwards the 12nd step to;
Step12: if
k< (
thresholdVector.size-1), order
k=
k+ 1 and forward the 02nd step to, otherwise forward the 13rd step to;
Step13: if
dstLinesNum==1 and historical lane information effective, utilize its lane width to mend out another straight line, order
dstLinesNum=2, algorithm finishes.
If now
dstLinesNum==2
leftLine,
rightLinebe two lane lines in left and right.
The checking of step 5-history and end point are calculated:
If
dstLinesNum==2, calculate
edgeImgin lane width
curW, and carry out following two steps:
If a) historical lane information is effective, extract the lane width in historical lane information
wtwo lane lines with nearest historical frames
l1,
l2if,
leftLine,
rightLinewith
l1,
l2position relationship close and
curWwith
wclose, so will
leftLine,
rightLinedeposit in historical lane information.
If b) verified by history, calculate
leftLinewith
rightLineintersection point, be the end point of present frame, deposited in historical lane information.