邓元望 蒲宏韬 华鑫斌 孙彪
摘 要:针对在复杂的工况下车道线检测的鲁棒性和实时性较差等问题,本文通过融合边缘检测与多颜色空间阈值分割结果,进行车道线特征点的提取. 结合车道线在鸟瞰图中的位置特点,提出了基于DBSCAN二次聚类(Reclustering based on Density-Based Spatial Clustering of Application with Noise,RC-DBSCAN)的特征点聚类算法. 并以簇点是否进行二次聚类和Lab空间采样簇点的平均灰度值为依据,进行车道线线型和颜色的识别. 使用最小二乘法对车道线进行拟合,通过基于可信区域的卡尔曼滤波算法对拟合后的车道线进行跟踪. 最后在实际道路采集的视频与公开的数据集中进行了实验. 实验表明,本文算法在复杂路况下对车道线检测的鲁棒性优于传统聚类算法,实时性能够满足实际需求;在结构化道路上,对车道线类型的识别也具有很高的准确率.
关键词:机器视觉;车道线检测;特征融合;密度聚类;车道线类型识别;卡尔曼滤波
中图分类号:TP391.41;U463.6 文献标志码:A
Research on Lane Detection Based On RC-DBSCAN
DENG Yuanwang PU Hongtao HUA Xinbin SUN Biao
(College of Mechanical and Vehicle Engineering,Hunan University,Changsha 410082,China)
Absrtact:In view of the poor robustness and real-time performance of lane detection under complex working conditions,this paper extracts the feature points of lane line by fusing the results of edge detection and multi-color space threshold segmentation. Combined with the location characteristics of lane line in aerial view,a feature point reclustering algorithm based on RC-DBSCAN (Reclustering based on Density-Based Spatial Clustering of Application with Noise) is proposed. Based on whether the cluster points are clustered twice or not and the average gray value of the cluster points sampled in Lab space,the lane line shape and color are identified. The lane line is fitted by the least square method,and the fitted lane line is tracked by the Kalman filter algorithm based on the trusted region. Finally,the experiment is carried out in the real road video and public data set. Experimental results show that the robustness of the proposed algorithm is better than the traditional clustering algorithm in complex road conditions,and the real-time performance can meet the actual needs;on the structured road,the recognition of lane type also has high accuracy.
Key words:machine vision;lane detection;feature fusion;density clustering;lane type recognition;Kalman filter
車道线检测是辅助驾驶感知系统最重要的功能之一,提高车道线检测的准确性,将有利于保障智能汽车的安全行驶和驾驶员的人身安全[1].
目前,常见的车道线检测算法主要有基于特征检测、基于模型的检测和基于深度学习的检测. 基于特征的检测主要的特征包括了边缘、纹理特征和颜色特征等[2-3]. 王家恩等提出了基于车道线宽度和边缘点数量统计的边缘检测算法,能有效抑制噪声的产生[4]. Chen 等通过Sobel算子进行边缘检测,并将图片转换到HSV空间,进行颜色特征的车道线特征提取[5]. 文献[6]通过结合远视场LSD直线检测和远视场的双曲线模型匹配对车道线进行拟合,取得了较好的效果. Wang等利用密度聚类DBSCAN算法动态确定邻域参数实现对车道线的提取,并使用抛物线模型对车道线进行拟合[7]. Ajaykumar 等使用K-means聚类算法对概率霍夫变换后的线段进行聚类,并利用轮廓系数确定最佳的聚类簇的数目,由于K-means算法的局限性,聚类效果容易受到影响[8]. He 等提出了基于点云卷积神经网络的车道线检测算法,在光照变化等复杂情况下,大大提高了检测精度[9]. Neven等将车道线检测问题转化为实例分割问题,利用LaneNet网络获取每条车道线的像素级分割,从而提高了检测精度[10].
在车道线的跟踪领域,常见的跟踪算法可以分为基于模型参数的跟踪和基于感兴趣区域的跟踪. Lee等通过上一帧图像车道线的位置信息,动态确定感兴趣区域,在此区域内对车道线进行追踪,具有很好的实时性[11]. Wu 等利用卡尔曼滤波器对直线两端坐标参数进行跟踪,从而实现了对车道线的跟踪[12].
针对相关文献存在的鲁棒性、准确性与实时性无法有效兼顾的问题,为了在满足实时性的同时,更准确、全面地提取车道线信息,本文提出基于RC-DBSCAN的车道线检测跟踪与类型识别算法.
1 算法流程
本文在图像预处理部分,通过逆透视变换和对应点提取车道线感兴趣区域(Region of Interest,ROI),将Sobel算子边缘检测结果和基于颜色空间HSL和Lab 的最大类间方差法(OTSU)二值化结果进行数据融合,提取出车道线的边缘特征点;采用RC-DBSCAN算法对特征点进行聚类;通过图像直方图峰值位置与簇点的质心位置排除路面干扰,并使用最小二乘法对车道线进行拟合;同时通过簇是否二次聚类和Lab颜色空间中的簇点的颜色值对车道线类别进行判定;最后通过卡尔曼滤波对车道线进行跟踪,并划定可信区域对卡尔曼滤波的追踪结果进行判定和优化. 总体算法流程如图1所示.
2 图像预处理
2.1 图片初处理
摄像头采集到的图片可分为三个区域:天空背景区域,车道线区域,车道线外背景区域. 为了排除背景干扰,根据R、G、B通道的值进行灰度化处理,灰度Gray的计算式如下:
Gray = 0.299×R + 0.587×G + 0.114×B (1)
根据自车道范围,划定图片的感兴趣区域,本文选取图片下方2/5左右的区域中的自车道线附近区域作为感兴趣区域. 对图像进行基于对应点的逆透视变换处理[13],得到车道线的鸟瞰图. 图2(a)为摄像头采集的某车道线原图,(b)为ROI区域的逆透视变换图.
2.2 基于Sobel算子的车道线边缘提取
利用Sobel算子通过模板,在x(水平),y(垂直)方向对图片进行卷积操作,通过对遍历点进行领域处理,达到提取边缘特征的效果,见图3.
2.3 基于HSL和Lab颜色空间的特征提取与融合
3 基于RC-DBSCAN的车道线提取
3.1 RC-DBSCAN算法
3.2 RC-DBSCAN与DBSCAN的检测效果对比
3.3 车道线簇的提取与拟合
4 结构化道路的车道线类型识别
5 基于卡尔曼滤波的车道线跟踪
6 实验与分析
6.1 车道线检测
6.2 车道线类型识别
7 结 论
在车辆行驶的复杂工况下,车道线的提取存在鲁棒性和实时性不高的问题,本文在边缘特征与颜色空间特征提取的基礎上,提出了RC-DBSCAN聚类算法和车道线类型识别算法,结合卡尔曼滤波,在弯道、路面干扰、隧道等复杂工况下进行了实车实验. 结果表明,RC-DBSCAN算法相比于传统的聚类算法具有更好的鲁棒性和实时性,在复杂工况下的车道线检测准确性可达95%,对于分辨率为1 920 ×1 080的图片,每帧耗时平均约79 ms,具有较好的实时性,在结构化道路上,车道线类型识别的准确率达98%.
参考文献
[1] HU L,OU J,HUANG J,et al. A review of research on traffic conflicts based on intelligent vehicles[J]. IEEE Access,2020,8:24471—24483.
[2] YOO J H,LEE S W,PARK S K,et al. A robust lane detection method based on vanishing point estimation using the relevance of line segments[J]. IEEE Transactions on Intelligent Transportation Systems,2017,18(12):3254—3266.
[3] PIAO J,SHIN H. Robust hypothesis generation method using binary blob analysis for multi-lane detection[J]. IET Image Processing,2017,11(12):1210—1218.
[4] 王家恩,陈无畏,汪明磊,等. 车辆辅助驾驶系统中的三车道检测算法[J]. 汽车工程,2014,36(11):1378—1385. WANG J E,CHEN W W,WANG M L,et al.. A three-lane detection algorithm for vehicle assistant driving system[J]. Automotive Engineering,2014,36(11):1378—1385. (In Chinese)
[5] CHEN C,WANG J,CHANG H,et al. Lane detection of multi-visual-features fusion based on DS theory[C]//Proceedings of the 30th Chinese Control Conference. Yantai,China:IEEE,2011:3047—3052.
[6] 曲峰. 基于视觉的结构化道路及障碍物检测技术研究[D].长春:吉林大学,2019:24—33.QU F. Research on technologies of vision-based structured road and obstacle detection[D]. Changchun:Jilin University,2019:24—33.(In Chinese)
[7] WANG J T,HONG W,GONG L. Lane detection algorithm based on density clustering and RANSAC[C]//2018 Chinese Control And Decision Conference (CCDC). Shenyang,China:IEEE,2018:919—924.
[8] AJAYKUMAR R,GUPTA A,MERCHANT P S N. Automated lane detection by K-means clustering:a machine learning approach[J]. Electronic Imaging,2016,2016(14):1—6.
[9] HE B,AI R,YAN Y,et al. Lane marking detection based on convolution neural network from point clouds[C]//2016 IEEE 19th International Conference on Intelligent Transportation Systems (ITSC). Rio de Janeiro,Brazil :IEEE,2016:2475—2480.
[10] NEVEN D,DE BRABANDERE B,GEORGOULIS S,et al. Towards end-to-end lane detection:an instance segmentation approach[C]//2018 IEEE intelligent vehicles symposium (IV). Changshu,China :IEEE,2018:286—291.
[11] LEE C,MOON J H. Robust lane detection and tracking for real-time applications[J]. IEEE Transactions on Intelligent Transportation Systems,2018,19(12):4043—4048.
[12] WU P C,CHANG C Y,LIN C H. Lane-mark extraction for automobiles under complex conditions[J]. Pattern Recognition,2014,47(8):2756—2767.
[13] ALY M. Real time detection of lane markers in urban streets[C]//2008 IEEE Intelligent Vehicles Symposium. Eindhoven,Netherlands :IEEE,2008:7—12.
[14] LIU D,WANG Y,CHEN T,et al. Application of color filter adjustment and K-means clustering method in lane detection for self-driving cars[C]//2019 Third IEEE International Conference on Robotic Computing (IRC). Naples,Italy:IEEE,2019:153—158.
[15] 覃雄臻,魯若宇,陈立明,等. 多场景车道线检测与偏离预警方法研究[J]. 机械科学与技术,2020,39(9):1439—1449.QIN X Z,LU R Y,CHEN L M,et al. Research on multi-scene lane line detection and deviation warning method[J]. Mechanical Science and Technology for Aerospace Engineering,2020,39(9):1439—1449.(In Chinese)
[16] KHAN K,REHMAN S U,AZIZ K,et al. DBSCAN:Past,present and future[C]//The fifth international conference on the applications of digital information and web technologies (ICADIWT 2014). Bangalore,India:IEEE,2014:232—238.
[17] LI W,QU F,WANG Y,et al. A robust lane detection method based on hyperbolic model[J]. Soft Computing,2019,23(19):9161—9174.
[18] MUTHALAGU R,BOLIMERA A,KALAICHELVI V. Lane detection technique based on perspective transformation and histogram analysis for self-driving cars[J]. Computers & Electrical Engineering,2020,85:106653.
[19] 劉媛. 基于机器视觉的车道偏离预警系统关键算法研究[D].长沙:湖南大学,2013:47—51. LIU Y. Research on key algorithms for vehicle lane departure warning system based on machine vision[D],Changsha:Hunan University,2013:47—51.(In Chinese)
[20] 陈涛,张洪丹,陈东,等. 基于优先像素与卡尔曼滤波追踪的车道线检测[J]. 汽车工程,2016,38(2):200—205.CHEN T,ZHANG H D,CHEN D,et al. Lane detection based on high priority pixels and tracking by Kalman filte[J].Automotive Engineering,2016,38(2):200—205.
[21] LEE D K,SHIN J S,JUNG J H,et al. Real-time lane detection and tracking system using simple filter and Kalman filter[C]//2017 Ninth International Conference on Ubiquitous and Future Networks (ICUFN). Milan :IEEE,2017:275—277.
[22] 朱鸿宇,杨帆,高晓倩,等. 基于级联霍夫变换的车道线快速检测算法[J]. 计算机技术与发展,2021,31(1):88—93.ZHU H Y,YANG F,GAO X Q,et al. A fast lane detection algorithm based on cascade hough transform.computer technology and development,2021,31(1):88—93. (In Chinese)