Full text
1. Introduction
With the increasing number of car ownership in our country, people's demand for car driving safety is also increasing. With the rapid development of computer technology, the assistant driving system arises at the historic moment, and lane detection, as an important part of the auxiliary driving system, has been deepened in the field both at home and abroad.
Lane detection is to process the road image by vehicle camera, and extract the lane characteristics and obtain the lane image through the corresponding method. It is concluded that the detection method plays a pivotal role in the implementation of lane detection.
Lane shape is mainly straight and curved, the main content of this paper is about the detection method of curved lane. The detection method of curved Lane generally has the following steps: the original RGB image captured by camera is transformed into gray image, and the binarization of image is processed by threshold segmentation, and then the edge of lane is detected. Finally, lane line is extracted[1].
This paper abandons the edge detection steps in the process and increases the morphological processing step, Which makes the image processed by threshold segmentation less noise, and highlights the target image contour. Finally, the curve lane is fitted by the least square method and extracted into the original image.
The image processing toolbox of MTALAB has rich image processing functions and methods, which saves a lot of time for the research of detection
methods. The steps in this paper make use of the
function of MATLAB, which greatly improves the efficiency of the algorithm.
2. Threshold Segmentation
Threshold segmentation is a part of image preprocessing, and the key is to get a suitable threshold. Based on this threshold, the original image is transformed into binary image. The commonly used threshold segmentation methods include global threshold method, Ostu threshold method, iterative threshold method, etc[2].
Global threshold method: by giving the whole image with the same threshold T, when the pixel value in the image is greater than T, the pixel is considered as the target object; otherwise, that is, the pixel less than Tis regarded as the background object.
The binarization of image should be satisfied with the demand, as shown in Equation 1. (1) Where, f(x, y) is the pixel value of any pixel in the image. Based on the MATLAB global threshold method, usually through the observation of gray image histogram, after basically determining the gray level of the histogram trough, then using this point as the global threshold to divide the target and
background.
The global threshold method is simpler and faster than the other two methods. However, when the number of histogram trough is large, the accuracy is greatly reduced and the adaptability is poor. Ostu threshold method: the derivation of the algorithm is based on gray histogram and the least squares method. The variance between the
background and the target in the gray image is shown
in Equation2. (2) Among them, μ is the average gray value of the image, μ0 is the average gray value of the background part, μ2 is the average gray value of the target part, a is the probability of the appearance of the
background part, b is the probability of the target
part. Ostu method is very sensitive to noise and target 1, ( , )( , ) 0, ( , ) f x y Tg x y f x y T 2 2 2 02( ) ( ) ( )k a b
size, simple in calculation and fast in calculation, and is widely used.
Figure 1. Result of threshold segmentation.
The iterative threshold method is as follows. Firstly, set the reference thresholdT0, and select an initial prediction thresholdT1. Secondly,T0 is used to segment the image, and the background part and the target part with T0 as the threshold are obtained. The set of background pixels is P0, and the set of the target pixels isP1.Thirdly,the average gray values U0 and U1of P0and P1 are calculated respectively, and new prediction threshold is generated T2=(U0+U1)/2.Fourthly, repeating second steps and third steps, when |T2-T1|<T0, terminating the cycle, the result T2 is used as the final result[3]. The optimal threshold under the iterative threshold method.
Compared with the Ostu method and the global threshold method based on gray histogram, this method is more adaptable. Therefore, in this paper, the iterative threshold method with better effect is selected by comparing the results of the three
methods. The threshold segmentation results of the
three methods are shown in Figure 1,it can be seen that the binary image obtained by iterative threshold method is better than other two methods[4].
3. Morphological Processing
Mathematical morphology is a discipline based on set theory. In image processing, it can simplify the image processing data and remove the incoherent structure while keeping the original shape feature of the image[5]. It can be used to suppress noise, feature extraction, and image segmentation and other image processing problems. In the binary image obtained by the iterative threshold method, there are many discontinuities in the target image, which can be connected by dilation operation of morphology.
After dilation, the image is shown in Figure 2. It can be found that the original broken contour of the target image is connected, but more noise is also introduced.
Figure 2. Result of dilation operation.
Then through the opening operation of noise elimination, the MATLAB has a variety of image processing functions for binary image denoising, this paper uses the function“bwareaopen”, relative to imopen, imtophat and other functions, the function is simple[6].
The denoised image is shown in Figure 3.
Figure 3. Result of denoising operation.
4. Lane Feature Points Acquisition
By separating the left and right lane lines in the image, traversing the left image or the right image in turn, searching for non-zero pixels, obtaining the
pixel coordinates, fitting the coordinates, and displaying the lane line position in the image. The left and right lane lines are greatly disturbed by other non target interference in the image. It can be seen from Figure 3 that it is difficult to avoid the appearance of the sky in the image captured by the general camera, which causes great interference to the lane extraction. Through the subtraction operation of the image, the left and right lane lines can be extracted separately, and based on the MATLAB image processing toolbox, it has very high efficiency.
The basic steps are as follows. Firstly, extracting the approximate area of the left and right lane lines respectively. Secondly, calculating the number of non-zero pixels in the extracted region. Thirdly, removing lanes as small targets. Fourthly, using the subtraction operation between the Figure 3 and the image obtained by step 3and getting the lane line.
Through the above steps, the left and right lane lines can be separated from the original image, and then the lane can be acquired. The pixel size of the left lane image is consistent with the original image, while the one Lane often exists on the one side of the image, so we only traverse the half image when we traverse the image. We can preset two empty matrices when we get the lane pixels. Using the powerful matrix processing function ofMATLAB, the pixel coordinates can be quickly stored in the matrix every time the lane pixels are searched. Finally, each preset empty matrix stores the abscissa or ordinate of the lane line feature points.
Figure 4. Result of curve lane line.
5. Least Square MethodFittingLane Line
The least square method is a class of mathematical optimization, which seeks the best function matching of data by minimizing the square of error. In the image, the target curve function is assumed to be y=g(x), For the detected Lane characteristic point (xi,yi), the error corresponding to the target curve is g(xi)-yi.So the sum of squared errors corresponding to all feature points is shown in Equation 3[7]. It is the expression of least square method. (3) In the toolbox of MATLAB image processing, the least square fitting can be realized by the two functions “p=polyfit(x,y,n)”, “yi=polyval(p,xi)”.
Finally, the curve lane is fitted and fed back to the original image, as shown in Figure 4. As can be seen from Figure 4, the fitting curve and lane line almost coincide.
6. Conclusion
In this paper, the feature points of lane are searched and obtained by traversing the image, the previous morphological processing indirectly enhances the accuracy of feature points and the model of lane line is fitted on the basis of these points, which has reliable accuracy. However, this method also has shortcomings that relies heavily on feature points. In complex road conditions and the image noise is serious, the error of feature points is larger, the effect is not ideal, and the robustness is poor. However, for most road conditions, good detection results can be obtained.
In the process of extraction of lane line feature points, the method of judging the lane line area is more complex, and of poor adaptability, which is the mainly disadvantage of the study. By introducing efficient intelligent algorithm, the lane area can be obtained quickly and accurately, and the interference introduced by noise can be reduced. Based on the idea, we will expand the application of the procedure mentioned above by further study.
Acknowledgement
This research was financially supported by the Undergraduate Training Programs for Innovation and Entrepreneurship of Linyi University (No. 201710452061), and the Science and Technology Planning Project of Higher Education of Shandong Province (No. J16LB69), the Doctoral Scientific Research Startup Foundation of Linyi University (No.
LYDX2016BS081), People’s Republic of China.
Figures




