CN112001216A - Automobile driving lane detection system based on computer - Google Patents

Automobile driving lane detection system based on computer Download PDF

Info

Publication number
CN112001216A
CN112001216A CN202010504045.8A CN202010504045A CN112001216A CN 112001216 A CN112001216 A CN 112001216A CN 202010504045 A CN202010504045 A CN 202010504045A CN 112001216 A CN112001216 A CN 112001216A
Authority
CN
China
Prior art keywords
image
vehicle
lane line
line
lane
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202010504045.8A
Other languages
Chinese (zh)
Inventor
石红姣
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shangluo University
Original Assignee
Shangluo University
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shangluo University filed Critical Shangluo University
Priority to CN202010504045.8A priority Critical patent/CN112001216A/en
Publication of CN112001216A publication Critical patent/CN112001216A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V20/00Scenes; Scene-specific elements
    • G06V20/50Context or environment of the image
    • G06V20/56Context or environment of the image exterior to a vehicle by using sensors mounted on the vehicle
    • G06V20/588Recognition of the road, e.g. of lane markings; Recognition of the vehicle driving pattern in relation to the road
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/20Image preprocessing
    • G06V10/26Segmentation of patterns in the image field; Cutting or merging of image elements to establish the pattern region, e.g. clustering-based techniques; Detection of occlusion
    • G06V10/267Segmentation of patterns in the image field; Cutting or merging of image elements to establish the pattern region, e.g. clustering-based techniques; Detection of occlusion by performing operations on regions, e.g. growing, shrinking or watersheds
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/40Extraction of image or video features
    • G06V10/44Local feature extraction by analysis of parts of the pattern, e.g. by detecting edges, contours, loops, corners, strokes or intersections; Connectivity analysis, e.g. of connected components
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/40Extraction of image or video features
    • G06V10/48Extraction of image or video features by mapping characteristic values of the pattern into a parameter space, e.g. Hough transformation

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Multimedia (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Image Analysis (AREA)
  • Traffic Control Systems (AREA)

Abstract

The invention discloses a computer-based automobile driving lane detection system, which comprises a system for preprocessing a road image, wherein the color image is grayed, a grayscale image is subjected to binary segmentation by adopting a large-volume threshold value, the segmented binary image contains a large amount of interference information, large interference signals and small noise points are eliminated through a connected domain mark, then contour information of a lane line is extracted, the subsequent Hough transformation is facilitated to obtain the lane line, and finally the obtained lane line is matched with a mixed Gaussian model. The extraction of the lane lines is mainly completed by detecting and identifying the lane lines from the images, determining the safe feasible area of the vehicle on the road and positioning the position of the lane lines relative to the vehicle so as to monitor the real-time condition of the vehicle traveling. When the vehicle deviates, the driver can be reminded to adjust the state of the vehicle in time, so that traffic accidents are avoided.

Description

Automobile driving lane detection system based on computer
Technical Field
The invention relates to the technical field of automobiles, in particular to an automobile driving lane detection system based on a computer.
Background
With the continuous development of economy, the continuous progress of science and technology and the continuous improvement of living standard in China, automobiles are gradually becoming popular transportation means. According to the latest research results of German research institutions, the global automobile keeping amount is close to 10 hundred million, and the automobile keeping amount is increased by 20 percent by 2015. With the increasing popularization of automobiles and the increasing driving speed of automobiles, the number of traffic accidents is also increased. Every year traffic accidents cause huge losses to the national economy, people's lives and property. With the increasing severity of traffic safety issues, traffic safety has become a significant issue that people must take care of.
The identification of lane lines is an important branch of the field of image processing and traffic intelligence, and particularly in recent years, with the development and application of only automobiles and automatic identification, the research of lane line identification has been greatly developed, and with the increasing requirements of people on identification accuracy and speed in the future, the research of the field of lane line identification will be more and more intense, so that the field is an unprecedented research field.
Disclosure of Invention
The present invention is directed to solving the above problems and providing a computer-based lane detection system for a vehicle.
The invention realizes the purpose through the following technical scheme:
firstly, preprocessing a road image by a system, wherein the preprocessing comprises graying of a color image, then, performing binary segmentation on a gray image by adopting a large-volume threshold value, wherein the segmented binary image comprises a large amount of interference information, eliminating large interference signals and small noise points through a connected domain mark, then, extracting the outline information of a lane line, facilitating the subsequent Hough transformation to obtain the lane line, finally, matching the obtained lane line with a mixed Gaussian model, and if the matching is successful, indicating that the lane line is successfully detected and updating the parameters of the mixed Gaussian model by using the currently detected lane line; if the matching is unsuccessful, the detected lane line is incorrect, and the historical lane line information is taken as the current result;
the image preprocessing comprises the following steps: processing the gray value of the image pixel in a spatial domain by adopting median filtering, wherein the mathematical expression of the median filtering is shown as a formula 2-1:
f(i,j)=median{Sf(i,j)} (2-1)
wherein S isf(i,j)Is the neighborhood of the current point f (i, j);
and (3) image segmentation:
white dotted lines for separating traffic flow traveling in the same direction or as traffic safety distance identification lines when drawn in the road section; when the vehicle is stroked at the intersection, the vehicle is guided to move;
white solid lines for separating the motor vehicles and the non-motor vehicles running in the same direction or indicating lane lines when the white solid lines are drawn in the road section; when the vehicle is marked at the intersection, the vehicle is used as a guide lane line or a stop line;
the yellow dotted line is used for separating traffic flow running oppositely when being drawn in a road section, and is used for forbidding vehicles to park on the roadside for a long time when being drawn on the road side or the curbstone;
the yellow solid line is used for partitioning the traffic flow which runs oppositely when drawn in the road section; when the vehicle is scratched on the road side or the curb, the vehicle is prohibited from parking for a long time or temporarily on the road side;
the double white dotted lines are used as deceleration passing lines when the vehicle is drawn at the intersection; when the vehicle is drawn in a road section, the vehicle is used as a variable lane line with the driving direction changing along with time;
double yellow solid lines for separating the traffic flow of opposite driving when drawn in the road section;
yellow dotted solid line: when the road is marked in the road section, the traffic flow of opposite driving is divided. One side of the yellow solid line prohibits the vehicle from overtaking, crossing or turning, and one side of the yellow dotted line permits the vehicle to overtake, cross or turn under the condition of ensuring safety;
solid double white line: when the vehicle is drawn at the intersection, the vehicle is taken as a parking and passing line;
different thresholds are set, and the pixel points are divided into a plurality of classes. Assuming that the pixel value of an original image is f (x, y), finding a threshold value T according to a certain criterion, dividing the image into two parts, wherein the pixel value of the divided image is f (x, y)
Figure BDA0002525893110000031
When the gray value of a certain point in the image is larger than a threshold value T, setting the point to be 255 white, otherwise, setting the point to be 0 black;
setting the segmentation threshold of the target and the background of the image as T and the ratio of the number of foreground pixels in the image as omega1Average gray of μ1(ii) a The proportion of background pixel points in the image is omega2Average gray of μ2(ii) a The mean gray level of the image is denoted as μ and the inter-class variance is denoted as g.
The number of pixels in an M × N image having a gray value smaller than a threshold T is denoted by N1The number of pixels having a pixel gray level greater than the threshold T is denoted by N2Then, there are:
Figure BDA0002525893110000032
Figure BDA0002525893110000033
N1+N2=M×N (2-5)
ω12=1 (2-6)
μ=μ1×ω12×ω2 (2-7)
g=ω1×(μ-μ1)22×(μ-μ2)2 (2-8)
substituting formula (2-7) for formula (2-8) to obtain the equivalent formula:
g=ω1×ω2×(μ12)2
when the variance g is the largest, the difference between the object and the background is the largest, and the obtained gray value is the optimal threshold value. The formula for calculating the optimal threshold T by the Otsu algorithm (OTSU) can be obtained:
Figure BDA0002525893110000041
in gmin<t<gmaxEach value of t is exhausted, so that t, at which dist takes the maximum value, is the required threshold.
The invention has the beneficial effects that:
compared with the prior art, the invention has the key point of the whole system in the lane departure early warning system, namely the correct extraction and identification of lane lines. The extraction of the lane lines is mainly completed by detecting and identifying the lane lines from the images, determining the safe feasible area of the vehicle on the road and positioning the position of the lane lines relative to the vehicle so as to monitor the real-time condition of the vehicle traveling. When the vehicle deviates, the driver can be reminded to adjust the state of the vehicle in time, so that traffic accidents are avoided.
Drawings
FIG. 1 is a schematic diagram of the system architecture of the present invention;
FIG. 2 is a grayed median filtered image of the present invention;
FIG. 3 is an image binarized by the Otsu algorithm (OTSU);
FIG. 4 is a binary image after connected component labeling processing of the present invention;
FIG. 5 is a road detection map based on Hough transform of the present invention;
FIG. 6 is a Hough transform of the present invention;
FIG. 7 is a schematic view of the polar angle constraining region of the present invention;
FIG. 8 is a ROI area in an image of the present invention;
FIG. 9 is a tangent to a point on a curve derived by the least squares principle of the present invention;
FIG. 10 is a tangent to a point on a curve derived by the least squares principle of the present invention;
FIG. 11 is an ellipse detection view of the present invention.
Detailed Description
The invention will be further described with reference to the accompanying drawings in which:
in order to improve the identifiability of lane line information in an image and reduce the complexity of a lane line identification algorithm, the acquired image needs to be filtered to remove noise in the image. The image denoising process mainly adopts a smoothing technology, and mainly comprises two categories of frequency domain filtering and spatial domain filtering. The frequency domain filtering needs to convert signals from a space domain to a frequency domain, and the calculation amount is large, so that the real-time requirement of the system is difficult to meet. The spatial filtering is to process the gray value of the image pixel in the spatial domain, and is a commonly used filtering algorithm, and the commonly used spatial filtering method includes: and (6) median filtering.
Median filtering is a nonlinear processing technique that can remove noise and protect target boundary information without blurring its edges. The gray value of each pixel point is set as the median of all the gray values of the pixel points in a certain neighborhood window of the point. Therefore, the filter has better filtering effect on noise such as edge burrs caused by shaking of the automobile and damage and isolation of the automobile brake to lane marking lines. The mathematical expression for median filtering is shown in equation 2-1:
f(i,j)=median{Sf(i,j)} (2-1)
wherein S isf(i,j)Is the neighborhood of the current point f (i, j).
Most energy of an image is generally located in a low-frequency part of a signal, noise is located in a high-frequency part, and edge and detail information in the image is also located in the high-frequency part. The image of the road image after the gray scale change and the filtering is shown in fig. 2;
after being filtered, the road image contains a large amount of background interference signals. In order to extract the lane line region of interest and improve the real-time performance and accuracy of the lane line detection, it is necessary to divide the lane line region from the road image, which is a so-called image division process. Image segmentation is to select a reasonable threshold value and divide the image into a target area and a background area.
White dotted lines for separating traffic flow traveling in the same direction or as traffic safety distance identification lines when drawn in the road section; when the vehicle is stroked at the intersection, the vehicle is guided to move;
white solid lines for separating the motor vehicles and the non-motor vehicles running in the same direction or indicating lane lines when the white solid lines are drawn in the road section; when the vehicle is marked at the intersection, the vehicle is used as a guide lane line or a stop line;
the yellow dotted line is used for separating the traffic flow of opposite driving when being marked in the road section, and is used for prohibiting the vehicle from parking on the roadside for a long time when being marked on the road side or the curbstone.
The yellow solid line is used for partitioning the traffic flow which runs oppositely when drawn in the road section; when the vehicle is scratched on the road side or the curb, the vehicle is prohibited from being parked on the road side for a long time or temporarily.
The double white dotted lines are used as deceleration passing lines when the vehicle is drawn at the intersection; when the vehicle is drawn in a road section, the vehicle is used as a variable lane line with the driving direction changing along with time;
double yellow solid lines for separating the traffic flow of opposite driving when drawn in the road section;
and yellow dotted solid lines for separating the traffic flow of the opposite driving when drawn in the road section. One side of the yellow solid line prohibits the vehicle from overtaking, crossing or turning, and one side of the yellow dotted line permits the vehicle to overtake, cross or turn under the condition of ensuring safety;
and a double-white solid line is used as a parking and passing line when the vehicle is drawn at the intersection.
2.2.1 simple thresholding
Threshold segmentation is a region-based image segmentation technique, whose basic principle is: different thresholds are set, and the pixel points are divided into a plurality of classes. Assuming that the pixel value of an original image is f (x, y), finding a threshold value T according to a certain criterion, dividing the image into two parts, wherein the pixel value of the divided image is f (x, y)
Figure BDA0002525893110000061
When the gray value of a certain point in the image is larger than the threshold value T, the point is set to be 255 (white), otherwise, the point is set to be 0 (black).
Image segmentation based on maximum inter-class variance method (OTSU)
The method of variance between the largest classes was proposed in 1979 by Otsu university of Japan, also known as Otsu's algorithm (OTSU). The Otsu algorithm (OTSU) is a global threshold selection method, which is derived based on the discriminant analysis least square principle, and is a widely used image segmentation algorithm because of its simple algorithm.
In an image, the variance is one of measures of whether the gray distribution is uniform. The larger the variance, the larger the difference between the background and the object in the image. When some background regions are wrongly classified as objects or some object regions are wrongly classified as backgrounds, the difference between the background and the objects becomes small. Therefore, the image segmentation with the largest inter-class variance is adopted, and the probability of wrong classification is minimized.
Assuming that the segmentation threshold of the target and the background of the image is T, and the ratio of the number of foreground pixels in the image is omega1Average gray of μ1(ii) a The proportion of background pixel points in the image is omega2Average gray of μ2(ii) a The mean gray level of the image is denoted as μ and the inter-class variance is denoted as g.
The number of pixels in an M × N image having a gray value smaller than a threshold T is denoted by N1The number of pixels having a pixel gray level greater than the threshold T is denoted by N2Then, there are:
Figure BDA0002525893110000071
Figure BDA0002525893110000072
N1+N2=M×N (2-5)
ω12=1 (2-6)
μ=μ1×ω12×ω2 (2-7)
g=ω1×(μ-μ1)22×(μ-μ2)2 (2-8)
substituting formula (2-7) for formula (2-8) to obtain the equivalent formula:
g=ω1×ω2×(μ12)2
when the variance g is the largest, the difference between the object and the background is the largest, and the obtained gray value is the optimal threshold value. The formula for calculating the optimal threshold T by the Otsu algorithm (OTSU) can be obtained:
Figure BDA0002525893110000081
in gmin<t<gmaxEach value of t is exhausted, so that t, at which dist takes the maximum value, is the required threshold. The image binarized by the Otsu algorithm (OTSU) is shown in FIG. 3:
connected component tagging
The binary image has much information which is not needed by people, and in order to highlight the lane line information, connected domain marking can be carried out on the binary image, and white areas with too many and too few white pixel points are removed to extract the lane line areas which are interested by people. The connected domain marking is to mark the continuous region as the same one, and common algorithms include a four-neighborhood marking algorithm and an eight-neighborhood marking algorithm. These two methods are described below.
Four neighborhood labeling algorithm:
1. judging the leftmost of four neighborhoods of the point, judging whether the point exists at the top, and if the points do not exist at all, indicating the beginning of a new area.
2. If the leftmost point in the four neighborhoods of the point exists and the uppermost point does not exist, marking the point as the value of the leftmost point; if there is no point to the left of the four neighbors of this point, the top point, then this point is marked as the value of the top point.
3. If there is a point at the leftmost and at the uppermost of the four neighbors of this point, then this point is marked as the smallest marked point of the two, and the large marker is modified to be the small marker.
Eight neighborhood labeling algorithm:
1. and judging the conditions of the leftmost point, the upper left point, the uppermost point and the upper right point in the eight neighborhoods of the point. If there is no point, it indicates the start of a new region.
2. If there is a point to the left most in this eight neighborhood of points, and there are points to the top right, then mark this point as the smallest marked point of the two, and modify the large mark as the small mark.
3. If there is a point at the top left and a point at the top right in this eight neighborhood of points, then mark this point as the smallest marked point of the two, and modify the large mark as the small mark.
4. Otherwise, mark the point as one of four in the order of leftmost, upper left, uppermost, upper right.
The binary image after the connected component labeling process is shown in fig. 4:
the edges of the image are the basic features of the image, often present between the object and the background. There is typically a step or roof-like transition in the pixel gray levels near the edge points. Edge extraction methods are divided into two categories: one is an extraction method based on image edge fitting operators; the other is based on finding the image edges by differential operators, and filter templates are heavily used in this type of algorithm.
Edge extraction is a fundamental and important step in image processing, and is the basis of image recognition. The lane line edge in the road image is a pixel set in which the pixel gray level between the lane line and the road surface has a roof change or a step change, and is one of the basic features of the lane line. Commonly used edge extraction operators are the Roberts operator, Sobel operator, Laplace operator, Krisch operator, Prewitt operator, and Canny operator.
The Sobel operator is mainly used for edge detection. Technically, it is a discrete difference operator used to calculate the approximate value of the gradient of the image brightness function. Using this operator at any point in the image will produce the corresponding gradient vector or its normal vector.
The Sobel operator contains two 3 × 3 matrices, and the horizontal and vertical luminance difference approximations can be obtained by convolving the two matrices with the image, as shown in the following table.
Figure BDA0002525893110000091
If an original image is represented by A and the images with the detected lateral and longitudinal edges are represented by Gx and Gy, respectively, the calculation methods are as the following equations (2-11) and (2-12):
Figure BDA0002525893110000092
Figure BDA0002525893110000101
the magnitude of the gradient can be calculated using the formula (2-13) for the lateral and longitudinal gradient values for each pixel of the image.
Figure BDA0002525893110000102
In general, an approximate calculation formula (2-14) is also used to increase the calculation speed:
|G|=|Gx|+|Gy| (2-14)
the gradient direction can be calculated with the following formula:
Figure BDA0002525893110000103
if the angle theta is equal to zero, this indicates that the image has a longitudinal edge there, and is darker to the left and to the right.
The edge extraction effect of the Sobel operator is shown in FIG. 5, a) is a source image, b) is an X-direction edge detection result, and c) is a Y-direction edge detection result
Hough transform, proposed by Paul Hough in 1468 years, is a target detection method based on image global statistical characteristics, and Hough transform detects straight lines and curves in an image by using the transformation between two different coordinate systems. It maps a straight line in image space to a point in parameter space and then performs cumulative voting on the point, thus obtaining a peak value in parameter space. After Hough transform, the detection problem of the straight line is converted into the statistical problem of the parameter space peak value, and the extracted peak value is fitted into a required straight line equation through inverse transform.
A general straight line is represented by the slope k and the intercept b, i.e. by the equation y-kx + b. If the N edges of the detected line are represented as:
(x0,y0)、(x1,y1)、…(xn-1,yn-1)
assuming that the equation expression of the straight line is y ═ kx + b, then n equations can be obtained:
y0=kx0+b、y1=kx1+b、…yn-1=kxn-1+b
and recording the value of each possible straight line by using a counter num [ k ] [ b ], wherein the straight line y which corresponds to the maximum value in num is kx + b which is the optimal solution of the straight line to be solved.
In view of the fact that the value range of the slope (k) is difficult to determine by the method, if the value of the slope k is too thin, the calculation amount is large, and conversely, if the value of the slope k is too thick, the accuracy of the required straight line is insufficient. Any straight line in image space can be represented by polar coordinates, as shown in equation 3-1:
ρ=xcosθ+ysinθ (3-1)
where ρ is the distance of the straight line l relative to the origin of coordinates, and θ is the angle between the straight line l and the x-axis.
As shown in fig. 6, a point on the rectangular coordinate space is transformed to the polar coordinate space, and is a sine curve, and the curves corresponding to the points on the same straight line on the rectangular coordinate space in the polar coordinate space all intersect at a point.
After the image is preprocessed through filtering, binaryzation, region-of-interest extraction, edge extraction and the like, the lane line can be obtained through Hough transformation, but the traditional Hough transformation is large in calculation amount and difficult to meet real-time requirements. The improved Hough transformation is adopted, the calculation amount of the improved transformation is greatly reduced, and the detection effect is good.
The Hough transform has obvious advantages, but it also has some non-negligible disadvantages:
1. the calculation amount is large. The traditional Hough transformation needs to calculate each point, so that the calculation amount is large, a large amount of redundant data can be generated, and when the Hough transformation is used for detecting circles or other images, the calculation amount is increased rapidly due to the increase of parameters (for example, the circles need 3 parameters), so that the real-time performance of the Hough transformation is low;
2. although Hough transform energy conversion obtains a parameter equation of a straight line, the Hough transform energy conversion cannot determine the starting point and the ending point of the straight line, namely cannot determine whether the straight line is continuous or not;
3. noise points in the image have a large influence on the result of the Hough transform.
For the above defects, the Hough transform needs to be improved to a certain extent so as to better complete the expected work;
general lane lines are distributed on the left side and the right side of a road image and are obtained through a large number of experimental tests: the value of the left lane line theta 1 is between 20 and 70 degrees, the value of the right lane line theta 2 is between 120 and 170 degrees, and the region is called as a polar angle constraint region. Only polar angle constrained regions are considered when processing and Hough transforming the image. As shown in fig. 7 for the polar angle constrained region of the image.
The polar angle constraint area is established, so that the signal of a noise straight line can be greatly reduced, and the accuracy of lane line detection is increased. The traditional Hough transformation transforms edge points in an image space within (0-180) degrees, and then votes and accumulates on straight lines corresponding to a parameter space, wherein peak points accumulated in the parameter space are straight line equations of lane lines. To improve the calculation speed of Hough transformation, the number of edge points can be reduced, and the theta transformation range can be reduced. The limit of the polar angle constraint area just reduces the theta transformation range, so the operation speed of transformation is accelerated.
Lane line information is typically in the lower half of the image, or the lower half of the camera view area. The region of interest (ROI) is established by determining the region range in which the lane line may exist under a space rectangular coordinate system, so that the time for detecting the lane line is shortened, and the detection speed and the real-time property are improved.
And establishing a rectangular coordinate system for the image, wherein the origin of coordinates is at the center of the image, and a rectangular area with the width of W is respectively arranged on the left side and the right side away from the width of the origin of coordinates X. These two rectangular regions are the ROIs we have established, as shown in fig. 8;
the position of the dynamic region of interest is not fixed and needs to be adjusted and updated in real time. According to the low-pass filtering principle, we adjust these two parameters according to equations 3-2 and 3-3:
X(t+1)=β·p(t)+(1-β)X(t) (3-2)
W(t+1)=β·q(t)+(1-β)W(t) (3-3)
wherein p (t) and q (t) are the positions of the lane lines in the previous frame of image, and β is a parameter update constant.
Least squares (also known as the least squares method) is a mathematical optimization technique. It finds the best match function for the data by minimizing the sum of the squares of the errors. Unknown data can be easily obtained by the least square method, and the sum of squares of errors between these obtained data and actual data is minimized. The least square method can also be used in the field of curve fitting and other primary application.
Assuming that there are several points in the image that are near a straight line, the equation for this straight line is:
Yj=kxi+b
k is the slope of the line and b is the intercept.
To find k and b, the measured value Y is measured according to the principle of least squaresiAnd YjDispersion (Y) ofiSum of squares sigma (Y) of-Yji-Yj)2The minimum is used as the optimal criterion.
Order to
Figure BDA0002525893110000131
When in use
Figure BDA0002525893110000132
At the minimum, we make partial derivatives for k and b, respectively, making these two partial derivatives equal to 0:
Figure BDA0002525893110000133
Figure BDA0002525893110000134
the two partial derivatives are equal to 0, i.e.:
Figure BDA0002525893110000135
Figure BDA0002525893110000136
substituting the result of the summation into the original linear equation to obtain a linear equation obtained by fitting:
Figure BDA0002525893110000137
similarly, the tangent equation at a point on the circle in the image can be determined in the same way.
Although the least square method can conveniently obtain a tangent line of a point on a circle, it is required to know that the correctness of the tangent line is greatly related to the size of a sample of the point, if the sample is too small, the calculation error becomes large, a correct result is probably not obtained, and if the sample is too large, the calculation amount is increased, so that the selection of the size of the sample is a non-negligible problem.
Fig. 9, 10 show the tangent line of a point on the curve according to the principle of least squares:
according to the analysis, after the road lane line is collected by the image collecting device, the original circle of the road lane line is changed into an ellipse, so that the detection of the ellipse is more concerned.
Further discussing ellipse detection based on the Hough circle detection algorithm, since the normal of a point on the ellipse does not pass through the center of the ellipse, the above circle detection algorithm cannot be directly applied to ellipse detection, and further improvement is needed. According to the nature of the ellipse: the straight line defined by the intersection point of the normal lines of the two points on the ellipse and the midpoint of the two points passes through the center of the ellipse. We can naturally adapt the circle detection algorithm to the detection of ellipses.
The process of ellipse detection is described as:
the first step is as follows: selecting three random points on the target graph and respectively marking as P1、P2And P3And find their respective tangent lines, respectively denoted as T1、T2、T3And the midpoint between them, respectively denoted as C1-2、C1-3And C2-3(C1-2Is namely P1And P2Midpoint of);
the second step is that: finding out the intersection point of the three tangent lines, and recording as J1-2、J1-3And J2-3(J1-2Is T1And T2The intersection of (a) and so on);
the third step: connecting the corresponding intersection point to the midpoint, i.e. C1-2And J1-2、C1-3And J1-3、C2-3And J2-3The obtained straight lines are respectively marked as L1-2、L1-3And L2-3
The fourth step: obtaining the intersection point of the three connecting lines intersected with each other, judging whether the three connecting lines are close enough or not according to a certain distance criterion, if so, indicating that the shape at the moment is possibly an ellipse, otherwise, indicating that the shape is not;
the fifth step: selecting one point on the target graph, solving a tangent line of the point, and re-pairing the tangent line with one point of other three points to obtain a linear equation of the intersection point and the midpoint of the two tangent lines;
and a sixth step: and judging whether the intersection points of the newly obtained straight line and other straight lines are close enough or not according to the same distance criterion, if so, indicating that the target graph is an ellipse, and if not, indicating that the target graph is not an ellipse.
FIG. 11 shows the result of ellipse detection according to this method;
as can be seen from the figure, the method can correctly detect the ellipse in the image, and the correctness and the reliability of the method are illustrated.
The lane line can be detected after the road image is preprocessed and Hough transformed, and in order to improve the robustness and stability of the whole system, a Gaussian mixture model is adopted to predict and track the lane line information. The Gaussian mixture model can detect and maintain the lane lines in the road image in real time, and can effectively solve the influence of factors such as large-scale turning of the lane, jitter caused by uneven road surface and the like.
Due to the limited driving speed of the vehicle, the position of the same lane line target in the two previous and next frames of images changes slowly, namely, the position of the detected lane line in the current frame should be near the historical position of the detected lane line in the sequence image. From this conclusion, the existence range of the current lane line position can be estimated. Therefore, the method for correcting the positions of the detected lane lines is provided, and the correction method is that when the positions of the lane lines obtained by two adjacent detections are not changed greatly, the detected lane lines are considered to be correct; and when the positions of the lane lines obtained by two adjacent detections are changed greatly, discarding the current detection result, taking the historical lane line result, and modeling the historical lane line through a Gaussian mixture model.
The single Gaussian model is a common processing method for background extraction in image processing and is suitable for occasions with single and unchanged background. The method is used for respectively establishing models of single Gaussian distribution representation for the left lane line and the right lane line, the slope of the lane lines theoretically conforms to the Gaussian distribution with the mean value of mu and the standard deviation of sigma, and the distribution of each lane line is independent. Setting a single Gaussian model corresponding to each lane line in the road image as a formula 4-1:
Figure BDA0002525893110000151
wherein x isiShowing the slope of the ith lane line. p (x)i) Representing the probability that the lane line slope is a true value. When probability p (x)i)>And when T (T is a set threshold), judging that the lane line is the acquired real lane line, otherwise, considering that the lane line is detected wrongly.
For updating the single Gaussian model, only the corresponding parameters of Gaussian distribution need to be updated. After the lane line is detected, the slope of the lane line is updated according to a certain updating rule, the unmatched lane line still keeps the original value, and the speed of model updating is represented by an updating rate alpha. The formula for updating the mean μ and standard deviation σ is as follows:
μi=(1-α)μi-1+αxi (4-2)
i 2=(1-α)i-1 2+α(xii)2 (4-3)
the size of alpha represents the speed of updating the model, and the value range of alpha is between [0 and 1 ]. When the value of alpha is small, the updating speed of the model is slow, and long time is needed to adapt to the change of the environment; when the value of alpha is large, the model updating speed is high, but noise is easily introduced.
Gaussian mixture background modeling
If the driving speed is low and the environment change is slow, the single Gaussian background model can sufficiently estimate the background model for one lane line. However, in practical situations, the environment changes rapidly, the background is not static, and multiple gaussian models are often used for description. Because of the complex natural environment, the change of the slope of the lane line does not smoothly transit from one single peak to another single peak, but often has a plurality of peaks, and switches among a plurality of single gaussian models, wherein the probability of occurrence of each single gaussian model is similar in magnitude.
For such a complex background model, a single model is used to describe the possible errors, and the change of the slope of the lane line cannot be reflected well. By means of the single-Gaussian modeling idea, a plurality of single-Gaussian models can be established for the change of the slope of the lane line to respectively describe various different change conditions. The Gaussian mixture model is an extension of a single Gaussian model, and the method comprises three stages: establishing a background model, judging the background model and updating the background model.
Establishment of background model
The background model is mainly established by determining three parameters of a mean value mu, a variance sigma and a weight omega. The mean and variance may be taken as the mean and variance of the slope of the lane lines in the previous N frames of images, as shown in equations 4-4 and 4-5:
Figure BDA0002525893110000171
Figure BDA0002525893110000172
wherein KiIs the lane line slope in the ith frame image. The method for solving the mean value and the variance needs to count the slope of a lane line in the previous N frames of images, the initialization speed is related to the selected N, the true values of the mean value and the variance cannot be well obtained if the N is too small, and a large amount of time is consumed if the N is too large. To speed up the initialization, the weights can be obtained in a simple way.
Figure BDA0002525893110000173
M is the number of the selected Gaussian models, and 3-7 Gaussian models are generally selected.
Some methods select the slope of the lane line in the first frame image as an initial value, set a large weight for the gaussian model, take zero for the remaining gaussian model mean values, and take equal values for the remaining weights on the premise that the sum of all the gaussian model weights is 1.
Determination of background model
Each gaussian distribution is assigned a respective weight ωiAccording to the ratio omega of the weight to the standard deviationiiAnd sequencing the Gaussian models, and if the sum of the weights of the first H Gaussian distributions is greater than a threshold value T, considering the H Gaussian models to belong to a background model (according with the slope of the lane line in the actual situation), and considering the rest other models to be a foreground model (noise interference).
Omega of Gaussian modeliiThe larger the value, the longer and more stable the slope of the lane line, and the more likely it belongs to the background image. And determining the distribution and storage of the background models in the M Gaussian models to be the foremost, sequentially matching the Gaussian models with the current frame from high priority to low priority when determining the slope of the lane line of the current frame, and if a certain background Gaussian model is similar to the background Gaussian model, determining that the lane line is real lane line information.
Updating of background models
The background model is updated by updating each parameter of the Gaussian model. If the slope of the current lane line is matched with a single Gaussian model in the Gaussian models, selecting the optimal matching single Gaussian model, wherein the updating method comprises the following steps:
firstly, updating the weight omega of the unmatched single Gaussian modeliThe update formula is as follows:
ωi,t=(1-α)ωi,t-1 (4-7)
where α is a constant between 0 and 1, the updated weight becomes smaller, indicating that its influence on the model becomes weaker.
Then, updating the matched Gaussian model, and updating the Gaussian model by using the currently detected lane slope, wherein the updating formula is as follows:
μi,t=(1-λ)μi,t-1+λKi (4-8)
Figure BDA0002525893110000181
λ=αη(Kii,t-1i,t-1) (4-10)
α reflects the learning speed of the model, and the larger the value thereof, the faster the model update rate, and the smaller the value thereof, the slower the model update rate.
The foregoing shows and describes the general principles and features of the present invention, together with the advantages thereof. It will be understood by those skilled in the art that the present invention is not limited to the embodiments described above, which are described in the specification and illustrated only to illustrate the principle of the present invention, but that various changes and modifications may be made therein without departing from the spirit and scope of the present invention, which fall within the scope of the invention as claimed. The scope of the invention is defined by the appended claims and equivalents thereof.

