CN106874875A - A kind of vehicle-mounted lane detection system and method - Google Patents
A kind of vehicle-mounted lane detection system and method Download PDFInfo
- Publication number
- CN106874875A CN106874875A CN201710086674.1A CN201710086674A CN106874875A CN 106874875 A CN106874875 A CN 106874875A CN 201710086674 A CN201710086674 A CN 201710086674A CN 106874875 A CN106874875 A CN 106874875A
- Authority
- CN
- China
- Prior art keywords
- lane line
- lane
- picture
- vehicle
- color model
- 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
Links
- 238000001514 detection method Methods 0.000 title claims abstract description 56
- 238000000034 method Methods 0.000 title claims abstract description 34
- 238000012545 processing Methods 0.000 claims abstract description 32
- 238000004364 calculation method Methods 0.000 claims abstract description 19
- 230000011218 segmentation Effects 0.000 claims abstract description 13
- 239000011159 matrix material Substances 0.000 claims description 16
- 238000002474 experimental method Methods 0.000 claims description 5
- 238000003708 edge detection Methods 0.000 claims description 4
- 230000003993 interaction Effects 0.000 claims description 4
- 238000012216 screening Methods 0.000 claims description 4
- 230000000694 effects Effects 0.000 abstract description 4
- 238000005286 illumination Methods 0.000 abstract description 4
- 230000007613 environmental effect Effects 0.000 description 3
- 238000005516 engineering process Methods 0.000 description 2
- 238000003672 processing method Methods 0.000 description 2
- 230000009286 beneficial effect Effects 0.000 description 1
- 239000003086 colorant Substances 0.000 description 1
- 230000001186 cumulative effect Effects 0.000 description 1
- 230000007547 defect Effects 0.000 description 1
- 238000010586 diagram Methods 0.000 description 1
- 238000000605 extraction Methods 0.000 description 1
- 238000012795 verification Methods 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V20/00—Scenes; Scene-specific elements
- G06V20/50—Context or environment of the image
- G06V20/56—Context or environment of the image exterior to a vehicle by using sensors mounted on the vehicle
- G06V20/588—Recognition of the road, e.g. of lane markings; Recognition of the vehicle driving pattern in relation to the road
Landscapes
- Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Multimedia (AREA)
- Theoretical Computer Science (AREA)
- Image Analysis (AREA)
- Image Processing (AREA)
Abstract
本发明公开了一种车载车道线检测系统及方法,该系统包括设置在行驶车辆上的处理单元,以及与处理单元相连的图像采集单元;其中:图像采集单元,用于实时采集车辆行驶过程中的车道图片,将其发送给处理单元;处理单元,用于通过离线/在线的方式获取车道线样本图片,建立车道线样本库;并提取车道线样本库中车道线的RGB像素值,建立G‑S颜色模型,在G‑S颜色模型的基础上输入行驶过程中的车道图片,通过似然概率计算和阈值分割检测出图片中的车道线,并通过Hough变换提取图片中的车道线。本发明能够克服环境变化或者光照变化带来的影响,有效提高车道线检测效果。
The invention discloses a vehicle-mounted lane line detection system and method. The system includes a processing unit arranged on a driving vehicle, and an image acquisition unit connected with the processing unit; wherein: the image acquisition unit is used for real-time acquisition of The lane picture is sent to the processing unit; the processing unit is used to obtain the lane line sample picture offline/online, and establish a lane line sample library; and extract the RGB pixel value of the lane line in the lane line sample library, and establish G ‑S color model, based on the G‑S color model, input the lane picture during driving, detect the lane lines in the picture through likelihood calculation and threshold segmentation, and extract the lane lines in the picture through Hough transform. The invention can overcome the influence brought by the environment change or the illumination change, and effectively improve the detection effect of the lane line.
Description
技术领域technical field
本发明涉及计算机图像处理技术领域,尤其涉及一种车载车道线检测系统及方法。The invention relates to the technical field of computer image processing, in particular to a vehicle lane line detection system and method.
背景技术Background technique
近年来,汽车辅助驾驶(Driver Assistance Systems)和无人车技术受到了研究者的普遍关注。车道线检测是汽车辅助驾驶和无人车技术中至关重要的一步。目前主流的车道线检测方法有基于形状特征的车道线检测、基于颜色特征的车道线检测和基于模型特征的车道线检测等。基于形状特征的车道线检测方法所检测的车道线需要拥有明显的车道线边缘并且受噪声或者其它干扰影响较大。基于颜色特征的车道线检测方法受光照影响较大。基于模型特征的车道线检测会检测出大量与车道线无关的边缘并且不能区分检测到的不同颜色的车道线。In recent years, driver assistance systems and unmanned vehicle technology have received widespread attention from researchers. Lane line detection is a crucial step in assisted driving and unmanned vehicle technology. The current mainstream lane line detection methods include lane line detection based on shape features, lane line detection based on color features, and lane line detection based on model features. The lane lines detected by the lane line detection method based on shape features need to have obvious lane line edges and are greatly affected by noise or other interference. Lane line detection methods based on color features are greatly affected by illumination. Lane line detection based on model features will detect a large number of edges irrelevant to lane lines and cannot distinguish detected lane lines of different colors.
现有的车道线检测方法受环境干扰和光照变化影响较大。因此,本领域技术人员需要解决的一个技术问题是:针对现有车道线检测方法的不足,提出一种新型车道线检测方法,弥补其受环境干扰较大的缺点,进一步提升车道线检测的效果。Existing lane line detection methods are greatly affected by environmental interference and illumination changes. Therefore, a technical problem that those skilled in the art need to solve is to propose a new lane line detection method for the shortcomings of the existing lane line detection methods, to make up for its shortcomings of being greatly disturbed by the environment, and to further improve the effect of lane line detection .
发明内容Contents of the invention
本发明要解决的技术问题在于针对现有技术中车道线检测方法检测效果较差,检测过程容易受到环境变化或者光照变化影响的缺陷,提供一种车载车道线检测系统及方法。The technical problem to be solved by the present invention is to provide a vehicle-mounted lane line detection system and method for the defect that the detection effect of the lane line detection method in the prior art is poor, and the detection process is easily affected by environmental changes or illumination changes.
本发明解决其技术问题所采用的技术方案是:The technical solution adopted by the present invention to solve its technical problems is:
本发明提供一种车载车道线检测系统,包括设置在行驶车辆上的处理单元,以及与处理单元相连的图像采集单元;其中:The present invention provides a vehicle-mounted lane line detection system, including a processing unit arranged on a driving vehicle, and an image acquisition unit connected to the processing unit; wherein:
图像采集单元,用于实时采集车辆行驶过程中的车道图片,将其发送给处理单元;The image acquisition unit is used to collect the lane pictures during the driving of the vehicle in real time and send them to the processing unit;
处理单元,用于获取车道线样本图片,建立车道线样本库;并提取车道线样本库中车道线的RGB像素值,建立G-S颜色模型,在G-S颜色模型的基础上输入行驶过程中的车道图片,通过似然概率计算和阈值分割检测出图片中的车道线,并通过Hough变换提取图片中的车道线。The processing unit is used to obtain the lane line sample picture, establish the lane line sample library; and extract the RGB pixel value of the lane line in the lane line sample library, establish the G-S color model, and input the lane picture in the driving process on the basis of the G-S color model , the lane lines in the picture are detected by likelihood probability calculation and threshold segmentation, and the lane lines in the picture are extracted by Hough transform.
进一步地,本发明的系统还包括与处理单元相连的显示单元,用于显示操作界面和人机交互。Further, the system of the present invention also includes a display unit connected to the processing unit, for displaying an operation interface and man-machine interaction.
进一步地,本发明的系统还包括与处理单元相连的存储单元,用于存储车道线样本库数据和实时获取的车道图片数据。Further, the system of the present invention also includes a storage unit connected to the processing unit, for storing the lane line sample library data and the lane picture data acquired in real time.
进一步地,本发明的系统还包括与处理单元相连的供电单元,用于为系统供电。Further, the system of the present invention further includes a power supply unit connected to the processing unit, for supplying power to the system.
进一步地,本发明的处理单元包括离线车道检测模式和在线车道检测模式,通过显示单元选择其中一种检测模式。Further, the processing unit of the present invention includes an offline lane detection mode and an online lane detection mode, and one of the detection modes is selected through the display unit.
本发明提供一种车载车道线检测方法,包括以下步骤:The invention provides a vehicle lane line detection method, comprising the following steps:
S1、通过离线或在线的方式获取包含车道线样本的图片,建立车道线样本库,并实时获取车辆行驶过程中的车道图片;S1. Obtain images containing lane line samples offline or online, establish a lane line sample library, and obtain lane pictures in real time during vehicle driving;
S2、提取车道线样本库中车道线的RGB像素值,建立G-S颜色模型;S2, extract the RGB pixel value of the lane line in the lane line sample library, and establish the G-S color model;
S3、在G-S颜色模型的基础上输入车辆行驶过程中的第一帧车道图片,通过似然概率计算和阈值分割检测出图片中的车道线;S3. On the basis of the G-S color model, input the first frame of the lane picture during the driving of the vehicle, and detect the lane lines in the picture through likelihood calculation and threshold segmentation;
S4、对图片中检测出的车道线,通过Hough变换提取图片中的车道线;S4, for the lane line detected in the picture, extract the lane line in the picture by Hough transform;
S5、根据检测出的车道线计算车道线的消失点并划分天际线,根据天际线在车辆行驶过程中的其它帧车道图片中设置车道线区域,对车道线区域执行步骤S3和步骤S4,检测出车道线并对车道线进行跟踪。S5. Calculate the vanishing point of the lane line according to the detected lane line and divide the skyline, set the lane line area in other frame lane pictures in the vehicle driving process according to the skyline, perform steps S3 and S4 on the lane line area, and detect Exit the lane markings and track the lane markings.
进一步地,本发明的步骤S1中获取车道线样本图片的方法包括:通过公开的车道线图片数据集;通过网络搜索和甄别获取车道线图片;通过现场实验采集车道线图片。Further, the method for obtaining the lane line sample picture in step S1 of the present invention includes: using the public lane line picture data set; obtaining the lane line picture through network search and screening; and collecting the lane line picture through field experiments.
进一步地,本发明的步骤S2中建立G-S颜色模型的方法为:Further, the method for establishing the G-S color model in step S2 of the present invention is:
设G-S颜色模型为一个1×3矩阵,其表示方式为:Let the G-S color model be a 1×3 matrix, expressed as:
μ=[E(R)E(G)E(B)]μ=[E(R)E(G)E(B)]
其中,E(R)表示样本库车道线RGB像素值中R值的均值,E(G)表示G值的均值,E(B)表示B值的均值,u即为颜色模型的均值;Among them, E(R) represents the mean value of R value in the RGB pixel values of the lane line in the sample library, E(G) represents the mean value of G value, E(B) represents the mean value of B value, and u is the mean value of the color model;
在颜色空间中采用协方差代替方差,协方差的计算方式为:In the color space, the covariance is used instead of the variance, and the calculation method of the covariance is:
其中,V是颜色模型的协方差,是一个3×3矩阵,其正对角线的值是COV(R,R)、COV(G,G)、COV(B,B),矩阵中每个元素的计算公式为:Among them, V is the covariance of the color model, which is a 3×3 matrix, and the values of its positive diagonal are COV(R,R), COV(G,G), COV(B,B), each in the matrix The calculation formula for elements is:
通过计算得到的颜色模型均值u和协方差V,并通过以下公式构建车道线的G-S颜色模型:By calculating the mean u and covariance V of the color model, the G-S color model of the lane line is constructed by the following formula:
其中,X为1×3矩阵,物理意义是图片中每个点的像素值,并在计算时将该公式简化为:P(X)=(X-μ)T·inv(V)·(X-μ)。Among them, X is a 1×3 matrix, the physical meaning is the pixel value of each point in the picture, and the formula is simplified to: P(X)=(X-μ) T ·inv(V)·(X -μ).
进一步地,本发明的步骤S3中检测出图片中的车道线的方法为:Further, the method for detecting the lane line in the picture in step S3 of the present invention is:
设置阈值0.0026,将图片分为疑似车道线像素点和非车道线像素点;在区分出车道线像素后,通过阈值分割将图片进行二值化处理,将疑似车道线像素点赋值为白色,非车道线像素点赋值为黑色。Set the threshold to 0.0026, and divide the picture into suspected lane line pixels and non-lane line pixels; after distinguishing the lane line pixels, the image is binarized by threshold segmentation, and the suspected lane line pixels are assigned white, non-lane line pixels The lane line pixels are assigned black.
进一步地,本发明的步骤S4中通过Hough变换提取图片中的车道线的方法为:Further, in the step S4 of the present invention, the method for extracting the lane line in the picture by Hough transform is:
对图片进行边缘检测;Perform edge detection on the image;
根据图片尺寸决定Hough变换累加器的大小并分配内存;Determine the size of the Hough transform accumulator and allocate memory according to the image size;
设定阈值,并根据阈值大小将Hough变换累加器中累加值小于阈值的点清零,即认为这些点并不对应图片域中的一条直线;Set the threshold, and clear the points whose accumulated value in the Hough transform accumulator is less than the threshold according to the threshold value, that is, these points do not correspond to a straight line in the image domain;
查找Hough变换累加器中累加值最大的点,记录该点并继续查找记录下一个累加值最大的点,直到累加器中所有的累加值都为零,记录的这些点即对应了检测到的图片中的直线;Find the point with the largest accumulative value in the Hough transform accumulator, record this point and continue to find and record the next point with the largest accumulative value until all the accumulative values in the accumulator are zero, and these recorded points correspond to the detected pictures straight line in
根据检测到的点在图片域中绘出直线,提取其中的直线即为检测出的车道线。Draw a straight line in the image domain according to the detected points, and extract the straight line as the detected lane line.
本发明产生的有益效果是:本发明提供了一种在线颜色特征和形状特征结合的车道线检测系统及方法,其独创性在于能够在线建立车道线G-S颜色模型,并且结合颜色特征与形状特征进行车道线检测;该系统与方法能够克服环境变化或者光照变化带来的影响,有效提高车道线检测效果。The beneficial effects produced by the present invention are: the present invention provides a lane line detection system and method that combines online color features and shape features. Lane line detection: the system and method can overcome the impact of environmental changes or light changes, and effectively improve the lane line detection effect.
附图说明Description of drawings
下面将结合附图及实施例对本发明作进一步说明,附图中:The present invention will be further described below in conjunction with accompanying drawing and embodiment, in the accompanying drawing:
图1是本发明实施例的系统框图;Fig. 1 is a system block diagram of an embodiment of the present invention;
图2是本发明实施例的方法流程图。Fig. 2 is a flow chart of the method of the embodiment of the present invention.
具体实施方式detailed description
为了使本发明的目的、技术方案及优点更加清楚明白,以下结合附图及实施例,对本发明进行进一步详细说明。应当理解,此处所描述的具体实施例仅用以解释本发明,并不用于限定本发明。In order to make the object, technical solution and advantages of the present invention clearer, the present invention will be further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described here are only used to explain the present invention, not to limit the present invention.
如图1所示,本发明实施例的车载车道线检测系统,包括设置在行驶车辆上的处理单元,以及与处理单元相连的图像采集单元;其中:As shown in Figure 1, the vehicle-mounted lane line detection system of the embodiment of the present invention includes a processing unit arranged on a driving vehicle, and an image acquisition unit connected to the processing unit; wherein:
图像采集单元,用于实时采集车辆行驶过程中的车道图片,将其发送给处理单元;The image acquisition unit is used to collect the lane pictures during the driving of the vehicle in real time and send them to the processing unit;
处理单元,用于获取车道线样本图片,建立车道线样本库;并提取车道线样本库中车道线的RGB像素值,建立G-S颜色模型,在G-S颜色模型的基础上输入行驶过程中的车道图片,通过似然概率计算和阈值分割检测出图片中的车道线,并通过Hough变换提取图片中的车道线。The processing unit is used to obtain the lane line sample picture, establish the lane line sample library; and extract the RGB pixel value of the lane line in the lane line sample library, establish the G-S color model, and input the lane picture in the driving process on the basis of the G-S color model , the lane lines in the picture are detected by likelihood probability calculation and threshold segmentation, and the lane lines in the picture are extracted by Hough transform.
该系统还包括与处理单元相连的显示单元,用于显示操作界面和人机交互。该系统还包括与处理单元相连的存储单元,用于存储车道线样本库数据和实时获取的车道图片数据。该系统还包括与处理单元相连的供电单元,用于为系统供电。处理单元包括离线车道检测模式和在线车道检测模式,通过显示单元选择其中一种检测模式。The system also includes a display unit connected to the processing unit for displaying an operation interface and man-machine interaction. The system also includes a storage unit connected to the processing unit for storing the lane line sample library data and the lane picture data acquired in real time. The system also includes a power supply unit connected to the processing unit for supplying power to the system. The processing unit includes an offline lane detection mode and an online lane detection mode, and one of the detection modes is selected through the display unit.
本发明实施例的车载车道线检测方法,用于实现本发明实施例的车载车道线检测系统,包括以下步骤:The vehicle-mounted lane line detection method of the embodiment of the present invention is used to realize the vehicle-mounted lane line detection system of the embodiment of the present invention, comprising the following steps:
S1、通过离线或在线的方式获取包含车道线样本的图片,建立车道线样本库,并实时获取车辆行驶过程中的车道图片;S1. Obtain images containing lane line samples offline or online, establish a lane line sample library, and obtain lane pictures in real time during vehicle driving;
S2、提取车道线样本库中车道线的RGB像素值,建立G-S颜色模型;S2, extract the RGB pixel value of the lane line in the lane line sample library, and establish the G-S color model;
S3、在G-S颜色模型的基础上输入车辆行驶过程中的第一帧车道图片,通过似然概率计算和阈值分割检测出图片中的车道线;S3. On the basis of the G-S color model, input the first frame of the lane picture during the driving of the vehicle, and detect the lane lines in the picture through likelihood calculation and threshold segmentation;
S4、对图片中检测出的车道线,通过Hough变换提取图片中的车道线;S4, for the lane line detected in the picture, extract the lane line in the picture by Hough transform;
S5、根据检测出的车道线计算车道线的消失点并划分天际线,根据天际线在车辆行驶过程中的其它帧车道图片中设置车道线区域,对车道线区域执行步骤S3和步骤S4,检测出车道线并对车道线进行跟踪。S5. Calculate the vanishing point of the lane line according to the detected lane line and divide the skyline, set the lane line area in other frame lane pictures in the vehicle driving process according to the skyline, perform steps S3 and S4 on the lane line area, and detect Exit the lane markings and track the lane markings.
步骤S1中获取车道线样本图片的方法包括:通过公开的车道线图片数据集;通过网络搜索和甄别获取车道线图片;通过现场实验采集车道线图片。The method for obtaining the lane line sample pictures in step S1 includes: using public lane line picture data sets; acquiring lane line pictures through network search and screening; and collecting lane line pictures through field experiments.
步骤S2中建立G-S颜色模型的方法为:The method for establishing the G-S color model in step S2 is:
设G-S颜色模型为一个1×3矩阵,其表示方式为:Let the G-S color model be a 1×3 matrix, expressed as:
μ=[E(R)E(G)E(B)]μ=[E(R)E(G)E(B)]
其中,E(R)表示样本库车道线RGB像素值中R值的均值,E(G)表示G值的均值,E(B)表示B值的均值,u即为颜色模型的均值;Among them, E(R) represents the mean value of R value in the RGB pixel values of the lane line in the sample library, E(G) represents the mean value of G value, E(B) represents the mean value of B value, and u is the mean value of the color model;
在颜色空间中采用协方差代替方差,协方差的计算方式为:In the color space, the covariance is used instead of the variance, and the calculation method of the covariance is:
其中,V是颜色模型的协方差,是一个3×3矩阵,其正对角线的值是COV(R,R)、COV(G,G)、COV(B,B),矩阵中每个元素的计算公式为:Among them, V is the covariance of the color model, which is a 3×3 matrix, and the values of its positive diagonal are COV(R,R), COV(G,G), COV(B,B), each in the matrix The calculation formula for elements is:
通过计算得到的颜色模型均值u和协方差V,并通过以下公式构建车道线的G-S颜色模型:By calculating the mean u and covariance V of the color model, the G-S color model of the lane line is constructed by the following formula:
其中,X为1×3矩阵,物理意义是图片中每个点的像素值,并在计算时将该公式简化为:P(X)=(X-μ)T·inv(V)·(X-μ)。Among them, X is a 1×3 matrix, the physical meaning is the pixel value of each point in the picture, and the formula is simplified to: P(X)=(X-μ) T ·inv(V)·(X -μ).
步骤S3中检测出图片中的车道线的方法为:The method for detecting the lane lines in the picture in step S3 is:
设置阈值0.0026,将图片分为疑似车道线像素点和非车道线像素点;在区分出车道线像素后,通过阈值分割将图片进行二值化处理,将疑似车道线像素点赋值为白色,非车道线像素点赋值为黑色。Set the threshold to 0.0026, and divide the picture into suspected lane line pixels and non-lane line pixels; after distinguishing the lane line pixels, the image is binarized by threshold segmentation, and the suspected lane line pixels are assigned white, non-lane line pixels The lane line pixels are assigned black.
步骤S4中通过Hough变换提取图片中的车道线的方法为:In step S4, the method of extracting the lane lines in the picture by Hough transform is:
对图片进行边缘检测;Perform edge detection on the image;
根据图片尺寸决定Hough变换累加器的大小并分配内存;Determine the size of the Hough transform accumulator and allocate memory according to the image size;
设定阈值,并根据阈值大小将Hough变换累加器中累加值小于阈值的点清零,即认为这些点并不对应图片域中的一条直线;Set the threshold, and clear the points whose accumulated value in the Hough transform accumulator is less than the threshold according to the threshold value, that is, these points do not correspond to a straight line in the image domain;
查找Hough变换累加器中累加值最大的点,记录该点并继续查找记录下一个累加值最大的点,直到累加器中所有的累加值都为零,记录的这些点即对应了检测到的图片中的直线;Find the point with the largest accumulative value in the Hough transform accumulator, record this point and continue to find and record the next point with the largest accumulative value until all the accumulative values in the accumulator are zero, and these recorded points correspond to the detected pictures straight line in
根据检测到的点在图片域中绘出直线,提取其中的直线即为检测出的车道线。Draw a straight line in the image domain according to the detected points, and extract the straight line as the detected lane line.
如图2所示,在本发明的另一个具体实施例中,系统包括图像采集单元、处理单元、显示单元、存储单元以及供电单元。图像处理单元用于采集当前的图像信息,处理单元用于处理图像数据,显示单元用于界面显示和人机交互,存储单元用于存储数据,供电单元用于为整个系统提供电源支持。所述系统启动后有两种工作模式,分别是离线车道线检测模式和在线车道线检测模式,用户可以通过显示界面自由选择其中一种工作模式。下面分别对2种工作模式所采用的方法进行阐述。As shown in FIG. 2 , in another specific embodiment of the present invention, the system includes an image acquisition unit, a processing unit, a display unit, a storage unit, and a power supply unit. The image processing unit is used to collect current image information, the processing unit is used to process image data, the display unit is used for interface display and human-computer interaction, the storage unit is used to store data, and the power supply unit is used to provide power support for the entire system. After the system is started, there are two working modes, namely offline lane marking detection mode and online lane marking detection mode, and the user can freely choose one of the working modes through the display interface. The methods used in the two working modes are described below.
P1离线车道线检测包括以下步骤:P1 offline lane line detection includes the following steps:
S1、通过预先获取包含车道线样本的图片,建立车道线样本库。车道线样本图片可以通过以下3中方式获取:一是通过公开数据集,例如KITTI数据集等,二是通过网络搜索和甄别获取车道线图片,三是通过现场实验采集车道线图片。S1. Establish a lane line sample library by pre-acquiring pictures containing lane line samples. Lane line sample pictures can be obtained in the following three ways: one is through public data sets, such as the KITTI data set, etc., the other is to obtain lane line pictures through network search and screening, and the third is to collect lane line pictures through field experiments.
S2、提取样本库中车道线的RGB像素值,建立G-S颜色模型。颜色模型的要素是均值和方差,本发明中G-S颜色模型的均值是一个1×3矩阵,如公式(1)所示。S2. Extract RGB pixel values of lane lines in the sample library, and establish a G-S color model. The elements of the color model are mean and variance, and the mean of the G-S color model in the present invention is a 1×3 matrix, as shown in formula (1).
μ=[E(R)E(G)E(B)] (1)μ=[E(R)E(G)E(B)] (1)
其中,E(R)表示样本库车道线RGB像素值中R值的均值,E(G)表示G值的均值,E(B)表示B值的均值,u即为颜色模型的均值。Among them, E(R) represents the mean value of R in the RGB pixel values of the lane line in the sample library, E(G) represents the mean value of G value, E(B) represents the mean value of B value, and u is the mean value of the color model.
由于颜色空间存在R、G、B3个值,各个方差之间并不相互独立,因此在颜色空间中采用协方差代替方差,协方差的计算方式如公式(2)所示。Since there are three values of R, G, and B in the color space, each variance is not independent of each other, so the covariance is used instead of the variance in the color space, and the calculation method of the covariance is shown in formula (2).
其中,V是颜色模型的协方差,是一个3×3矩阵,其正对角线的值是COV(R,R)、COV(G,G)、COV(B,B),矩阵中每个元素的计算公式如公式(3)所示。Among them, V is the covariance of the color model, which is a 3×3 matrix, and the values of its positive diagonal are COV(R,R), COV(G,G), COV(B,B), each in the matrix The calculation formula of the elements is shown in formula (3).
通过计算得到的颜色模型均值u和协方差V,通过公式(4)可以构建车道线G-S颜色模型。Through the calculated color model mean u and covariance V, the lane line G-S color model can be constructed by formula (4).
其中X为1×3矩阵,物理意义是图片中每个点的像素值。在计算时,可以将公式(4)简化为公式(5):Among them, X is a 1×3 matrix, and the physical meaning is the pixel value of each point in the picture. When calculating, formula (4) can be simplified to formula (5):
P(X)=(X-μ)T·inv(V)·(X-μ) (5)P(X)=(X-μ) T ·inv(V)·(X-μ) (5)
S3、在G-S颜色模型的基础上输入当前第一帧的图片数据,通过似然概率计算和阈值分割检测出图片中的车道线。S3. Input the picture data of the current first frame on the basis of the G-S color model, and detect the lane lines in the picture through likelihood calculation and threshold segmentation.
利用公式(5)对输入的当前第一帧图片进行计算,通过设定阈值T区分图像中的疑似车道线像素点和非车道线像素点,阈值T可以通过实验进行测定,阈值过小会造成检测出大量非车道线像素,过大会造成部分车道线像素被判定为非车道线像素,经过实验验证,一般取0.0026。为了方便后续计算,在区分出车道线像素后,通过阈值分割将图片进行二值化处理,具体为将疑似车道线像素赋值为白色,非车道线像素值赋值为黑色。Use the formula (5) to calculate the current first frame of the input image, and distinguish the suspected lane line pixels and non-lane line pixels in the image by setting the threshold T. The threshold T can be determined through experiments. If the threshold is too small, it will cause A large number of non-lane line pixels are detected, and too large will cause some lane line pixels to be judged as non-lane line pixels. After experimental verification, it is generally taken as 0.0026. In order to facilitate subsequent calculations, after distinguishing the lane line pixels, the image is binarized through threshold segmentation, specifically assigning the suspected lane line pixels to white and non-lane line pixels to black.
S4、在此基础上再使用Hough变换提取图片中的车道线。Hough变换是一种常用的直线检测方式,被广泛应用于车道线检测和提取,本发明中在G-S颜色模型检测的基础上进行Hough变换的具体过程为:S4. On this basis, the Hough transform is used to extract the lane lines in the picture. Hough transform is a kind of straight line detection method commonly used, is widely used in lane line detection and extraction, in the present invention, the specific process that carries out Hough transform on the basis of G-S color model detection is:
(1)对图像进行边缘检测。(1) Perform edge detection on the image.
(2)根据图像尺寸决定Hough变换累加器的大小并分配内存。(2) Determine the size of the Hough transform accumulator according to the image size and allocate memory.
(3)设定阈值,并根据阈值大小将Hough变换累加器中累加值小于阈值的点清零,即认为这些点并不对应图像域中的一条直线。(3) Set the threshold, and clear the points in the Hough transform accumulator whose cumulative value is less than the threshold according to the threshold, that is, these points do not correspond to a straight line in the image domain.
(4)查找Hough变换累加器中累加值最大的点,记录该点并继续查找记录下一个累加值最大的点,直到累加器中所有的累加值都为零,记录的这些点即对应了检测到的图像中的直线。(4) Find the point with the largest accumulated value in the Hough transform accumulator, record this point and continue to search and record the next point with the largest accumulated value until all the accumulated values in the accumulator are zero, and these recorded points correspond to the detection to the straight line in the image.
(5)根据检测到的点在图像域中绘出直线,提取其中的直线即为检测出的车道线。(5) Draw a straight line in the image domain according to the detected points, and extract the straight line as the detected lane line.
S5、后续N帧图片的处理方式为:S5. The processing method of subsequent N frames of pictures is as follows:
(1)通过检测出的车道线可以计算消失点并划分天际线。在图像中平行的车道线会相交于一点,该点即为消失点,根据消失点可以划分天际线,天际线以上为非车道线区域,车道线以下为车道线区域。(1) The vanishing point can be calculated and the skyline can be divided by the detected lane line. In the image, the parallel lane lines will intersect at one point, which is the vanishing point. According to the vanishing point, the skyline can be divided. Above the skyline is the non-lane line area, and below the lane line is the lane line area.
(2)根据划分出的天际线可以在图像中设置感兴趣区域,即车道线区域,可以减少大量计算量。(2) According to the divided skyline, the region of interest, that is, the lane line region, can be set in the image, which can reduce a large amount of calculation.
(3)在设置的感兴趣区域中进行S3-S4操作,即可快速检测出车道线并对车道线进行跟踪。(3) Perform S3-S4 operations in the set area of interest to quickly detect and track lane lines.
P2在线车道线检测包括以下步骤:P2 online lane line detection includes the following steps:
S1、在离线车道线检测P1的基础上,在用户界面显示车道线候选集,在此过程中可以适当缩小P1S3中的阈值T,尽可能的检测出所有的车道线供用户进行选择。S1. On the basis of offline lane detection P1, display the lane line candidate set on the user interface. During this process, the threshold T in P1S3 can be appropriately reduced, and all lane lines can be detected as much as possible for the user to choose.
S2、待用户指定正确的车道线之后,提取正确车道线的像素值,建立在线G-S颜色模型。其过程与P1S2相同。S2. After the user specifies the correct lane line, extract the pixel value of the correct lane line, and establish an online G-S color model. The process is the same as P1S2.
S3、在在线G-S颜色模型的基础上输入当前第一帧图片数据,通过似然概率计算和阈值分割检测出图片中的车道线。其过程与P1S3相同。S3. Input the current first frame of picture data based on the online G-S color model, and detect lane lines in the picture through likelihood calculation and threshold segmentation. The process is the same as P1S3.
S4、在此基础上再使用Hough变换提取图片中的车道线。其过程与P1S4相同。S4. On this basis, the Hough transform is used to extract the lane lines in the picture. The process is the same as P1S4.
S5、后续N帧图片的处理方式与P1S5相同。S5. The processing method of subsequent N frames of pictures is the same as that of P1S5.
应当理解的是,对本领域普通技术人员来说,可以根据上述说明加以改进或变换,而所有这些改进和变换都应属于本发明所附权利要求的保护范围。It should be understood that those skilled in the art can make improvements or changes based on the above description, and all these improvements and changes should belong to the protection scope of the appended claims of the present invention.
Claims (10)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710086674.1A CN106874875A (en) | 2017-02-17 | 2017-02-17 | A kind of vehicle-mounted lane detection system and method |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710086674.1A CN106874875A (en) | 2017-02-17 | 2017-02-17 | A kind of vehicle-mounted lane detection system and method |
Publications (1)
Publication Number | Publication Date |
---|---|
CN106874875A true CN106874875A (en) | 2017-06-20 |
Family
ID=59167125
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201710086674.1A Pending CN106874875A (en) | 2017-02-17 | 2017-02-17 | A kind of vehicle-mounted lane detection system and method |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN106874875A (en) |
Cited By (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN107563314A (en) * | 2017-08-18 | 2018-01-09 | 电子科技大学 | A kind of method for detecting lane lines based on parallel coordinate system |
CN107886752A (en) * | 2017-11-08 | 2018-04-06 | 武汉理工大学 | A kind of high-precision Vehicle positioning system and method based on transformation lane line |
CN108537142A (en) * | 2018-03-21 | 2018-09-14 | 华南理工大学 | A kind of method for detecting lane lines based on multiple color spaces |
CN110196062A (en) * | 2019-06-27 | 2019-09-03 | 成都圭目机器人有限公司 | A kind of air navigation aid of one camera tracking lane line |
CN110335322A (en) * | 2019-07-09 | 2019-10-15 | 成都理工大学 | Image-based road recognition method and road recognition device |
CN110388985A (en) * | 2018-04-16 | 2019-10-29 | Aptiv技术有限公司 | street marking color recognition |
Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105261020A (en) * | 2015-10-16 | 2016-01-20 | 桂林电子科技大学 | Method for detecting fast lane line |
CN105760812A (en) * | 2016-01-15 | 2016-07-13 | 北京工业大学 | Hough transform-based lane line detection method |
-
2017
- 2017-02-17 CN CN201710086674.1A patent/CN106874875A/en active Pending
Patent Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105261020A (en) * | 2015-10-16 | 2016-01-20 | 桂林电子科技大学 | Method for detecting fast lane line |
CN105760812A (en) * | 2016-01-15 | 2016-07-13 | 北京工业大学 | Hough transform-based lane line detection method |
Cited By (11)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN107563314A (en) * | 2017-08-18 | 2018-01-09 | 电子科技大学 | A kind of method for detecting lane lines based on parallel coordinate system |
CN107563314B (en) * | 2017-08-18 | 2020-01-14 | 电子科技大学 | Lane line detection method based on parallel coordinate system |
CN107886752A (en) * | 2017-11-08 | 2018-04-06 | 武汉理工大学 | A kind of high-precision Vehicle positioning system and method based on transformation lane line |
CN108537142A (en) * | 2018-03-21 | 2018-09-14 | 华南理工大学 | A kind of method for detecting lane lines based on multiple color spaces |
CN110388985A (en) * | 2018-04-16 | 2019-10-29 | Aptiv技术有限公司 | street marking color recognition |
US10977500B2 (en) * | 2018-04-16 | 2021-04-13 | Aptiv Technologies Limited | Street marking color recognition |
CN110388985B (en) * | 2018-04-16 | 2022-03-01 | Aptiv技术有限公司 | Method for determining color of street sign and image processing system |
CN110196062A (en) * | 2019-06-27 | 2019-09-03 | 成都圭目机器人有限公司 | A kind of air navigation aid of one camera tracking lane line |
CN110196062B (en) * | 2019-06-27 | 2022-03-25 | 成都圭目机器人有限公司 | Navigation method for tracking lane line by single camera |
CN110335322A (en) * | 2019-07-09 | 2019-10-15 | 成都理工大学 | Image-based road recognition method and road recognition device |
CN110335322B (en) * | 2019-07-09 | 2024-03-01 | 成都理工大学 | Road recognition method and road recognition device based on image |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN106874875A (en) | A kind of vehicle-mounted lane detection system and method | |
CN102208023B (en) | Method for recognizing and designing video captions based on edge information and distribution entropy | |
CN112885130B (en) | Method and device for presenting road information | |
CN116912793A (en) | A road surface recognition method and device | |
CN110570435B (en) | Method and device for carrying out damage segmentation on vehicle damage image | |
CN105405142A (en) | Edge defect detection method and system for glass panel | |
CN104299004B (en) | A kind of gesture identification method based on multiple features fusion and finger tip detection | |
CA2656425A1 (en) | Recognizing text in images | |
CN104077577A (en) | Trademark detection method based on convolutional neural network | |
CN110910420A (en) | Moving target detection tracking method based on image stream | |
CN109409368A (en) | Mine leather belt is vertical to tear detection device and detection method | |
CN106709518A (en) | Android platform-based blind way recognition system | |
CN107832762A (en) | A kind of License Plate based on multi-feature fusion and recognition methods | |
CN109344864B (en) | Image processing method and device for dense object | |
CN111539980B (en) | Multi-target tracking method based on visible light | |
EP3376438B1 (en) | A system and method for detecting change using ontology based saliency | |
CN113780484B (en) | Industrial product defect detection method and device | |
CN115272222A (en) | Method, device, device and storage medium for processing road detection information | |
CN110516527B (en) | Visual SLAM loop detection improvement method based on instance segmentation | |
CN112528903A (en) | Face image acquisition method and device, electronic equipment and medium | |
CN103093481B (en) | A kind of based on moving target detecting method under the static background of watershed segmentation | |
CN107506777A (en) | A real-time multi-license plate recognition method and device based on wavelet variation and support vector machine | |
CN108629786B (en) | Image edge detection method and device | |
CN112580629A (en) | License plate character recognition method based on deep learning and related device | |
CN109753880B (en) | Detection and identification method for natural scene vehicle-mounted video road speed limit sign |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20170620 |
|
RJ01 | Rejection of invention patent application after publication |