基于单目视觉的车道线检测研究毕业论文
2021-11-07 20:58:41
摘 要
随着科学技术的发展,汽车迈入普通家庭的生活中,便于人们日常出行,但随之而来的是拥堵的交通和不断发生的交通事故。为此,实现车辆的无人驾驶成为解决上述问题的关键,无人驾驶领域涉及到很多技术,本文对其中的车道线检测技术进行研究,对仿真结果进行对比,选择最佳的算法实现车道线的检测,下面就本文的主要研究内容作简要说明。
首先,对摄像头采集到的图像做预处理。因为实际车辆行驶时道路环境复杂,给车道线检测带来很大困难,例如光照变化、阴影、路面背景、雨雪天气、车道标识线模糊等因素的干扰。针对解决这些问题,本文对摄像头采集的车道图像进行预处理。在预处理阶段,使用图像的RGB模型,采用加权平均算法将彩色图像转换为灰度图像,提高系统运行速度,本文中红绿蓝三原色比例选取为0.3、0.59、0.11。针对现实道路环境中雨雪天气及车辆振动产生的噪声干扰,采用中值滤波算法对图像进行去噪处理,计算出像素点邻域内灰度值的中值来替代原像素点的灰度值。为进一步区分车道线和道路背景,灰度图像的灰度由0到255共256个灰度等级,转换为0和255共2个灰度等级,并采用最大类间方差法(OSTU)对图像进行二值化处理。针对车道线的边缘特征信息,将Sobel算子和Canny算子进行对比,分别用这两种算子提取边缘特征信息,结果显示前者对图像中的车道线边缘特征提取效果更好,因此本文选用Sobel算子的方法。
其次,需要在预处理后的图像中提取车道线。首先,选定感兴趣区域(region of interest,ROI),本文中将原图像按0.5比例裁剪后得到感兴趣区域(ROI),然后将带透视效果的图像进行逆透视变换,消除透视效果得到车道鸟瞰图。接着对车道形状进行判断,直线段部分和曲线段部分都有各自的拟合算法。对于直线段部分,采用Hough变换拟合车道线边缘;对于曲线段部分,选取最小二乘法拟合车道线边缘。实验仿真结果表明,该方法能够较好的拟合车道线。
最后,加入车道线跟踪算法,解决了实际车道线检测过程中,由于车道线被遮挡或磨损等而导致的漏检和误检问题。本文分析对比了基于贝叶斯框架的统计学原理的跟踪算法,选取Mean shift跟踪算法与卡尔曼滤波算法进行对比。当车道线被遮挡时,Mean shift跟踪算法检测不到车道线,而卡尔曼滤波算法则在车道线有无遮挡时都能较好的检测并跟踪车道线。因此本文选取卡尔曼滤波算法作为车道线的跟踪方法。
关键词:机器视觉,车道线检测,Sobel算子,Hough变化,卡尔曼滤波算法
Abstract
With the development of science and technology, cars enter into the life of ordinary families, which is convenient for people to travel in daily life, but it is accompanied by traffic jams and traffic accidents. Therefore, the realization of driverless vehicle has become the key to solve the above problems. There are many technologies involved in the field of driverless. In this paper, the lane line detection technology is studied, the simulation results are compared, and the best algorithm is selected to realize lane line detection. The main research contents of this paper are briefly described below.
First, pre-process the image collected by the camera. Because the road environment is complicated when the actual vehicle is driving, it brings great difficulties to the lane line detection, such as the interference of factors such as light changes, shadows, pavement backgrounds, rain and snow weather, and blurred lane markings. In order to solve these problems, this article preprocesses the lane images collected by the camera. In the preprocessing stage, the RGB model of image is used, and the weighted average algorithm is used to transform the color image into gray image, so as to improve the running speed of the system. In this paper, the ratio of the three primary colors of red, green and blue is selected as 0.3, 0.59, 0.11. Aiming at the noise interference caused by rain and snow weather and vehicle vibration in the real road environment, The median filter algorithm is used to denoise the image, and the median value of the gray value in the neighborhood of the pixel is calculated to replace the gray value of the original pixel.In order to further distinguish between lane lines and road backgrounds, the grayscale image has a grayscale of 0 to 255, a total of 256 grayscale levels, and is converted to a total of 2 grayscale levels of 0 and 255, and the maximum inter-class variance method (OSTU) is used to image Perform binarization. In view of the edge feature information of lane line, the Sobel operator and Canny operator are compared, and the edge feature information is extracted by these two operators respectively. The results show that the former has better effect on the edge feature extraction of lane line in the image, so the Sobel operator is selected in this paper.
Secondly, lane lines need to be extracted from the preprocessed image. Firstly, region of interest (ROI) is selected. In this paper, the original image is cut to 0.5 scale to get ROI. Then the image with perspective effect is inverted perspective transformed to eliminate perspective effect to get the aerial view of the lane. Then the shape of lane is judged, and the straight and curved segments have their own fitting algorithms. For the straight segment, Hough transform is used to fit the edge of lane line; for the curved segment, least square method is used to fit the edge of lane line. The simulation results show that this method can fit the lane line well.
Finally, the lane tracking algorithm is added to solve the problem of missing detection and false detection caused by lane line occlusion or wear in the actual lane line detection process. This paper analyzes and compares the tracking algorithms based on the statistical principle of Bayesian framework, the mean shift tracking algorithm and Kalman filter algorithm are selected for comparison. When the lane line is blocked, the Mean shift tracking algorithm cannot detect the lane line, and the Kalman filter algorithm can detect and track the lane line better when the lane line is unoccluded. Therefore, this paper selects Kalman filter algorithm as the lane line tracking method.
Keywords: Machine vision, lane line detection, Sobel operator, Hough change, Kalman filter algorithm
目录
摘要 I
Abstract II
目录 IV
第1章 绪论 1
1.1 研究背景和意义 1
1.2 国内外研究现状 1
1.3 主要研究内容 2
第2章 图像的预处理研究 3
2.1 图像的灰度化处理 3
2.2 图像的干扰噪声滤除 4
2.3 图像的二值化处理 6
2.3.1 局部自适应阈值二值化 6
2.3.2 最大类间方差法(OSTU) 7
2.4 车道线的边缘检测 9
2.4.1 Sobel算子 9
2.4.2 Canny算子 10
2.5 本章小结 10
第3章 车道线的检测 12
3.1 车道线检测方法概述 12
3.2 感兴趣区域(ROI)的选取 12
3.3 鸟瞰图变换 13
3.4 车道线检测的算法 15
3.4.1 Hough变换算法 15
3.4.2 最小二乘法 17
3.5 本章小结 20
第4章 车道线的跟踪 21
4.1 车道的跟踪方法 21
4.2 Mean shift跟踪算法原理 21
4.3 卡尔曼滤波算法原理 22
4.4基于卡尔曼滤波算法的车道线跟踪 23
4.5本章小结 25
第5章总结 27
5.1本文工作总结 27
5.2对未来的工作展望 27