Claims (1)

1. A computer-based automobile driving lane detection system is characterized in that: firstly, preprocessing a road image by a system, wherein the preprocessing comprises graying a color image, then performing binary segmentation on a gray image by adopting a large-volume threshold, wherein the segmented binary image comprises a large amount of interference information, eliminating large interference signals and small noise points through a connected domain mark, then extracting the outline information of a lane line, facilitating subsequent Hough transformation to obtain the lane line, finally matching the obtained lane line with a Gaussian mixture model, and if the matching is successful, indicating that the lane line is successfully detected and updating the Gaussian mixture model parameters by using the currently detected lane line; if the matching is unsuccessful, the detected lane line is incorrect, and the historical lane line information is taken as the current result;
the image preprocessing comprises the following steps: processing the gray value of the image pixel in a spatial domain by adopting median filtering, wherein the mathematical expression of the median filtering is shown as a formula 2-1:
f(i,j)=median{Sf(i,j)} (2-1)
wherein S isf(i,j)Is the neighborhood of the current point f (i, j);
and (3) image segmentation:
white dotted lines for separating traffic flow traveling in the same direction or as traffic safety distance identification lines when drawn in the road section; when the vehicle is stroked at the intersection, the vehicle is guided to move;
white solid lines for separating the motor vehicles and the non-motor vehicles running in the same direction or indicating lane lines when the white solid lines are drawn in the road section; when the vehicle is marked at the intersection, the vehicle is used as a guide lane line or a stop line;
the yellow dotted line is used for separating traffic flow running oppositely when being drawn in a road section, and is used for forbidding vehicles to park on the roadside for a long time when being drawn on the road side or the curbstone;
the yellow solid line is used for partitioning the traffic flow which runs oppositely when drawn in the road section; when the vehicle is scratched on the road side or the curb, the vehicle is prohibited from parking for a long time or temporarily on the road side;
the double white dotted lines are used as deceleration passing lines when the vehicle is drawn at the intersection; when the vehicle is drawn in a road section, the vehicle is used as a variable lane line with the driving direction changing along with time;
double yellow solid lines for separating the traffic flow of opposite driving when drawn in the road section;
yellow dotted solid line: when the road is marked in the road section, the traffic flow of opposite driving is divided. One side of the yellow solid line prohibits the vehicle from overtaking, crossing or turning, and one side of the yellow dotted line permits the vehicle to overtake, cross or turn under the condition of ensuring safety;
solid double white line: when the vehicle is drawn at the intersection, the vehicle is taken as a parking and passing line;
different thresholds are set, and the pixel points are divided into a plurality of classes. Assuming that the pixel value of an original image is f (x, y), finding a threshold value T according to a certain criterion, dividing the image into two parts, wherein the pixel value of the divided image is f (x, y)
Figure FDA0002525893100000021
When the gray value of a certain point in the image is larger than a threshold value T, setting the point to be 255 white, otherwise, setting the point to be 0 black;
setting the segmentation threshold of the target and the background of the image as T and the ratio of the number of foreground pixels in the image as omega1Average gray of μ1(ii) a The proportion of background pixel points in the image is omega2Average gray of μ2(ii) a The mean gray level of the image is denoted as μ and the inter-class variance is denoted as g.
The number of pixels in an M × N image having a gray value smaller than a threshold T is denoted by N1The number of pixels having a pixel gray level greater than the threshold T is denoted by N2Then, there are:
Figure FDA0002525893100000022
Figure FDA0002525893100000023
N1+N2=M×N (2-5)
ω12=1 (2-6)
μ=μ1×ω12×ω2 (2-7)
g=ω1×(μ-μ1)22×(μ-μ2)2 (2-8)
substituting formula (2-7) for formula (2-8) to obtain the equivalent formula:
g=ω1×ω2×(μ12)2
when the variance g is the largest, the difference between the object and the background is the largest, and the obtained gray value is the optimal threshold value. The formula for calculating the optimal threshold T by the Otsu algorithm (OTSU) can be obtained:
Figure FDA0002525893100000031
in gmin<t<gmaxEach value of t is exhausted, so that t, at which dist takes the maximum value, is the required threshold.
CN202010504045.8A 2020-06-05 2020-06-05 Automobile driving lane detection system based on computer Pending CN112001216A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010504045.8A CN112001216A (en) 2020-06-05 2020-06-05 Automobile driving lane detection system based on computer

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010504045.8A CN112001216A (en) 2020-06-05 2020-06-05 Automobile driving lane detection system based on computer

