A kind of lane detection method improved Gabor transformation and update end point
Technical field
The invention belongs to image processing field, and apply to the lane detection method of automatic DAS (Driver Assistant System), using changing
Method into Gabor transformation and update end point detects track, improve to the accuracy rate of unstructured road lane detection and
Real-time.
Background technology
Lane detection technology is widely used in advanced auxiliary driving field, is that track keeps auxiliary system (Lane
Keeping assist system), the basis of Lane Departure Warning System (Lane departure warning system)
Part.In advanced auxiliary driving field, lane detection technology is often used in structured road, and detection result is apparent,
It is influenced by Development of Urbanization progress, China cities and towns unstructured road accounts for most, and the track of unstructured road is examined
Survey is all important research contents all the time.
Existing lane detection technology species is various, such as the lane detection method based on adaptive area-of-interest, main
If tracking track is fitted into driveway line by Hough transform and least square method;Statistics Hough based on gradient constraint becomes
Lane detection method is changed, the method that Hough transformation is counted by gradient constraint condition detects track, reduces cumbersome edge inspection
It surveys, but since Hough transformation is to the more demanding of lane line, can only use on a highway, there is limitation.However these
Method but and does not apply to the lane detection of unstructured road.
For the lane detection problem of unstructured road, image texture characteristic is generally extracted using Gabor filtering, then
Track is detected according to feature.But there is the shortcomings that detection feature definition is not high, and real-time is poor in traditional Gabor transformation, it is impossible to full
The requirement of the instantly automatic DAS (Driver Assistant System) of foot.The too many difficulty in computation of textural characteristics data simultaneously after Gabor transformation is very big,
Elapsed time is long.
The content of the invention
There is, real-time inaccurate to unstructured road lane detection the present invention is to solve existing lane detection method
The problem of poor, provides a kind of lane detection method based on improvement Gabor transformation and update end point, improves to non-structural
Change the accuracy rate and real-time of Road Detection.Specifically include following steps:
Step 1, original road image is inputted;
Step 2, gray processing pretreatment is carried out to original image;
Step 3, using the multiple dimensioned multi-direction extraction gray level image textural characteristics of improved two-dimensional Gabor filtering;
Step 4, image texture characteristic principal component is analyzed, draws the textural characteristics being affected to end point;
Step 5, initial vanishing Point Detection Method is carried out with soft ballot method according to the image texture characteristic that step 4 determines;
Step 6, the initial end point detected according to step 5 is utilized updates end point based on the histogram of differential seat angle and aberration
And determine lane line;
Step 7, track scope is determined according to end point and lane line new in step 6.
Further, it is to the realization method of original image progress gray processing pretreatment in step 2,
I=0.3R+0.59G+0.11B (1)
Wherein R, G, B represent that three passages of input color image are red, green, blue respectively respectively, after I is then gray proces
The gray level image of output.
Further, the realization side of the improved two-dimensional Gabor filtering method extraction image texture characteristic described in step 3
Formula is:
Wherein symbol * represents two-dimensional convolution computing, Iω,φ(z) gray level image, ψ are representedω,φ(z)rAnd ψω,φ(z)iTable respectively
Show the real and imaginary parts of Gabor filtering;X, y represent pixel point coordinates, z=(x, y) in formula (2), and formula (3) is plural formula, bag
Containing real and imaginary parts, i represents the imaginary part in mathematical formulae, and a=xcos (φ)+ysin (φ), b=-xsin (φ)+
Ycos (φ), c are a constants, and φ represents orientation angle feature, and ω represents scale feature.
Further, the specific implementation of step 4 is as follows,
Step 401, the textural characteristics that step 3 obtains are standardized, eliminates influence of the characteristic in horizontal and dimension;
Step 402, its correlation matrix is solved according to the textural characteristics after standardization;
Step 403, the characteristic root and feature vector of correlation matrix, eigenvalue λ are solvedi, i=1,2p and its
Corresponding feature vector;
Step 404, principal component contributor rate is calculatedAnd contribution rate of accumulative totalWhen accumulative
Contribution rate is more than 90%, then it is assumed that this feature is affected to the detection of end point.
Further, the specific implementation of step 5 is as follows,
Step 501, confidence level delimited on the basis of the image texture characteristic drawn first in step 4, determined according to confidence level
Remaining voter;
The calculation of each pixel z confidence levels is as follows,
Wherein ri(z), i=1,2,3,36 represents ordinal value and r of the Gabor filter to 36 directions1(z)
> > r36(z), average { } represents to solve average, and Conf (z) represents confidence level;
If the value ratio that formula (4) calculatesThe value of calculating is small, wherein max tables
Show and be maximized, min expressions are minimized, then the value of the confidence level of the pixel is exactly desirable, also illustrates that the pixel is
Definite voter;
Step 502, according to angle tolerance and picture altitude, the condition model for detecting end point is established to each voter
It encloses;
Step 503, voted in condition and range using soft ballot method each pixel, the picture for score maximum of voting
Vegetarian refreshments is judged as initial end point, and the computational methods of the soft ballot method are,
Wherein, V represents end point, and P represents voter, and λ represents the distance of V to line PQ, and γ=180 are constant parameters, d
(P, V) represents the distance between P and V.
Further, the specific implementation of step 6 is as follows,
Step 601, initial end point V is detected according to step 5;
Step 602, the histogram based on differential seat angle and aberration of initial end point V is calculated, according to the maximum of histogram
Determine first boundary line;The histogram calculation method based on differential seat angle and aberration is,
Wherein N represents the quantity of remaining voter, and u is constant and u ∈ (0 °, 180 °), αiRepresent end point V and voter
piLine and the angle of horizontal ballot negative direction, D (pi) represent differential seat angle, D (Ri1,Ri2) represent tri- color channels of R, G, B
Lane boundary at aberration maximum, δ [] represent the kronecker δ function;
Wherein θiRepresent voter piCalculating direction, αiRepresent line VPiWith the angle of horizontal ballot negative direction;
D(Ri1,Ri2)=max { D (Ri1,Ri2)c| c={ R, G, B } } (8)
Wherein max { } expressions are maximized, Ri1And Ri2Refer to i-th of voter piThe company of corresponding end point V
Line is the fixed area that center line extends to the left and right sides;D(Ri1,Ri2)cRepresent two fixed area of tri- color channels of R, G, B
Aberration, mean () represent solve average, var () represent solve variance;
Step 603, the m pixels close to initial end point V of sampling on first boundary line;
Step 604, its histogram is calculated for the pixel of each sampling, finds the maximum in each histogram, and
Calculate the sum of wherein preceding n maximum;
Step 605, select and be worth maximum pixel as new end point;
Step 606, solve its histogram based on differential seat angle and aberration again to new end point, and choose in histogram
Maximum determines Article 2 boundary line.
Further, scope of track scope described in step 7 between two lane lines and new end point.
The advantages of present invention has lane detection accuracy rate high, and detection method is adaptable specific manifestation is as follows:
1) improved Gabor filter improves the precision of texture feature extraction, overcomes traditional Gabor filtering real-time
The problem of poor;
2) textural characteristics principal component is analyzed, on the basis of ensureing not changing image primitive character, reduces calculating
Amount, improves computational efficiency;
3) easy using histogram update vanishing Point Detection Method lane boundary mode, accuracy is high.
Description of the drawings
Fig. 1 is the algorithm flow chart of the embodiment of the present invention.
Fig. 2 is the image texture characteristic figure of extraction of the embodiment of the present invention.
Fig. 3 is detection end point condition and range schematic diagram of the embodiment of the present invention.
Fig. 4 is the initial vanishing Point Detection Method design sketch of the embodiment of the present invention.
Fig. 5 is differential seat angle Computing Principle schematic diagram of the embodiment of the present invention.
Fig. 6 is the final lane boundary detection result figure of the embodiment of the present invention.
Specific embodiment
Technical solution of the present invention is described further below in conjunction with attached drawing.
As shown in Figure 1, the algorithm flow chart of the embodiment of the present invention, specific implementation step is as follows:
Step 1, original road image is inputted;
Step 2, gray processing pretreatment is carried out to original image, specific implementation is
I=0.3R+0.59G+0.11B (1)
Wherein R, G, B represent that three passages of input color image are red, green, blue respectively respectively, after I is then gray proces
The gray level image of output;
Step 3, multiple dimensioned multi-direction extraction image texture characteristic is filtered using improved two-dimensional Gabor, be illustrated in figure 2
The characteristic image that image obtains after Gabor filtering process;
The realization method of described improved two-dimensional Gabor filtering method extraction image texture characteristic is:
Wherein symbol * represents two-dimensional convolution computing, Iω,φ(z) gray level image, ψ are representedω,φ(z)rAnd ψω,φ(z)iTable respectively
Show the real and imaginary parts of Gabor filtering, and two-dimensional Gabor filtering calculation is:
Wherein, x, y represent pixel point coordinates, z=(x, y) in above formula, and the two-dimensional Gabor filtering calculation of formula (3) is
One plural formula, contains real and imaginary parts, and i represents the imaginary part in mathematical formulae.A=xcos (φ)+ysin (φ),
B=-xsin (φ)+ycos (φ), c are that a constant value represents orientation angle feature for 2, φ;ω represents scale feature;
Orientation angle feature and scale feature are all the values of given range in the present embodiment, artificial settings, wherein φ ∈ (0 °,
175 °), ω ∈ (1,5).
Step 4, image texture characteristic principal component is analyzed, draws the textural characteristics being affected to end point, specifically
Realization step be:
Step 401, the textural characteristics that step 3 obtains are standardized, eliminates influence of the characteristic in horizontal and dimension;
Step 402, its correlation matrix is solved according to the textural characteristics after standardization;
Step 403, the characteristic root and feature vector of correlation matrix, eigenvalue λ are solvedi, i=1,2p and its
Corresponding feature vector;
Step 404, principal component contributor rate is calculatedAnd contribution rate of accumulative totalWhen accumulative
Contribution rate is more than 90%, then it is assumed that this feature is affected to the detection of end point;
Step 5, initial vanishing Point Detection Method is carried out with soft ballot method according to the image texture characteristic that step 4 is drawn, specifically
Realization method be:
Step 501, confidence level delimited on the basis of the image texture characteristic drawn first in step 4, determined according to confidence level
Remaining voter;
Realization method is as follows, and formula (4) is the calculation of each pixel pixel confidence, if the value ratio calculatedThe value of calculating is small, and wherein max expressions are maximized, and min expressions are minimized, on
The Δ of formula is usually to take constant 0.5, then the value of the confidence level of the pixel is exactly desirable, also just illustrates that the pixel is exactly
The voter that the present embodiment determines.
Wherein ri(z), i=1,2,3,36 represents ordinal value and r of the Gabor filter to 36 directions1(z)
> > r36(z), part only being taken to substitute into calculation amount this formula calculate to simplify, average { } represents to solve average,
Conf (z) represents confidence level;
Step 502, according to angle tolerance and picture altitude, the condition model for detecting end point is established to each voter
It encloses;
The vanishing Point Detection Method scope using the image upper left corner as coordinate origin as shown in figure 3, establish coordinate system, with X-axis
Positive direction is the horizontal ballot direction of voter, establishes vanishing Point Detection Method scope i.e. polygon PI1I2J2J1, wherein P expression ballots
Person, straight line A1B1 and straight line C1D1 are respectively that (A1B1 and C1D1 are the lane sides in original image for two borders in track
The approximate bounds that boundary is assumed), PI is vertical line, and PQ is ballot directions of the voter P along road direction A1B1, | PQ |=0.65H
(H is picture altitude) then determines straight line PJ, wherein I according to angle tolerance, and in the same horizontal line, I1, I2 are respectively by Q, J
The intersection point of triangle PIJ and straight line A1B1, J2, J1 are the point on triangle PIJ respectively, and line segment J1J2 is parallel and equal to I1I2.
In the present embodiment, angle tolerance ξ=5 °, by being manually set, altitude range between end point and voter between 0 and | PQ |
Between=0.65H, H is picture altitude.
Step 503, voted in the condition and range using soft ballot method each pixel, ballot score maximum
Pixel is judged as initial end point, and the effect of vanishing Point Detection Method is as shown in figure 4, box is initial labeled as detecting in figure
End point;
The computational methods of the soft ballot method are
Wherein V represents end point, and P represents voter, and λ represents the distance of V to line PQ, it is assumed that the V points in Fig. 3 are to detect
End point, K be VK and PQ intersection point, then λ represent V to line PQ distance, and the ordinate of V equal to K ordinate, γ=
180 be constant parameter, and d (P, V) represents the distance between P and V;
Step 6, update end point and determine lane line, updated and disappeared using the histogram based on differential seat angle and aberration
It puts and determines lane line, specific method of determination is:
Step 601, initial end point V is detected according to step 5;
Step 602, the histogram of initial end point V is calculated, first boundary line is determined according to the maximum of histogram;I.e.
Maximum is directly searched in histogram, maximum just represents first boundary line.
Step 603, m pixels for being adjacent to initial end point V of sampling on first boundary line;
Step 604, its histogram is calculated for the pixel of each sampling, finds the maximum in each histogram, and
Calculate the sum of wherein preceding n maximum;Step 605, select and be worth maximum pixel as new end point;
Step 606, solve its histogram again to new end point, and choose maximum in histogram and determine Article 2 side
Boundary line;
The histogram calculation method based on differential seat angle and aberration is,
Wherein N represents the quantity of remaining voter, and u is constant and u ∈ (0 °, 180 °), αiRepresent end point V and voter
piLine and the angle of horizontal ballot negative direction, D (pi) represent differential seat angle, D (Ri1,Ri2) represent tri- color channels of R, G, B
Lane boundary at aberration maximum, δ [] represent the kronecker δ function;
As shown in figure 5, the computational methods of differential seat angle are,
Wherein θiRepresent voter piCalculating direction, it is calculated along positive direction of the x-axis to end point, αiRepresent line
VPiWith the angle in direction of voting;
Aberration maximum value calculation mode is,
D(Ri1,Ri2)=max { D (Ri1,Ri2)c| c={ R, G, B } } (8)
Wherein max { } expressions are maximized, Ri1And Ri2Refer to i-th of voter piThe company of corresponding end point V
Fixed area that line is extended to the left and right sides for center line (in the present embodiment, which is that width is the rectangle that l height is h,
Wherein close to line VPiA line and VPiDistance for d), D (Ri1,Ri2)cTwo of expression tri- color channels of R, G, B are solid
Determine the aberration in region;
Wherein mean () represents to solve average, var () expression solution variances;
Step 7, track scope is determined according to new end point and lane line, as shown in fig. 6, the track be between
Scope between two lane lines and new end point.
Specific embodiment described herein is only to spirit explanation for example of the invention.Technology belonging to the present invention is led
The technical staff in domain can do various modifications or additions to described specific embodiment or replace in a similar way
Generation, but without departing from spirit of the invention or beyond the scope of the appended claims.