Lane Recognition Algorithm Using the Hough Transform Based on Complicated Conditions ()
1. Introduction
In recent years, traffic accidents caused by improper driving of drivers or fatigue driving have made the field of safe driving [1] and automatic driving [2] a hot field of research.
Computer vision is the key technology for safe driving, automatic driving and lane detection. The main task is to complete the detection and tracking of the lane line. It can provide safety for the vehicle and a more comfortable ride for passengers.
At this stage, many researchers and research centers have done a lot of research on lane line detection. For the case of lane mark detection, many approaches have been made until now. As proposed in [3],HSV color features and Hough transform are used to achieve lane detection. The techniques used for this task varied from using multi-channel ROI (Region of Interest) combined with Hough transform [4],using a combination of multi-point classification and Hough transform [5]. And reference [6] uses an algorithm that combines automatic marker-assisted recognition with Hough transform to detect and mark lane lines. Other approaches used Mid-lane Estimation (MLE) [7] with Hough transform to detect and mark lane lines.
In the case of no other sign interference in the middle of the lane line, the conventional preprocessing method combined with the Hough transform can detect and identify the lane line very well. However, if there is an arrow mark or a text mark in the middle of the lane line, the common preprocessing method will leave some noise information to interfere with the Hough transform [8] [9]. The Hough transform will produce unstable results under complicated conditions. The detection result of the lane line will be inaccurate.
In this paper, we propose a simple algorithm to eliminate inter-line marker interference. The method is divided into four parts. First, it uses Gaussian blur to remove the noise points, and then convert it to grayscale. After, DLD-threshold algorithm and correlation filter are used to remove the interference area in the middle of the lane line and extract the edge of the lane line. After, by the use of Hough transform, a linear cluster is obtained to determine the lane line distribution. The test results on the Caltech-lane dataset are provided at the end of the article and can be found to perform well in complicated conditions.
2. Details of Algorithm
2.1. Gaussian Blur
Gaussian blur [10],also known as Gaussian smoothing, often used in the preprocessing stage of image processing and computer vision algorithms. In this paper, it is used to preprocess road images, smooth out sharp noise points, and prevent noise points from affecting the judgment of the Hough transform line in the following text.
(1)
where G is the two-dimensional Gaussian function. In the image, Gaussian functions can be represented in the form of convolution.
(2)
represents the pixel coordinates in the image,
is the standard deviation of the normal distribution,
represents the input image,
is the Gaussian convolution kernel,
is the image filtered by Gaussian convolution.
The simulation results are as follow: Including the original image, the blurred image after the Gaussian blurring, where sigma is 5.
Figure 1 shows the original input map, and Figure 2 shows the output map after Gaussian convolution filtering.
2.2. Color Image Gray Processing
When the camera captures a color image, it contains three components of R, G, and B, which takes up a large space and is easily interfered by external brightness. The grayscale image has only one component and takes up little space, at the same time, considering that the human eye responds differently to different color bands. We assign different weight values to the original three channels to obtain the gray image in Figure 3.
(3)
2.3. DLD-Threshold Algorithm
In order to eliminate the interference of road signs and other signs on lane line detection, we use the DLD-threshold algorithm here.
Here, we define m as the number of rows of the image, n is the number of columns of the image,
is the average Manhattan distance between the pixels at the two edges of the lane line,
is the difference between the lane line and the local background gray value near it,
is the gray value of input
image at
,
is the gray value of the input image at
. Figure 4 shows a schematic diagram of a pixel of a local lane line.
The set of pixels on both sides of the lane line are as follows:
(4)
(5)
,
respectively represent the pixel coordinates of
,
.
represents the Manhattan distance between pixel
and pixel
,S represents the number of elements in
.
(6)
(7)
(8)
As shown in Figure 5 and Figure 6, DLD-threshold algorithm process pseudo code and flow chart are as follow.
Figure 7 show the result of the grayscale image passing through the DLD-Threshold algorithm.
2.4. Edge Extraction
In order to reduce the computational complexity, the conventional Canny edge extraction operator [11] [12] and the Sobel edge extraction operator [13] [14] are not used here, this paper use the correlation filter for unilateral extraction.
The correlation filtering algorithm [15] can be expressed as follows
(9)
where f is the input image, h is the filter template and g is the corresponding output image.
Figure 4. Lane line local pixel diagram.
Figure 7. Result maps after DLD-threshold.
(10)
Intuitive expression in the image is as follows
(11)
Here, we use the 3 * 3 correlation filter to process image.
(12)
We use a correlation filter to extract the image at a single edge, where the amplitudes are taken as −3 and 3 respectively to enhance the edge strength. The result is shown in Figure 8.
Figure 8 represents the edge extraction map of Figure 7 after the correlation filter.
Generally speaking, the lane line and the identification information are located in the middle part of the image, and a template is set to match the image with the template, leaving only valid information such as lane lines and identifiers. The result is shown in Figure 9.
2.5. Hough Transform
In 1962, Paul Hough proposed the concept of Hough transform [16] [17]. The Hough transform is a parameter estimation method that uses voting to obtain a desired detection object, and is suitable for lane detection. The essence is to map the coordinate space in the image into the Hough parameter space [18],and analyze the Hough space data by point-line duality to detect the geometry. The Hough transform can be used to detect curves, circles, lines, etc. The most widely used of Hough transform is to detect straight lines in a picture.
Figure 8. Result maps after correlation filter.
In the Cartesian coordinate system, the linear equation is generally expressed as the following form
(13)
In this equation, k is the slope and b is the intercept. Tacking into consideration this aspect, other parameters are proposed, denoted as
and
,which are polar coordinates.
(14)
As shown in Figure 10, the
parameter represents the distance between the line and the origin, and the
parameter represents the angle of the vector from the origin to the closest point on the line. This representation can map any line in the image space to a point
in the Hough space.
As shown in Figure 11, in the image space xy, straight lines passing through point
are mapped into Hough parameter space
to obtain curve
,straight lines passing
are mapped onto the Hough parameter space
to obtain curve
. The intersection of the two curves is
,corresponding to the spatial line L. From this, the equation of the straight line in the image space can be obtained, which can be expressed by the following equation.
Figure 11. Schematic diagram of Cartesian coordinate system and Hough space.
(15)
We do the same operation described above for points of interest in the ROI area from the image. If there are multiple curves corresponding to different points intersecting in the coordinate system
,it means that there is a straight line that can connect the multiple points. We can get the main lane line in the image by selecting the line with the intersection number in the Hough space. Also, the number of intersections must be greater than zero and greater than a predetermined threshold.
In addition, we may encounter some frame pictures without any mark but noise interference. We can also use the information of the previous frame in the Hough space to predict the lane line information of the next frame. The mark line detected from the current frame picture will not generate a large offset and the accuracy of the lane line detection of the consecutive frame picture can be improved.
Figure 12 shows the line cluster generated by connecting the points of interest obtained in the Hough transform. And final results are shown in Figure 13.
This paper uses the Canny edge extraction operator and combine the Hough transform for comparison experiments. The experimental results are shown in Figure 14.
Figure 14 shows the results of the sample image directly combined with the Canny operator.
3. Experiment Result
We use the Caltech Lanes dataset [19],the image of 640 × 480 and approx, 1120 frames to validate the proposed algorithm. The algorithm was implemented by using MATLAB R2015b Intel (R) Core (TM) i5-6500 CPU@3.20 GHz, 8GB RAM, the Windows 7 Ultimate PC.
The following pictures in Figure 15 are the experimental results of complex signs in the middle of the lane line. It can be seen that during the detection, the lane line is interspersed with other marking lines, crosswalk lines, text reminder signs, etc., but the algorithm lane line detection shows a higher precision. The recognition accuracy is shown in Table 1.
4. Conclusion
This paper presents a lane line detection algorithm under the complicated conditions. The algorithm uses Gaussian blur, image graying, DLD-threshold algorithm, correlation filter and Hough transform to determine the distribution of lane lines. The experimental results show that the method can work effectively and accurately, and obtain good results, both in the case of complicated road information and simple road information. Of course, this paper doesn’t consider the impact of strong light and unclear road markings on the road environment. In the future, we can combine various conditions to continue to improve lane detection.
Acknowledgements
Our research is supported by the Shandong Provincial Key R&D Program 2017GGX10113, Shenzhen Science and Technology Research and Development Funds (No. JCYJ20170818104011781).