Publications (1)

Publication Number Publication Date
CN112001216A true CN112001216A (en) 2020-11-27

Family

ID=73467885

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010504045.8A Pending CN112001216A (en) 2020-06-05 2020-06-05 Automobile driving lane detection system based on computer

Country Status (1)

Country Link
CN (1) CN112001216A (en)

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112699834A (en) * 2021-01-12 2021-04-23 腾讯科技(深圳)有限公司 Traffic identification detection method and device, computer equipment and storage medium
CN113033418A (en) * 2021-03-25 2021-06-25 南京工程学院 Lane departure early warning method suitable for mobile terminal
CN113223034A (en) * 2021-05-17 2021-08-06 曲阜师范大学 Road edge detection and tracking method
CN113392794A (en) * 2021-06-28 2021-09-14 北京百度网讯科技有限公司 Vehicle over-line identification method and device, electronic equipment and storage medium
CN113815608A (en) * 2021-09-24 2021-12-21 上汽通用五菱汽车股份有限公司 Lane keeping method, apparatus and computer-readable storage medium
CN114972276A (en) * 2022-06-05 2022-08-30 长沙烽铭智能科技有限公司 Automatic driving distance judgment algorithm for vehicle
GB2616597A (en) * 2022-03-10 2023-09-20 Continental Automotive Tech Gmbh Method and system for identifying rows of objects in images

