[go: up one dir, main page]

CN111260957A - Lane departure warning system - Google Patents

Lane departure warning system Download PDF

Info

Publication number
CN111260957A
CN111260957A CN202010055760.8A CN202010055760A CN111260957A CN 111260957 A CN111260957 A CN 111260957A CN 202010055760 A CN202010055760 A CN 202010055760A CN 111260957 A CN111260957 A CN 111260957A
Authority
CN
China
Prior art keywords
lane
lane line
car
road image
road
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
Application number
CN202010055760.8A
Other languages
Chinese (zh)
Inventor
韩高格
方周
夏盼
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Chaohu University
Original Assignee
Chaohu University
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Chaohu University filed Critical Chaohu University
Priority to CN202010055760.8A priority Critical patent/CN111260957A/en
Publication of CN111260957A publication Critical patent/CN111260957A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G08SIGNALLING
    • G08GTRAFFIC CONTROL SYSTEMS
    • G08G1/00Traffic control systems for road vehicles
    • G08G1/16Anti-collision systems
    • G08G1/167Driving aids for lane monitoring, lane changing, e.g. blind spot detection
    • BPERFORMING OPERATIONS; TRANSPORTING
    • B60VEHICLES IN GENERAL
    • B60QARRANGEMENT OF SIGNALLING OR LIGHTING DEVICES, THE MOUNTING OR SUPPORTING THEREOF OR CIRCUITS THEREFOR, FOR VEHICLES IN GENERAL
    • B60Q9/00Arrangement or adaptation of signal devices not provided for in one of main groups B60Q1/00 - B60Q7/00, e.g. haptic signalling
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V20/00Scenes; Scene-specific elements
    • G06V20/50Context or environment of the image
    • G06V20/56Context or environment of the image exterior to a vehicle by using sensors mounted on the vehicle
    • G06V20/588Recognition 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)
  • Human Computer Interaction (AREA)
  • Mechanical Engineering (AREA)
  • Traffic Control Systems (AREA)
  • Image Analysis (AREA)

Abstract

本发明涉及车道线检测技术领域,具体涉及一种车道偏离报警系统;包括道路图像获取模块、道路图像处理模块和偏离报警模块;所述道路图像获取模块包括红外摄像头和CCD摄像头,用以获取实时的路况图像;所述道路图像处理模块对获取到的道路图像进行车道线的检测,所述偏离报警模块结合汽车偏离车道的时间和汽车偏移角,利用所检测车道线的曲率信息,进行汽车偏离报警,本发明解决在道路阴影、模糊、遮挡等复杂道路场景中车道线检测难的问题,显著降低弯曲道路、汽车过道压线以及汽车转向的错误报警问题。鲁棒性强、实时性高,具有很强的创造性。

Figure 202010055760

The invention relates to the technical field of lane line detection, in particular to a lane departure alarm system; it includes a road image acquisition module, a road image processing module and a deviation alarm module; the road image acquisition module includes an infrared camera and a CCD camera for acquiring real-time The road image processing module detects the lane line on the obtained road image, and the departure alarm module combines the time when the car deviates from the lane and the deviation angle of the car, and uses the curvature information of the detected lane line to carry out the detection of the car. Departure alarm, the present invention solves the problem of difficult lane line detection in complex road scenes such as road shadows, blurring, and occlusion, and significantly reduces the problem of false alarms on curved roads, vehicle aisle pressure lines, and vehicle steering. Strong robustness, high real-time performance, and strong creativity.

Figure 202010055760

Description

一种车道偏离报警系统A lane departure warning system

技术领域technical field

本发明涉及车道线检测技术领域,具体涉及一种车道偏离报警系统。The invention relates to the technical field of lane line detection, in particular to a lane departure warning system.

背景技术Background technique

当前,大多数的车道偏离报警系统都是首先通过车载的CCD摄像头、红外摄像头获取道路图像,系统主机去通过图像处理算法检测出车道线,然后再计算出当前汽车在当前行驶道路上是否车道偏离,最后根据计算结果进行车道偏离报警。At present, most lane departure warning systems first obtain road images through on-board CCD cameras and infrared cameras, and the system host detects lane lines through image processing algorithms, and then calculates whether the current vehicle is on the current road. , and finally carry out a lane departure alarm according to the calculation result.

目前的车道偏离系统的车道检测模块对复杂道路情况下的车道线检测鲁棒性差,只适合比较规则、无干扰的道路情况。在实际复杂的道路场景下,比如断断续续的阴影情况,阴影与道路的边界区域是灰度级突变的地方,传统的边缘检测就会错误的提取出来,将其视为车道线检测处理,造成错误的道路偏离报警。另一方面,所适用的hough变换虽然对直线像素检测效果较好,但实际情况中,弯曲的道路更为常见,当汽车在弯曲道路行驶时,系统主机对道路偏离的计算会和实际情况有较大差异,无法准确的进行道路偏离报警。可见传统技术遇到道路弯曲、道路阴影、遮挡等情况时准确率、鲁棒性会显著下降,不具有普适性。The lane detection module of the current lane departure system has poor robustness to lane line detection under complex road conditions, and is only suitable for comparison of regular and interference-free road conditions. In the actual complex road scene, such as the intermittent shadow situation, the boundary area between the shadow and the road is the place where the gray level suddenly changes, the traditional edge detection will erroneously extract it and treat it as a lane line detection process, causing errors road departure warning. On the other hand, although the applied hough transform has a better effect on the detection of straight pixels, in practice, curved roads are more common. When the car is driving on a curved road, the calculation of the road deviation by the system host will be different from the actual situation. If the difference is large, the road deviation alarm cannot be accurately performed. It can be seen that the accuracy and robustness of the traditional technology will be significantly reduced when encountering road bends, road shadows, occlusions, etc., and it is not universal.

除此之外,大多数的车道偏离报警模型是基于汽车当前的坐标信息去衡量汽车是否偏离车道。当汽车距离两边车道的距离小于一定的安全距离阈值时,判断汽车将偏离车道。这种方法计算简单,但是在靠车道线较近行驶时会造成误报,以及汽车突然发生大幅的方向偏离时又不能正确的及时进行偏离报警。In addition, most lane departure warning models are based on the current coordinate information of the car to measure whether the car deviates from the lane. When the distance between the car and the lanes on both sides is less than a certain safety distance threshold, it is judged that the car will deviate from the lane. This method is simple to calculate, but it will cause false alarms when driving closer to the lane line, and when the car suddenly deviates greatly in direction, it cannot correctly and timely issue a deviation alarm.

发明内容SUMMARY OF THE INVENTION

针对现有技术的不足,本发明公开了一种车道偏离报警系统,为了适应各种复杂道路如阴影、遮挡、模糊等道路场景下的道路检测和道路偏离报警功能,提高道路偏离预警的准确性、及时性。Aiming at the deficiencies of the prior art, the present invention discloses a lane departure warning system, in order to adapt to the road detection and road departure warning functions in various complex roads such as shadow, occlusion, blur and other road scenarios, and improve the accuracy of road departure warning , timeliness.

本发明通过以下技术方案予以实现:The present invention is achieved through the following technical solutions:

一种车道偏离报警系统,包括系统主机,所述系统主机用于信息处理存储和命令发送及执行;还包括道路图像获取模块、道路图像处理模块和偏离报警模块;所述道路图像获取模块包括红外摄像头和CCD摄像头,用以获取实时的路况图像;所述道路图像处理模块对获取到的道路图像进行车道线的检测,所述偏离报警模块结合汽车偏离车道的时间和汽车偏移角,利用所检测车道线的曲率信息,进行汽车偏离报警。A lane departure alarm system, comprising a system host, which is used for information processing, storage, command sending and execution; further comprising a road image acquisition module, a road image processing module and a deviation alarm module; the road image acquisition module includes an infrared A camera and a CCD camera are used to obtain real-time road conditions images; the road image processing module detects the lane lines on the obtained road images, and the deviation alarm module combines the time when the car deviates from the lane and the car deviation angle, and uses all the Detect the curvature information of the lane line, and carry out the vehicle departure alarm.

更进一步的,所述道路图像处理模块包括预处理、边缘提取、滑动窗口分组和车道线拟合。Further, the road image processing module includes preprocessing, edge extraction, sliding window grouping and lane line fitting.

更进一步的,所述预处理主要的处理有将彩色的道路图像灰度化和,计算公式如下:Further, the main processing of the preprocessing is to gray-scale the color road image, and the calculation formula is as follows:

Grey=R*0.299+G*0.587+B*0.114Grey=R*0.299+G*0.587+B*0.114

其中的R、G、B分别为红色、绿色、蓝色通道;where R, G, and B are red, green, and blue channels, respectively;

对于图像的下采样,算法采用的双线性插值的方法,点(x,y)用双线性插值进行放缩后的浮点坐标为(x1+u,y1+v),其中x1,y1是其浮点坐标的整数部分,u,v为浮点坐标的小数部分;则计算公式如下:For image downsampling, the algorithm adopts the method of bilinear interpolation. The floating point coordinates of point (x, y) after scaling by bilinear interpolation are (x1+u, y1+v), where x1, y1 is the integer part of its floating-point coordinates, and u, v are the fractional parts of floating-point coordinates; the calculation formula is as follows:

Figure BDA0002372736390000021
Figure BDA0002372736390000021

更进一步的,所述边缘提取采用高斯平滑滤波器,二维形式如下:Further, the edge extraction adopts a Gaussian smoothing filter, and the two-dimensional form is as follows:

Figure BDA0002372736390000022
Figure BDA0002372736390000022

其中,x,y是距离频率矩形中心的距离,σ是关于中心的扩展度度量;where x, y are the distances from the center of the frequency rectangle, and σ is a measure of the spread about the center;

利用sobel算子进行道路图像的边缘提取工作,sobel算子包含了两组矩阵模版,用于横向和纵向的卷积运算,横向和纵向的卷积模版如下:Use the sobel operator to extract the edge of the road image. The sobel operator includes two sets of matrix templates for horizontal and vertical convolution operations. The horizontal and vertical convolution templates are as follows:

Figure BDA0002372736390000031
Figure BDA0002372736390000031

以下两个公式分别计算每个像素的梯度大小和梯度方向:The following two formulas calculate the gradient magnitude and gradient direction for each pixel, respectively:

Figure BDA0002372736390000032
Figure BDA0002372736390000032

Figure BDA0002372736390000033
Figure BDA0002372736390000033

更进一步的,所述滑动窗口分组对于边缘提取所得到的像素点,利用图像的hog特征大致定位各条车道线的位置;再设置一个一定大小的矩形区域,用两个起始点均值坐标作为矩形区域的下边中点,存储矩形区域内的像素点坐标,对存储的像素点横坐标取均值,计算出点坐标,作为下一窗口的矩形下边中点坐标,按照上述步骤持续搜索下去,直到将所有的车道线像素点分组完毕。Further, for the pixels obtained by edge extraction, the sliding window grouping uses the hog feature of the image to roughly locate the position of each lane line; then a rectangular area of a certain size is set, and the mean coordinates of the two starting points are used as the rectangle. The midpoint of the lower side of the area stores the coordinates of the pixel points in the rectangular area, takes the average value of the abscissas of the stored pixel points, and calculates the point coordinates as the coordinates of the midpoint of the lower side of the rectangle in the next window. Follow the above steps to continue searching until the All lane line pixels are grouped.

更进一步的,所述车道线拟合采用神经网络进行非线性回归的方法取拟合道路车道线,设置6节点的网络隐藏层,采用tanh激活函数进行非线形变化,首先进行线性的变换,公式如下:Further, the lane line fitting adopts the method of nonlinear regression of neural network to fit the road lane lines, sets a network hidden layer of 6 nodes, uses the tanh activation function to perform nonlinear change, and first performs linear transformation, the formula: as follows:

z=θ01x12x2+…+θ6x6 z=θ 01 x 12 x 2 +…+θ 6 x 6

其中θ06为权重,并对结果采用tanh函数进行非线性的变换,公式如下:Among them, θ 06 is the weight, and the result is nonlinearly transformed by the tanh function. The formula is as follows:

Figure BDA0002372736390000034
Figure BDA0002372736390000034

损失函数采用均方误差MSE,公式如下:The loss function adopts the mean square error MSE, and the formula is as follows:

Figure BDA0002372736390000035
Figure BDA0002372736390000035

其中F(zt)为实际值,Predt为预测值;where F(z t ) is the actual value, and Pred t is the predicted value;

采用随机梯度下降法SGD进行最优化求解,其数学公式如下:The stochastic gradient descent method SGD is used to optimize the solution, and its mathematical formula is as follows:

Figure BDA0002372736390000041
Figure BDA0002372736390000041

其中为α学习率,θi最终收敛到最大值。where α is the learning rate, and θi eventually converges to the maximum value.

更进一步的,所述偏离报警模块根据车道线的检测结果,计算出汽车前方车道的曲率,由于车道线两边的相互平行特性,只需对其中一边进行计算,车道曲率Kl计算公式如下:Further, the deviation alarm module calculates the curvature of the lane in front of the car according to the detection result of the lane line. Due to the parallel characteristics of the two sides of the lane line, only one side needs to be calculated. The calculation formula of the lane curvature K is as follows:

Figure BDA0002372736390000042
Figure BDA0002372736390000042

其中y是拟合车道线函数,计算出汽车在t时间内的行驶轨迹曲率Kc;Kp为误差值,只要车道曲率和汽车行驶轨迹曲率差值不超过误差值,则视当前汽车行驶处安全状态,若驾驶员未打开转向灯,且Among them, y is the function of the fitted lane line, and the curvature K c of the driving trajectory of the car in the time t is calculated; K p is the error value. Safe state, if the driver does not turn on the turn signal, and

|Kc-Kl|>Kp |K c -K l |>K p

则进一步计算汽车从当前的位置到汽车驶离当前车道的时间T,将T与设置的安全阈值时间T1比较;T>T1,则汽车当前为安全状态,T<T1,则汽车将发生车道偏离,系统主机控制Led报警器和声音报警器向驾驶员发出报警信号。Then further calculate the time T from the current position of the car to the car leaving the current lane, and compare T with the set safety threshold time T1; T>T1, the car is currently in a safe state, T<T1, then the car will occur lane departure , the system host controls the Led alarm and the sound alarm to send an alarm signal to the driver.

更进一步的,时间T由下面的公式计算得到:

Figure BDA0002372736390000043
Further, the time T is calculated by the following formula:
Figure BDA0002372736390000043

其中,Lx为当前汽车位置到汽车偏离方向车道线的横向距离,V为汽车当前的行驶速度,θ为当前汽车偏离中心纵轴线的角度;Among them, L x is the lateral distance from the current car position to the lane line in the direction of the car’s deviation, V is the current driving speed of the car, and θ is the angle at which the current car deviates from the center longitudinal axis;

Lx的计算公式如下:

Figure BDA0002372736390000044
The formula for calculating Lx is as follows:
Figure BDA0002372736390000044

其中L0当前汽车中心位置到汽车偏离方向车道线的横向距离,Wl为车道的宽度,Wc为汽车的宽度。Among them, L 0 is the lateral distance from the current car center position to the lane line in the direction that the car deviates, W l is the width of the lane, and W c is the width of the car.

本发明的有益效果为:The beneficial effects of the present invention are:

本发明所设计的车道偏离报警模型结合了汽车偏离车道的时间和汽车偏移角,充分的利用所检测车道线的曲率信息。可以有效解决弯曲道路、汽车过道压线以及汽车转向的错误报警问题,同时大幅提高偏离报警准确性,解决在道路阴影、模糊、遮挡等复杂道路场景中车道线检测难的问题,显著降低弯曲道路、汽车过道压线以及汽车转向的错误报警问题。鲁棒性强、实时性高。The lane departure alarm model designed by the invention combines the time when the vehicle deviates from the lane and the vehicle deviation angle, and fully utilizes the curvature information of the detected lane line. It can effectively solve the problem of false alarms on curved roads, car aisle pressure lines and car steering, while greatly improving the accuracy of deviation alarms, solving the problem of difficult lane line detection in complex road scenes such as road shadows, blurring, and occlusion, and significantly reducing curvy roads. , car aisle pressure line and car steering error alarm problems. Strong robustness and high real-time performance.

附图说明Description of drawings

为了更清楚地说明本发明实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to explain the embodiments of the present invention or the technical solutions in the prior art more clearly, the following briefly introduces the accompanying drawings that need to be used in the description of the embodiments or the prior art. Obviously, the accompanying drawings in the following description are only These are some embodiments of the present invention. For those of ordinary skill in the art, other drawings can also be obtained according to these drawings without creative efforts.

图1是本发明的整体流程框图。FIG. 1 is a block diagram of the overall flow of the present invention.

具体实施方式Detailed ways

为使本发明实施例的目的、技术方案和优点更加清楚,下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。In order to make the purposes, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments These are some embodiments of the present invention, but not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present invention.

实施例1Example 1

参照图1,本实施例公开了一种车道偏离报警系统,包括系统主机,所述系统主机用于信息处理存储和命令发送及执行;还包括道路图像获取模块、道路图像处理模块和偏离报警模块;所述道路图像获取模块包括红外摄像头和CCD摄像头,用以获取实时的路况图像;所述道路图像处理模块对获取到的道路图像进行车道线的检测,所述偏离报警模块结合汽车偏离车道的时间和汽车偏移角,利用所检测车道线的曲率信息,进行汽车偏离报警;所述道路图像处理模块包括预处理、边缘提取、滑动窗口分组和车道线拟合Referring to FIG. 1 , the present embodiment discloses a lane departure warning system, including a system host, which is used for information processing, storage, command sending and execution; and a road image acquisition module, a road image processing module, and a departure warning module The road image acquisition module includes an infrared camera and a CCD camera to acquire real-time road conditions images; the road image processing module performs lane line detection on the acquired road images, and the deviation alarm module combines the detection of the vehicle deviating from the lane. Time and vehicle offset angle, using the curvature information of the detected lane line to carry out the vehicle departure alarm; the road image processing module includes preprocessing, edge extraction, sliding window grouping and lane line fitting

对图像的预处理的目的是为了节省计算量,以及得到更好的算法处理效果。主要的处理有将彩色的道路图像灰度化和,计算公式如下:The purpose of image preprocessing is to save computation and obtain better algorithm processing effect. The main processing is to gray-scale the color road image and the calculation formula is as follows:

Grey=R*0.299+G*0.587+B*0.114Grey=R*0.299+G*0.587+B*0.114

其中的R、G、B分别为红色、绿色、蓝色通道;where R, G, and B are red, green, and blue channels, respectively;

对于图像的下采样,算法采用的双线性插值的方法,此种方法不会导致图像失真,处理效果好,且计算量不会太大。点(x,y)用双线性插值进行放缩后的浮点坐标为(x1+u,y1+v),其中x1,y1是其浮点坐标的整数部分,u,v为浮点坐标的小数部分。则计算公式如下:For image downsampling, the algorithm adopts the bilinear interpolation method, this method will not cause image distortion, the processing effect is good, and the calculation amount is not too large. The floating point coordinates of point (x, y) scaled by bilinear interpolation are (x1+u, y1+v), where x1, y1 are the integer parts of its floating point coordinates, and u, v are floating point coordinates the fractional part of . The calculation formula is as follows:

Figure BDA0002372736390000061
Figure BDA0002372736390000061

对于处理后的图像在进行边缘提取之前,由于交通道路上采集到的图像难免会受到恶劣天气、灰尘、阴天等不确定因素的影响而存在一些噪声和杂散的梯度,所以要对原图进行一定的图像增强,以便于后续得到更好的处理效果,本实施例采用的是高斯平滑滤波器,其模板系数,随着距离模板中心的增大而系数减小,这样有助于抑制噪声而又不会过度的模糊图像。高斯滤波器的二维形式如下:Before edge extraction is performed on the processed image, since the image collected on the traffic road will inevitably be affected by uncertain factors such as bad weather, dust and cloudy days, there will be some noise and stray gradients. A certain amount of image enhancement is performed so as to obtain a better processing effect in the future. In this embodiment, a Gaussian smoothing filter is used, and its template coefficient decreases as the distance from the template center increases, which helps to suppress noise. without overly blurring the image. The two-dimensional form of the Gaussian filter is as follows:

Figure BDA0002372736390000062
Figure BDA0002372736390000062

其中,x,y是距离频率矩形中心的距离,σ是关于中心的扩展度度量;where x, y are the distances from the center of the frequency rectangle, and σ is a measure of the spread about the center;

高斯滤波器的旋转对称性以及单瓣的傅立叶变换频谱使得图像中既含有低频分量,又含有高频分量的图像边缘不会被不需要的高频信号所污染,同时保留了大部分所需信号,有利于后续的图像边缘提取。The rotational symmetry of the Gaussian filter and the single-lobe Fourier transform spectrum make the image edges containing both low-frequency components and high-frequency components not polluted by unwanted high-frequency signals, while retaining most of the desired signals , which is beneficial to the subsequent image edge extraction.

随后我们利用sobel算子进行道路图像的边缘提取工作,sobel算子包含了两组矩阵模版,用于横向和纵向的卷积运算,横向和纵向的卷积模版如下:Then we use the sobel operator to extract the edge of the road image. The sobel operator contains two sets of matrix templates for horizontal and vertical convolution operations. The horizontal and vertical convolution templates are as follows:

Figure BDA0002372736390000071
Figure BDA0002372736390000071

以下两个公式分别计算每个像素的梯度大小和梯度方向:The following two formulas calculate the gradient magnitude and gradient direction for each pixel, respectively:

Figure BDA0002372736390000072
Figure BDA0002372736390000072

Figure BDA0002372736390000073
Figure BDA0002372736390000073

对于边缘提取所得到的像素点,需要进一步对其进行分组,区分出每一条车道线。本实施例采用的是滑动窗口的方法,首先利用图像的hog特征大致定位各条车道线的位置。再设置一个一定大小的矩形区域,用两个起始点均值坐标作为矩形区域的下边中点,存储矩形区域内的像素点坐标,对存储的像素点横坐标取均值,计算出点坐标,作为下一窗口的矩形下边中点坐标,按照上述步骤持续搜索下去,直到将所有的车道线像素点分组完毕。For the pixels obtained by edge extraction, it needs to be further grouped to distinguish each lane line. This embodiment adopts the sliding window method. First, the positions of each lane line are roughly located by using the hog feature of the image. Then set a rectangular area of a certain size, use the average coordinates of the two starting points as the lower midpoint of the rectangular area, store the coordinates of the pixel points in the rectangular area, take the average of the stored abscissas of the pixel points, and calculate the point coordinates as the lower The coordinates of the midpoint below the rectangle of a window, continue to search according to the above steps, until all the lane line pixels are grouped.

多数的插值方法拟合曲线往往拟合曲线的精度不够,本实施例采用的是神经网络进行非线性回归的方法取拟合道路车道线。设置6节点的网络隐藏层,采用tanh激活函数进行非线形变化。首先进行线性的变换,公式如下:Most of the interpolation methods for fitting curves are often not accurate enough to fit the curves. In this embodiment, a method of nonlinear regression performed by a neural network is used to obtain the fitted road lane lines. The hidden layer of the network with 6 nodes is set, and the tanh activation function is used for nonlinear change. First perform a linear transformation, the formula is as follows:

z=θ01x12x2+…+θ6x6 z=θ 01 x 12 x 2 +…+θ 6 x 6

对结果采用tanh函数进行非线性的变换,公式如下:The result is nonlinearly transformed by the tanh function, and the formula is as follows:

Figure BDA0002372736390000074
Figure BDA0002372736390000074

损失函数采用均方误差MSE,公式如下:The loss function adopts the mean square error MSE, and the formula is as follows:

Figure BDA0002372736390000081
Figure BDA0002372736390000081

采用随机梯度下降法SGD进行最优化求解,其数学公式如下:The stochastic gradient descent method SGD is used to optimize the solution, and its mathematical formula is as follows:

Figure BDA0002372736390000082
Figure BDA0002372736390000082

本实施例所设计的车道偏离报警模型结合了汽车偏离车道的时间和汽车偏移角,充分的利用所检测车道线的曲率信息。可以有效解决弯曲道路、汽车过道压线以及汽车转向的错误报警问题,同时大幅提高偏离报警准确性。The lane departure warning model designed in this embodiment combines the time when the car deviates from the lane and the deviation angle of the car, and makes full use of the curvature information of the detected lane line. It can effectively solve the problem of false alarms on curved roads, car aisle pressure lines and car steering, and at the same time greatly improve the accuracy of deviation alarms.

根据车道线的检测结果,计算出汽车前方车道的曲率,由于车道线两边的相互平行特性,只需对其中一边进行计算,车道曲率Kl计算公式如下:According to the detection result of the lane line, the curvature of the lane in front of the car is calculated. Due to the parallel characteristics of the two sides of the lane line, only one side needs to be calculated. The calculation formula of the lane curvature K l is as follows:

Figure BDA0002372736390000083
Figure BDA0002372736390000083

其中y是拟合车道线函数,计算出汽车在t时间内的行驶轨迹曲率Kc;Kp为误差值,只要车道曲率和汽车行驶轨迹曲率差值不超过误差值,则视当前汽车行驶处安全状态,若驾驶员未打开转向灯,且Among them, y is the function of the fitted lane line, and the curvature K c of the driving trajectory of the car in the time t is calculated; K p is the error value. Safe state, if the driver does not turn on the turn signal, and

|Kc-Kl|>Kp |K c -K l |>K p

则进一步计算汽车从当前的位置到汽车驶离当前车道的时间T,将T与设置的安全阈值时间T1比较;T>T1,则汽车当前为安全状态,T<T1,则汽车将发生车道偏离,系统主机控制Led报警器和声音报警器向驾驶员发出报警信号。Then further calculate the time T from the current position of the car to the car leaving the current lane, and compare T with the set safety threshold time T1; T>T1, the car is currently in a safe state, T<T1, then the car will occur lane departure , the system host controls the Led alarm and the sound alarm to send an alarm signal to the driver.

更进一步的,时间T由下面的公式计算得到:

Figure BDA0002372736390000084
Further, the time T is calculated by the following formula:
Figure BDA0002372736390000084

其中,Lx为当前汽车位置到汽车偏离方向车道线的横向距离,V为汽车当前的行驶速度,θ为当前汽车偏离中心纵轴线的角度;Among them, L x is the lateral distance from the current car position to the lane line in the direction of the car’s deviation, V is the current driving speed of the car, and θ is the angle at which the current car deviates from the center longitudinal axis;

Lx的计算公式如下:

Figure BDA0002372736390000091
The formula for calculating Lx is as follows:
Figure BDA0002372736390000091

其中L0当前汽车中心位置到汽车偏离方向车道线的横向距离,Wl为车道的宽度,Wc为汽车的宽度。Among them, L 0 is the lateral distance from the current car center position to the lane line in the direction that the car deviates, W l is the width of the lane, and W c is the width of the car.

实施例2Example 2

本实施例中,首先将系统主机、红外摄像头、CCD摄像头、声音报警器、led报警器分别安装到汽车上,配置好系统程序所需的依赖库opencv、numpy、tensorflow、python、matplotlib,并启动系统主机。下面是具体的本车道偏离报警系统的实施过程。In this embodiment, first install the system host, infrared camera, CCD camera, sound alarm, and LED alarm on the car, configure the dependent libraries opencv, numpy, tensorflow, python, and matplotlib required by the system program, and start system host. The following is the specific implementation process of the lane departure warning system.

1、处理道路图像:1. Process road images:

摄像头实时拍摄道路图像数据,原始尺寸为2880*1500,传输给系统主机。系统主机进行一定的图像处理以便于后续的功能处理。The camera captures road image data in real time, the original size is 2880*1500, and transmits it to the system host. The system host performs certain image processing to facilitate subsequent functional processing.

使用cv2.VideoCapture()方法去获取道路图像的一帧图像,对彩色道路图像利用公式Gray=R*0.299+G*0.587+B*0.114进行灰度变换,以及对图像进行相应的下采样操作。Use the cv2.VideoCapture() method to obtain a frame of road image, perform grayscale transformation on the color road image using the formula Gray=R*0.299+G*0.587+B*0.114, and perform corresponding downsampling operations on the image.

根据实际的车辆采取到的道路图像构局去确定好ROI选取的区域,确定好矩形四点(x1,y1),(x2,y2),(x3,y3),(x4,y4)的坐标。使用数学公式计算出由源图像中矩形到目标图像矩形变换的矩阵。再使用cv2.warpPerspective()实现图像的透视变换。According to the road image structure taken by the actual vehicle, determine the area selected by the ROI, and determine the coordinates of the four rectangular points (x1, y1), (x2, y2), (x3, y3), (x4, y4). Calculates the matrix that transforms the rectangles in the source image to the rectangles in the destination image using a mathematical formula. Then use cv2.warpPerspective() to realize the perspective transformation of the image.

2、道路车道线提取2. Road lane line extraction

采用Sobel算子对图像进行道路边缘提取,用于提取出道路车道线的像素。在这之前要先将图像矩阵转换成uint8类型方便操作,然后利用cv2.Sobel()函数传入图像数据进行边缘提取。The Sobel operator is used to extract the road edge of the image, which is used to extract the pixels of the road lane line. Before this, convert the image matrix to uint8 type for easy operation, and then use the cv2.Sobel() function to pass in the image data for edge extraction.

接着就是对提取的像素点进行车道线的分组。根据提取后图像的hog特征,使用np.argmax()方法去找到最大值的,并确定坐标。再设置相应大小的矩形窗口,使用np.mean()方法去对包含在矩形窗口内的车道线像素坐标取均值,由此计算出下一个矩形窗口的下边中点。不断重复上诉步骤直到将所有搜索完毕。The next step is to group the extracted pixel points with lane lines. According to the hog feature of the extracted image, use the np.argmax() method to find the maximum value and determine the coordinates. Then set a rectangular window of the corresponding size, and use the np.mean() method to average the pixel coordinates of the lane lines contained in the rectangular window, thereby calculating the lower midpoint of the next rectangular window. Keep repeating the appeal steps until all searches are complete.

对于车道线的拟合,使用tf.Variable()函数去声明[1,6]的张量,用tf.nn.tanh()函数去进行非线性变换,tf.reduce_mean()函数去搭建损失函数,最后使用tf.train.GradientDescentOptimizer()去训练参数,得到最优值以及sess.run()去启动计算图。For lane line fitting, use the tf.Variable() function to declare the tensor of [1,6], use the tf.nn.tanh() function to perform nonlinear transformation, and use the tf.reduce_mean() function to build the loss function , and finally use tf.train.GradientDescentOptimizer() to train the parameters, get the optimal value and sess.run() to start the calculation graph.

3、道路偏离报警3. Road departure alarm

系统主机先获取当前汽车的偏离角度、曲率、速度、车道宽度,然后根据建立的车道偏离模型,计算是否发生车道偏离,随后依据判定的结果控制led报警器和声音报警器。The system host first obtains the departure angle, curvature, speed, and lane width of the current car, and then calculates whether the lane departure occurs according to the established lane departure model, and then controls the LED alarm and sound alarm according to the judgment result.

本实施例所设计的车道偏离报警模型结合了汽车偏离车道的时间和汽车偏移角,充分的利用所检测车道线的曲率信息。可以有效解决弯曲道路、汽车过道压线以及汽车转向的错误报警问题,同时大幅提高偏离报警准确性,解决在道路阴影、模糊、遮挡等复杂道路场景中车道线检测难的问题,显著降低弯曲道路、汽车过道压线以及汽车转向的错误报警问题。鲁棒性强、实时性高。The lane departure warning model designed in this embodiment combines the time when the car deviates from the lane and the deviation angle of the car, and makes full use of the curvature information of the detected lane line. It can effectively solve the problem of false alarms on curved roads, car aisle pressure lines and car steering, while greatly improving the accuracy of deviation alarms, solving the problem of difficult lane line detection in complex road scenes such as road shadows, blurring, and occlusion, and significantly reducing curvy roads. , car aisle pressure line and car steering error alarm problems. Strong robustness and high real-time performance.

以上实施例仅用以说明本发明的技术方案,而非对其限制;尽管参照前述实施例对本发明进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本发明各实施例技术方案的精神和范围。The above embodiments are only used to illustrate the technical solutions of the present invention, but not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that: The recorded technical solutions are modified, or some technical features thereof are equivalently replaced; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims (8)

1. A lane departure warning system comprises a system host, wherein the system host is used for information processing storage and command sending and execution; the system is characterized by comprising a road image acquisition module, a road image processing module and a deviation alarm module; the road image acquisition module comprises an infrared camera and a CCD camera and is used for acquiring real-time road condition images; the road image processing module detects lane lines of the acquired road image, and the departure warning module performs car departure warning by combining the time when the car departs from the lane and the car departure angle and utilizing the curvature information of the detected lane lines.
2. The lane departure warning system of claim 1, wherein the road image processing module includes preprocessing, edge extraction, sliding window grouping, and lane line fitting.
3. The lane departure warning system according to claim 2, wherein the preprocessing mainly processes a color road image by graying out a sum, and a calculation formula is as follows:
Grey=R*0.299+G*0.587+B*0.114
r, G, B are respectively red, green and blue channels;
for the down sampling of the image, the algorithm adopts a bilinear interpolation method, the floating point coordinates of the point (x, y) which is scaled by the bilinear interpolation are (x1+ u, y1+ v), wherein x1 and y1 are integer parts of the floating point coordinates, and u and v are decimal parts of the floating point coordinates; the calculation formula is as follows:
Figure FDA0002372736380000011
4. the lane departure warning system according to claim 2, wherein the edge extraction employs a gaussian smoothing filter in two dimensions of:
Figure FDA0002372736380000012
where x, y are the distances from the center of the frequency rectangle, and σ is a measure of the spread about the center;
the method comprises the following steps of utilizing a sobel operator to carry out edge extraction work of a road image, wherein the sobel operator comprises two groups of matrix templates and is used for transverse and longitudinal convolution operation, and the transverse and longitudinal convolution templates are as follows:
Figure FDA0002372736380000021
the gradient magnitude and gradient direction of each pixel are calculated by the following two formulas:
Figure FDA0002372736380000022
Figure FDA0002372736380000023
5. the lane departure warning system according to claim 2, wherein the sliding window grouping roughly locates the position of each lane line using the hog feature of the image for the pixel points obtained by the edge extraction; and setting a rectangular area with a certain size, using the mean coordinates of the two starting points as the lower middle point of the rectangular area, storing the coordinates of the pixel points in the rectangular area, averaging the horizontal coordinates of the stored pixel points, calculating the coordinates of the points as the coordinates of the lower middle point of the rectangle of the next window, and continuously searching according to the steps until all the lane line pixel points are completely grouped.
6. The lane departure warning system according to claim 2, wherein the lane line fitting adopts a neural network to perform nonlinear regression to obtain a fitted lane line, a network hidden layer with 6 nodes is provided, a tanh activation function is used to perform nonlinear change, first linear transformation is performed, and the formula is as follows:
z=θ01x12x2+…+θ6x6
wherein theta is06The weight is taken as the weight, and the result is nonlinearly transformed by using a tanh function, and the formula is as follows:
Figure FDA0002372736380000024
the loss function adopts mean square error MSE, and the formula is as follows:
Figure FDA0002372736380000025
wherein F (z)t) As actual value, PredtIs a predicted value;
the method adopts a random gradient descent method SGD to carry out optimization solution, and the mathematical formula is as follows:
Figure FDA0002372736380000031
where is the α learning rate, θiEventually converging to a maximum value.
7. The lane departure warning system according to claim 2, wherein the departure warning module calculates the curvature of the lane ahead of the vehicle based on the detection result of the lane line, only one side of the lane is calculated due to the parallel characteristic of the two sides of the lane line, and the curvature K of the lanelThe calculation formula is as follows:
Figure FDA0002372736380000032
wherein y is a fitted lane line function, and the curvature K of the driving track of the automobile in the time t is calculatedc;KpAs an error value, if the difference between the curvature of the lane and the curvature of the driving track of the automobile does not exceed the error value, the driver looks at the safety state of the driving position of the automobile, and if the driver does not turn on the turn signal lamp, the driver turns on the turn signal lamp
|Kc-Kl|>Kp
Further calculating the time T from the current position to the time T when the automobile leaves the current lane, and comparing the T with the set safe threshold time T1; t is greater than T1, the automobile is in a safe state at present, T < T1, the automobile deviates from a lane, and the host computer of the system controls the Led alarm and the voice alarm to send out alarm signals to a driver.
8. The lane departure warning system according to claim 7, wherein the time T is calculated by the following equation:
Figure FDA0002372736380000033
wherein L isxThe transverse distance from the current automobile position to the lane line of the automobile in the deviation direction is shown, V is the current running speed of the automobile, and theta is the angle of the current automobile deviating from the central longitudinal axis;
Lxthe calculation formula of (a) is as follows:
Figure FDA0002372736380000034
wherein L is0The transverse distance, W, from the current center position of the vehicle to the lane line of the vehicle in the direction of departurelIs the width of the lane, WcThe width of the car.
CN202010055760.8A 2020-01-17 2020-01-17 Lane departure warning system Pending CN111260957A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010055760.8A CN111260957A (en) 2020-01-17 2020-01-17 Lane departure warning system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010055760.8A CN111260957A (en) 2020-01-17 2020-01-17 Lane departure warning system

Publications (1)

Publication Number Publication Date
CN111260957A true CN111260957A (en) 2020-06-09

Family

ID=70952240

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010055760.8A Pending CN111260957A (en) 2020-01-17 2020-01-17 Lane departure warning system

Country Status (1)

Country Link
CN (1) CN111260957A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112419345A (en) * 2020-12-04 2021-02-26 盐城中科高通量计算研究院有限公司 Patrol car high-precision tracking method based on echo state network

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2008276285A (en) * 2007-04-25 2008-11-13 Denso Corp Travel information collecting device
CN102514572A (en) * 2012-01-17 2012-06-27 湖南大学 Lane departure early warning method
CN103676949A (en) * 2012-09-03 2014-03-26 现代摩比斯株式会社 Lane keeping control system and method
CN105752154A (en) * 2014-10-15 2016-07-13 华创车电技术中心股份有限公司 Vehicle steering control system and method

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2008276285A (en) * 2007-04-25 2008-11-13 Denso Corp Travel information collecting device
CN102514572A (en) * 2012-01-17 2012-06-27 湖南大学 Lane departure early warning method
CN103676949A (en) * 2012-09-03 2014-03-26 现代摩比斯株式会社 Lane keeping control system and method
CN105752154A (en) * 2014-10-15 2016-07-13 华创车电技术中心股份有限公司 Vehicle steering control system and method

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
卢卫娜等: "基于单目视觉的车道线和道路边界同步检测", 《传感技术学报》 *
韩高格等: "基于均值漂移的车道线检测模型", 《赤峰学院学报(自然科学版)》 *

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112419345A (en) * 2020-12-04 2021-02-26 盐城中科高通量计算研究院有限公司 Patrol car high-precision tracking method based on echo state network
CN112419345B (en) * 2020-12-04 2024-11-26 盐城中科高通量计算研究院有限公司 High-precision tracking method for patrol cars based on echo state network

Similar Documents

Publication Publication Date Title
CN110222591B (en) Lane line detection method based on deep neural network
CN106529493B (en) Robust multi-lane line detection method based on perspective view
CN109657632B (en) A method of lane line detection and recognition
CN107679520B (en) Lane line visual detection method suitable for complex conditions
CN104408460B (en) A kind of lane detection and tracking detection method
CN110298216B (en) Vehicle Departure Warning Method Based on Adaptive Threshold Segmentation of Lane Line Gradient Image
Jung et al. A robust linear-parabolic model for lane following
CN104318258B (en) Time domain fuzzy and kalman filter-based lane detection method
CN102750708B (en) Affine motion target tracing algorithm based on fast robust feature matching
CN104217427B (en) Lane line localization method in a kind of Traffic Surveillance Video
Choi et al. Vision-based fusion of robust lane tracking and forward vehicle detection in a real driving environment
CN104809433B (en) A kind of zebra line detecting method based on maximum stable region and stochastical sampling
CN103902985B (en) High-robustness real-time lane detection algorithm based on ROI
CN105069859B (en) Vehicle running state monitoring method and device
CN106887004A (en) A kind of method for detecting lane lines based on Block- matching
CN104268860B (en) A kind of method for detecting lane lines
CN107895151A (en) Method for detecting lane lines based on machine vision under a kind of high light conditions
CN107895375A (en) The complicated Road extracting method of view-based access control model multiple features
CN105389561A (en) Method for detecting bus lane based on video
Jiang et al. Lane line detection optimization algorithm based on improved Hough transform and R-least squares with dual removal
CN107133600A (en) A kind of real-time lane line detection method based on intra-frame trunk
CN110171263A (en) A kind of bend identification and overall height adjusting method for ECAS system
Wang et al. Lane detection algorithm based on density clustering and RANSAC
Gupta et al. Robust lane detection using multiple features
CN111260957A (en) Lane departure warning system

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
RJ01 Rejection of invention patent application after publication

Application publication date: 20200609