Cited By (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112699834A (en) * 2021-01-12 2021-04-23 腾讯科技(深圳)有限公司 Traffic identification detection method and device, computer equipment and storage medium
CN113033418A (en) * 2021-03-25 2021-06-25 南京工程学院 Lane departure early warning method suitable for mobile terminal
CN113223034A (en) * 2021-05-17 2021-08-06 曲阜师范大学 Road edge detection and tracking method
CN113392794A (en) * 2021-06-28 2021-09-14 北京百度网讯科技有限公司 Vehicle over-line identification method and device, electronic equipment and storage medium
CN113392794B (en) * 2021-06-28 2023-06-02 北京百度网讯科技有限公司 Vehicle line crossing identification method and device, electronic equipment and storage medium
CN113815608A (en) * 2021-09-24 2021-12-21 上汽通用五菱汽车股份有限公司 Lane keeping method, apparatus and computer-readable storage medium
CN113815608B (en) * 2021-09-24 2023-08-29 上汽通用五菱汽车股份有限公司 Lane keeping method, apparatus and computer readable storage medium
GB2616597A (en) * 2022-03-10 2023-09-20 Continental Automotive Tech Gmbh Method and system for identifying rows of objects in images
CN114972276A (en) * 2022-06-05 2022-08-30 长沙烽铭智能科技有限公司 Automatic driving distance judgment algorithm for vehicle

Similar Documents

Publication Publication Date Title
CN112001216A (en) Automobile driving lane detection system based on computer
Marzougui et al. A lane tracking method based on progressive probabilistic Hough transform
Bilal et al. Real-time lane detection and tracking for advanced driver assistance systems
CN107730520B (en) Lane line detection method and system
CN110298216B (en) Vehicle deviation alarm method based on lane line gradient image self-adaptive threshold segmentation
Huang et al. Vehicle detection and inter-vehicle distance estimation using single-lens video camera on urban/suburb roads
Huang et al. On-board vision system for lane recognition and front-vehicle detection to enhance driver's awareness
CN111563412B (en) Rapid lane line detection method based on parameter space voting and Bessel fitting
CN104899554A (en) Vehicle ranging method based on monocular vision
CN105654073B (en) A kind of speed automatic control method of view-based access control model detection
CN108052904B (en) Method and device for acquiring lane line
Daigavane et al. Road lane detection with improved canny edges using ant colony optimization
CN103310435B (en) Combine vertical projection and optimal path the method split characters on license plate
CN111580131A (en) Method for identifying vehicles on expressway by three-dimensional laser radar intelligent vehicle
CN105426868A (en) Lane detection method based on adaptive region of interest
CN102982304A (en) Method and system used for detecting vehicle positions by means of polarized images
CN109886168B (en) Ground traffic sign identification method based on hierarchy
CN107133588A (en) Vehicle identification method based on vehicle window feature extraction
CN114863376A (en) Road marking segmentation method and system based on vehicle-mounted laser point cloud data
Chen et al. A novel lane departure warning system for improving road safety
Jiang et al. Lane line detection optimization algorithm based on improved Hough transform and R-least squares with dual removal
Wang et al. Lane detection based on two-stage noise features filtering and clustering
CN110889342B (en) Identification method of deceleration strip
CN109285169A (en) A kind of roadside assistance equipment side coil based on wheel identification drags and leads abductive approach
KR101347886B1 (en) Method and Apparatus for Road Lane Recognition by Surface Region and Geometry Information

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication