CN115546754A - Training method of lane line detection model - Google Patents
Training method of lane line detection model Download PDFInfo
- Publication number
- CN115546754A CN115546754A CN202211386783.2A CN202211386783A CN115546754A CN 115546754 A CN115546754 A CN 115546754A CN 202211386783 A CN202211386783 A CN 202211386783A CN 115546754 A CN115546754 A CN 115546754A
- Authority
- CN
- China
- Prior art keywords
- line
- anchor
- straight
- anchor line
- lines
- 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.)
- Granted
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; 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
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V10/00—Arrangements for image or video recognition or understanding
- G06V10/70—Arrangements for image or video recognition or understanding using pattern recognition or machine learning
- G06V10/77—Processing image or video features in feature spaces; using data integration or data reduction, e.g. principal component analysis [PCA] or independent component analysis [ICA] or self-organising maps [SOM]; Blind source separation
- G06V10/774—Generating sets of training patterns; Bootstrap methods, e.g. bagging or boosting
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V10/00—Arrangements for image or video recognition or understanding
- G06V10/70—Arrangements for image or video recognition or understanding using pattern recognition or machine learning
- G06V10/82—Arrangements for image or video recognition or understanding using pattern recognition or machine learning using neural networks
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Evolutionary Computation (AREA)
- Multimedia (AREA)
- General Physics & Mathematics (AREA)
- Physics & Mathematics (AREA)
- Databases & Information Systems (AREA)
- General Health & Medical Sciences (AREA)
- Medical Informatics (AREA)
- Software Systems (AREA)
- Computing Systems (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Artificial Intelligence (AREA)
- Health & Medical Sciences (AREA)
- Image Analysis (AREA)
Abstract
本发明提供了一种车道线检测模型的训练方法,涉及神经网络模型训练技术领域。本发明先获取道路样本图像,道路样本图像标注有真实车道线,然后将道路样本图像输入至预先建立的初始模型中,然后以道路样本图像的底边为横轴,在横轴上选取锚点,然后以锚点为起点生成多个不同预设角度的直线锚线,并生成与直线锚线相切的曲线锚线,最后根据真实车道线与各个直线锚线之间的距离以及真实车道线与各个曲线锚线之间的距离对初始模型的参数进行调整,以训练初始模型。上述技术方案在对初始模型进行训练时不仅仅生成直线锚线,还生成曲线锚线,可以兼顾普通场景下的车道线的检测和弯道场景下的车道线的检测,提高了弯道场景下车道线检测的准确率。
The invention provides a training method for a lane line detection model, and relates to the technical field of neural network model training. In the present invention, the road sample image is first obtained, and the road sample image is marked with real lane lines, and then the road sample image is input into the pre-established initial model, and then the bottom edge of the road sample image is taken as the horizontal axis, and the anchor point is selected on the horizontal axis , and then generate multiple straight anchor lines with different preset angles starting from the anchor point, and generate curved anchor lines tangent to the straight anchor lines, and finally according to the distance between the real lane line and each straight anchor line and the real lane line The distance from each curve anchor line adjusts the parameters of the initial model to train the initial model. The above technical solution not only generates straight anchor lines but also curve anchor lines when training the initial model, which can take into account the detection of lane lines in normal scenes and the detection of lane lines in curve scenes, and improves the performance of curve lines in curve scenes. Accuracy of lane line detection.
Description
技术领域technical field
本发明涉及神经网络模型训练技术领域,特别是涉及一种车道线检测模型的训练方法。The invention relates to the technical field of neural network model training, in particular to a training method for a lane line detection model.
背景技术Background technique
目前使用深度学习的车道线检测方法分为有anchor(锚线或锚框)的车道线检测方法与无anchor的车道线检测方法。在有anchor的车道线检测方法中,anchor的作用为通过预设一些固定的锚框或者锚线,为车道线的预测提供位置参考,在卷积神经网络模型训练的过程中,通过计算标注的真实车道线与预设的锚框或者锚线之间的距离,让神经网络模型进行参数学习,再用训练好的模型去进行车道线预测。anchor的设定与生成方式可以在很大程度上影响车道线检测的效果与效率。At present, the lane line detection method using deep learning is divided into the lane line detection method with anchor (anchor line or anchor box) and the lane line detection method without anchor. In the lane line detection method with anchor, the role of the anchor is to provide a position reference for the prediction of the lane line by presetting some fixed anchor boxes or anchor lines. During the training process of the convolutional neural network model, by calculating the marked The distance between the real lane line and the preset anchor frame or anchor line allows the neural network model to perform parameter learning, and then uses the trained model to predict the lane line. The setting and generation of anchor can greatly affect the effect and efficiency of lane line detection.
现有技术中,车道线检测方法在普通场景中检测的准确率可以达到92.14%,但其在弯道场景下的准确率仅有67.72%。不擅长弯道检测的一部分原因是该车道线检测方法使用的锚线均为直线,在训练的过程中不利于模型去学习弯道的特性。In the prior art, the detection accuracy of the lane line detection method in normal scenes can reach 92.14%, but the accuracy rate in curved road scenes is only 67.72%. Part of the reason why it is not good at curve detection is that the anchor lines used in the lane line detection method are all straight lines, which is not conducive to the model to learn the characteristics of curves during the training process.
发明内容Contents of the invention
本发明的目的是要提供一种车道线检测模型的训练方法,解决现有技术中对弯道场景下车道线检测的准确率较低的技术问题。The object of the present invention is to provide a training method for a lane line detection model to solve the technical problem in the prior art that the accuracy of lane line detection in a curved road scene is low.
根据本发明的目的,本发明提供了一种车道线检测模型的训练方法,包括以下步骤:According to the purpose of the present invention, the present invention provides a kind of training method of lane line detection model, comprises the following steps:
获取道路样本图像,所述道路样本图像标注有真实车道线;Obtaining a road sample image, where the road sample image is marked with real lane lines;
将所述道路样本图像输入至预先建立的初始模型中;inputting the road sample image into a pre-established initial model;
以所述道路样本图像的底边为横轴,在所述横轴上选取锚点;以所述锚点为起点生成多个不同预设角度的直线锚线,并生成与所述直线锚线相切的曲线锚线;Taking the bottom edge of the road sample image as the horizontal axis, selecting an anchor point on the horizontal axis; using the anchor point as a starting point to generate a plurality of straight anchor lines with different preset angles, and generating a line anchor line with the straight line anchor line tangent curve anchor line;
根据所述真实车道线与各个直线锚线之间的距离以及所述真实车道线与各个曲线锚线之间的距离对所述初始模型的参数进行调整,以训练所述初始模型。The parameters of the initial model are adjusted according to the distance between the real lane line and each straight anchor line and the distance between the real lane line and each curved anchor line, so as to train the initial model.
可选地,所述以所述锚点为起点生成多个不同预设角度的直线锚线,并生成与所述直线锚线相切的曲线锚线的步骤中,所有所述曲线锚线的曲率均为预设曲率,且除垂直于所述横轴的直线锚线外,其他直线锚线中任一直线锚线仅生成一个曲线锚线,垂直于所述横轴的直线锚线生成两条曲线锚线。Optionally, in the step of generating a plurality of straight anchor lines with different preset angles starting from the anchor point, and generating a curved anchor line tangent to the straight anchor line, all of the curved anchor lines The curvatures are all preset curvatures, and except for the straight anchor line perpendicular to the horizontal axis, any straight anchor line in the other straight line anchor lines only generates one curved anchor line, and the straight line anchor lines perpendicular to the horizontal axis generate two A curved anchor line.
可选地,所述曲线锚线的终点的纵坐标小于或等于对应的所述直线锚线终点的纵坐标;Optionally, the ordinate of the end point of the curved anchor line is less than or equal to the ordinate of the corresponding end point of the straight line anchor line;
所述曲线锚线的圆心角大于0°且小于90°。The central angle of the curved anchor line is greater than 0° and less than 90°.
可选地,将所述道路样本图像输入至预先建立的初始模型中的步骤,之后包括以下步骤:Optionally, the step of inputting the road sample image into a pre-established initial model includes the following steps:
以所述道路样本图像的底边为横轴,在所述横轴上选取多个间隔布置的锚点;以多个所述锚点为起点分别生成多个不同预设角度的所述直线锚线,并生成与所述直线锚线相切的曲线锚线。Taking the bottom edge of the road sample image as the horizontal axis, selecting a plurality of anchor points arranged at intervals on the horizontal axis; using the plurality of anchor points as starting points to generate a plurality of linear anchors with different preset angles line, and generate curved anchors tangent to said straight anchors.
可选地,以所述锚点为起点生成多个不同预设角度的直线锚线,并生成与所述直线锚线相切的曲线锚线的步骤之后,还包括以下步骤:Optionally, after the step of generating a plurality of straight anchor lines with different preset angles starting from the anchor point, and generating a curved anchor line tangent to the straight anchor line, the following steps are further included:
根据所述直线锚线的第一夹角和所述曲线锚线的半径计算所述曲线锚线的函数表达式,所述预设角度为所述直线锚线与所述横轴之间的第一夹角。The functional expression of the curved anchor line is calculated according to the first included angle of the straight anchor line and the radius of the curved anchor line, and the preset angle is the first angle between the straight anchor line and the horizontal axis. an angle.
可选地,根据所述直线锚线的所述第一夹角和所述曲线锚线的半径计算所述曲线锚线的函数表达式的步骤,具体包括以下步骤:Optionally, the step of calculating the functional expression of the curved anchor line according to the first included angle of the straight anchor line and the radius of the curved anchor line specifically includes the following steps:
根据所述直线锚线的所述第一夹角计算所述曲线锚线的起始线与所述横轴之间的第二夹角,所述曲线锚线的起始线为所述曲线锚线的圆心与所述锚点之间的直线;Calculate the second included angle between the starting line of the curved anchor line and the horizontal axis according to the first included angle of the straight anchor line, and the starting line of the curved anchor line is the curved anchor line A straight line between the center of the line and said anchor point;
根据所述第二夹角和所述曲线锚线的半径计算所述曲线锚线的圆心坐标;calculating the coordinates of the center of the curve anchor line according to the second angle and the radius of the curve anchor line;
根据所述曲线锚线的圆心坐标确定所述曲线锚线的函数表达式。The function expression of the curve anchor line is determined according to the center coordinates of the curve anchor line.
可选地,根据所述曲线锚线的圆心坐标计算所述曲线锚线的函数表达式的步骤之后,还包括以下步骤:Optionally, after the step of calculating the functional expression of the curve anchor line according to the center coordinates of the curve anchor line, the following steps are further included:
选取多个分割线,所述多个分割线为平行于所述横轴且纵坐标不为零的直线;Selecting multiple dividing lines, the multiple dividing lines are straight lines parallel to the horizontal axis and whose vertical coordinates are not zero;
根据所述多个分割线的纵坐标、所述直线锚线的函数表达式和所述曲线锚线的函数表达式分别计算所述多个分割线与所述直线锚线、所述曲线锚线相交的交点的多个横坐标,所述直线锚线的函数表达式根据所述第一夹角和所述锚点的坐标计算得出。According to the ordinates of the plurality of dividing lines, the functional expression of the straight anchor line and the functional expression of the curved anchor line, respectively calculate the plurality of dividing lines, the straight anchor line, and the curved anchor line A plurality of abscissas of the intersecting intersection points, the functional expression of the straight line anchor line is calculated according to the first included angle and the coordinates of the anchor point.
可选地,根据所述真实车道线与各个直线锚线之间的距离以及所述真实车道线与各个曲线锚线之间的距离对所述初始模型的参数进行调整,以训练所述初始模型的步骤,具体包括以下步骤:Optionally, adjust the parameters of the initial model according to the distance between the real lane line and each straight anchor line and the distance between the real lane line and each curved anchor line, so as to train the initial model The steps specifically include the following steps:
根据所述多个分割线与所述直线锚线、所述曲线锚线相交的交点的多个横坐标与所述车道线训练图像中车道线之间的横向距离调整所述初始模型的参数,从而对所述初始模型进行训练。Adjusting the parameters of the initial model according to the multiple abscissas of intersection points of the plurality of dividing lines and the straight anchor line and the curved anchor line and the lateral distance between the lane lines in the lane line training image, The initial model is thus trained.
可选地,根据以下公式计算所述曲线锚线的圆心坐标:Optionally, calculate the coordinates of the center of the curve anchor line according to the following formula:
x1=x0+R*cos(π/2-θ);x 1 =x 0 +R*cos(π/2-θ);
y1=-R*sin(π/2-θ);y 1 =-R*sin(π/2-θ);
其中,x1为圆心的横坐标,y1为圆心的纵坐标;Among them, x1 is the abscissa of the center of the circle, and y1 is the ordinate of the center of the circle;
xs为锚点的横坐标,R为曲线锚线的半径,θ为第一夹角,π/2-θ的值为第二夹角。x s is the abscissa of the anchor point, R is the radius of the anchor line of the curve, θ is the first included angle, and the value of π/2-θ is the second included angle.
可选地,所述曲线锚线的函数表达式为:(x–x0)2+(y-y0)2=0。Optionally, the function expression of the curve anchor line is: (x−x 0 ) 2 +(yy 0 ) 2 =0.
本发明先获取道路样本图像,道路样本图像标注有真实车道线,然后将道路样本图像输入至预先建立的初始模型中,然后以道路样本图像的底边为横轴,在横轴上选取锚点,然后以锚点为起点生成多个不同预设角度的直线锚线,并生成与直线锚线相切的曲线锚线,最后根据真实车道线与各个直线锚线之间的距离以及真实车道线与各个曲线锚线之间的距离对初始模型的参数进行调整,以训练初始模型。上述技术方案在对初始模型进行训练时不仅仅生成直线锚线,还生成曲线锚线,可以兼顾普通场景下的车道线的检测和弯道场景下的车道线的检测,提高了弯道场景下车道线检测的准确率。In the present invention, the road sample image is obtained first, and the road sample image is marked with real lane lines, and then the road sample image is input into the pre-established initial model, and then the bottom edge of the road sample image is taken as the horizontal axis, and the anchor point is selected on the horizontal axis , and then use the anchor point as the starting point to generate multiple straight anchor lines with different preset angles, and generate curved anchor lines tangent to the straight anchor lines, and finally according to the distance between the real lane line and each straight anchor line and the real lane line The distance from each curve anchor line adjusts the parameters of the initial model to train the initial model. The above technical solution not only generates straight anchor lines but also curve anchor lines when training the initial model, which can take into account the detection of lane lines in normal scenes and the detection of lane lines in curve scenes, and improves the performance of curve lines in curve scenes. The accuracy of lane line detection.
根据下文结合附图对本发明具体实施例的详细描述,本领域技术人员将会更加明了本发明的上述以及其他目的、优点和特征。Those skilled in the art will be more aware of the above and other objects, advantages and features of the present invention according to the following detailed description of specific embodiments of the present invention in conjunction with the accompanying drawings.
附图说明Description of drawings
后文将参照附图以示例性而非限制性的方式详细描述本发明的一些具体实施例。附图中相同的附图标记标示了相同或类似的部件或部分。本领域技术人员应该理解,这些附图未必是按比例绘制的。附图中:Hereinafter, some specific embodiments of the present invention will be described in detail by way of illustration and not limitation with reference to the accompanying drawings. The same reference numerals in the drawings designate the same or similar parts or parts. Those skilled in the art will appreciate that the drawings are not necessarily drawn to scale. In the attached picture:
图1是现有技术中车道线检测方法中锚线的示意性图;Fig. 1 is a schematic diagram of the anchor line in the lane line detection method in the prior art;
图2是现有技术中车道线检测方法中一种锚线与真实车道线的示意性图;2 is a schematic diagram of an anchor line and a real lane line in a lane line detection method in the prior art;
图3是现有技术中车道线检测方法中另一种锚线与真实车道线的示意性图;3 is a schematic diagram of another anchor line and a real lane line in a lane line detection method in the prior art;
图4是根据本发明一个实施例的车道线检测模型的训练方法的示意性流程图;4 is a schematic flowchart of a training method for a lane line detection model according to an embodiment of the present invention;
图5是根据本发明一个实施例的车道线检测模型的训练方法中锚线的示意性图;Fig. 5 is a schematic diagram of the anchor line in the training method of the lane line detection model according to an embodiment of the present invention;
图6是根据本发明一个实施例的车道线检测模型的训练方法中锚线与真实车道线的示意性图;6 is a schematic diagram of an anchor line and a real lane line in a training method of a lane line detection model according to an embodiment of the present invention;
图7是根据本发明一个实施例的车道线检测模型的训练方法中直线锚线和曲线锚线的示意性图。Fig. 7 is a schematic diagram of straight anchor lines and curved anchor lines in a method for training a lane line detection model according to an embodiment of the present invention.
具体实施方式detailed description
下面详细描述本发明的实施例,所述实施例的示例在附图中示出,其中自始至终相同或类似的标号表示相同或类似的元件或具有相同或类似功能的元件。下面通过参考附图描述的实施例是示例性的,旨在用于解释本发明,而不能理解为对本发明的限制。Embodiments of the present invention are described in detail below, examples of which are shown in the drawings, wherein the same or similar reference numerals designate the same or similar elements or elements having the same or similar functions throughout. The embodiments described below by referring to the figures are exemplary and are intended to explain the present invention and should not be construed as limiting the present invention.
图1是现有技术中车道线检测方法中锚线的示意性图,图2是现有技术中车道线检测方法中一种锚线与真实车道线的示意性图,图3是现有技术中车道线检测方法中另一种锚线与真实车道线的示意性图。如图1、图2和图3所示,在现有的车道线检测的锚线生成方法中,锚线的生成过程为,输入一张RGB图像,在其左、右两个侧边和底边上分别等份选取一定数量的点作为锚线的起点,以及一定数量的角度θ,由起点生成与水平线夹角为θ的直线作为直线锚线10’。其中,左侧的起点数量为72,θ的数值分别为{θ1,θ2,……,θ6}={72°,60°,49°,39°,30°,22°},每个起点都生成6条角度分别为θ1,θ2,……,θ6的锚线。右侧的起点数量为72,θ的数值分别为{θ1,θ2,……,θ6}={108°,120°,131°,141°,150°,158°},直线锚线10’的生成方式与左边相同。底边的起点数量为128,θ的数值分别为{θ1,θ2,……,θ15}={165°,150°,141°,131°,120°,108°,100°,90°,80°,72°,60°,49°,39°,30°,15°},直线锚线10’的生成方式与左右两个侧边相同,生成的数量为每个起点15条,分别对应15个不同的θ角。对于一张RGB图像,生成的直线锚线10’数量总和为2*72*6+128*15=2784条。现有的车道线检测方法在所有场景中的平均准确率可以达到76.68%。Fig. 1 is a schematic diagram of an anchor line in a lane line detection method in the prior art, Fig. 2 is a schematic diagram of an anchor line and a real lane line in a lane line detection method in the prior art, and Fig. 3 is a prior art Schematic diagram of another anchor line and real lane line in the middle lane line detection method. As shown in Figure 1, Figure 2 and Figure 3, in the existing anchor line generation method for lane line detection, the anchor line generation process is as follows: input an RGB image, on its left and right sides and bottom Select a certain number of points in equal parts on the side as the starting point of the anchor line, and a certain number of angles θ, and a straight line with an angle θ between the starting point and the horizontal line is used as the straight line anchor line 10'. Among them, the number of starting points on the left is 72, and the values of θ are respectively {θ1, θ2, ..., θ6}={72°, 60°, 49°, 39°, 30°, 22°}, each starting point is Generate 6 anchor lines whose angles are θ1, θ2, ..., θ6. The number of starting points on the right side is 72, the values of θ are respectively {θ1, θ2, ..., θ6}={108°, 120°, 131°, 141°, 150°, 158°}, and the straight anchor line is 10' Generated in the same way as on the left. The number of starting points of the base is 128, and the values of θ are {θ1, θ2, ..., θ15}={165°, 150°, 141°, 131°, 120°, 108°, 100°, 90°, 80 °, 72°, 60°, 49°, 39°, 30°, 15°}, the generation method of the straight anchor line 10' is the same as that of the left and right sides, and the number of generated lines is 15 for each starting point, corresponding to 15 different θ angles. For an RGB image, the total number of generated straight anchor lines 10' is 2*72*6+128*15=2784. The existing lane line detection method can achieve an average accuracy of 76.68% in all scenarios.
该算法的原理为,在卷积神经网络模型的训练阶段,输入一张标注好车道线真实值的RGB图像,首先按照上述方法生成直线锚线10’,参见图2和图3,然后将图片纵向平均分割成72等份,每条分割线均平行于底边,分割线与直线锚线10’、真实车道线相交于若干个截断点,截断点的数量由真实车道线的实际长度决定,图片中高于或者低于真实车道线的部分不进行分割。由于每个截断点的纵坐标都是固定的,直线锚线10’与真实车道线在同一个水平线上的截断点处的横坐标之差即为两条线在该水平截面之间的距离。再根据直线锚线10’的位置生成预测的车道线,让网络进行学习,迭代更新参数,缩短预测值与真实车道线在截断点处的距离,最终使用已经训练好的卷积神经网络模型来进行车道线检测。The principle of the algorithm is that in the training stage of the convolutional neural network model, an RGB image with the true value of the lane line is input, and the straight anchor line 10' is first generated according to the above method, see Figure 2 and Figure 3, and then the image Divide into 72 equal parts in the longitudinal direction, each dividing line is parallel to the bottom edge, the dividing line intersects with the straight anchor line 10' and the real lane line at several truncation points, the number of truncation points is determined by the actual length of the real lane line, The part of the picture that is higher or lower than the real lane line is not segmented. Since the ordinate of each truncation point is fixed, the difference between the abscissa of the straight anchor line 10' and the true lane line at the truncation point on the same horizontal line is the distance between the two lines in the horizontal section. Then generate the predicted lane line according to the position of the straight anchor line 10', let the network learn, iteratively update the parameters, shorten the distance between the predicted value and the real lane line at the truncation point, and finally use the trained convolutional neural network model to Carry out lane line detection.
以底边的一个起点a为例,生成的直线锚线10’如图1所示。图1中为a点生成的15条不同角度的直线锚线10’。Taking a starting point a of the base as an example, the generated straight anchor line 10' is shown in Fig. 1 . 15 straight anchor lines 10' of different angles generated for point a in Fig. 1 .
如图2和图3所示,带有箭头的直线为该车道线检测算法中生成的直线锚线10’,曲线为弯道场景下已标注的真实车道线,图2和图3为锚线与标注之间可能存在的两种情况。As shown in Figure 2 and Figure 3, the straight line with the arrow is the straight anchor line 10' generated in the lane line detection algorithm, the curve is the marked real lane line in the curve scene, and Figure 2 and Figure 3 are the anchor lines There are two situations that may exist between the label and the label.
由于弯道车道线的弧度较大,无论两种情况的哪一种,在截断处,直线锚线10’与真实车道线之间的距离都呈增大趋势,且末端的距离较大,故直线锚线10’不能很好地拟合真实车道线,导致卷积神经网络在训练的过程中模型参数学习的难度加大,并且损失函数收敛的速度很慢,所以在弯道的情况下,使用直线作为锚线的车道线检测方法检测的准确性较低。Due to the large arc of the curve lane line, no matter which of the two cases, the distance between the straight anchor line 10' and the real lane line tends to increase at the truncation point, and the distance at the end is relatively large, so The straight anchor line 10' cannot fit the real lane line very well, which makes it more difficult to learn the model parameters of the convolutional neural network during the training process, and the loss function converges very slowly, so in the case of a curve, Lane line detection methods using straight lines as anchor lines have low detection accuracy.
图4是根据本发明一个实施例的车道线检测模型的训练方法的示意性流程图。如图4所示,车道线检测模型的训练方法包括以下步骤:Fig. 4 is a schematic flowchart of a method for training a lane line detection model according to an embodiment of the present invention. As shown in Figure 4, the training method of the lane line detection model includes the following steps:
步骤S100,获取道路样本图像,道路样本图像标注有真实车道线;Step S100, acquiring a road sample image, where the road sample image is marked with real lane lines;
步骤S200,将道路样本图像输入至预先建立的初始模型中;Step S200, inputting the road sample image into the pre-established initial model;
步骤S300,以道路样本图像的底边为横轴,在横轴上选取锚点50;Step S300, taking the bottom edge of the road sample image as the horizontal axis, and selecting an
步骤S400,以锚点50为起点生成多个不同预设角度的直线锚线10,并生成与直线锚线10相切的曲线锚线20;Step S400, generating a plurality of
步骤S500,根据真实车道线与各个直线锚线10之间的距离以及真实车道线与各个曲线锚线20之间的距离对初始模型的参数进行调整,以训练初始模型。Step S500 , adjust the parameters of the initial model according to the distance between the real lane line and each
该实施例在对初始模型进行训练时不仅仅生成直线锚线10,还生成曲线锚线20,可以兼顾普通场景下的车道线的检测和弯道场景下的车道线的检测,提高了弯道场景下车道线检测的准确率。也就是说,该实施例能够改善车道线检测模型在弯道场景下难以识别车道线的问题。When training the initial model, this embodiment not only generates
图5是根据本发明一个实施例的车道线检测模型的训练方法中锚线的示意性图,图6是根据本发明一个实施例的车道线检测模型的训练方法中锚线与真实车道线30的示意性图。如图5和图6所示,该实施例提出的锚线生成方法在生成不同预设角度的直线作为锚线的同时也生成了固定曲率的与直线相切的曲线作为锚线。在模型训练的过程中,使得曲线锚线20更好且更迅速地去拟合已标注的真实的弯道车道线。图6中右侧带有箭头的曲线为曲率固定的曲线锚线20,左侧为实际标注的弯道车道线,可以看出,由于曲线锚线20具有一定曲率,能够更好地贴合真实的弯道车道线,在各个截断处曲线锚线20与真实车道线30之间的距离较小,能更好地拟合弯道场景下的真实车道线30。该实施例在锚线生成的过程中加入了曲线,使车道线检测模型可以更好地学习弯道特性,提高了车道线检测模型在弯道场景中检测的准确率与效率。Fig. 5 is a schematic diagram of the anchor line in the training method of the lane line detection model according to one embodiment of the present invention, and Fig. 6 is the anchor line and the
在该实施例中,步骤S400中,所有曲线锚线20的曲率均为预设曲率,且除垂直于横轴的直线锚线10外,其他直线锚线10中任一直线锚线10仅生成一个曲线锚线20,垂直于横轴的直线锚线10生成两条曲线锚线20。具体参见图5。这里的预设曲率也就是固定曲率,根据具体的设计需求进行设定。In this embodiment, in step S400, the curvatures of all the
在该实施例中,曲线锚线20的终点的纵坐标小于或等于对应的直线锚线10终点的纵坐标。可以理解为,曲线锚线20的起点为先前选定的直线锚线10的起点,曲线锚线20沿箭头方向延伸,且终点不会超过与其上方直线锚线10的切点。另外,曲线锚线20的圆心角大于0°且小于90°。所以除了垂直于横轴的直线锚线10之外,其余的直线锚线10仅生成一条与之对应的曲线锚线20。In this embodiment, the ordinate of the end point of the
在该实施例中,S200之后包括以下步骤:In this embodiment, after S200, the following steps are included:
步骤一:以道路样本图像的底边为横轴,在横轴上选取多个间隔布置的锚点50;Step 1: take the bottom edge of the road sample image as the horizontal axis, and select a plurality of anchor points 50 arranged at intervals on the horizontal axis;
步骤二:以多个锚点50为起点分别生成多个不同预设角度的直线锚线10,并生成与直线锚线10相切的曲线锚线20。Step 2: Using multiple anchor points 50 as starting points, generate a plurality of
具体地,对于一张宽度为w,高度为h的RGB图像输入,在其底边等间隔取128个点作为锚线的起点,每个点有9个θ值,分别为θ1,θ2,……,θ9,生成9条直线锚线10,再以每条直线锚线10为切线,生成10条曲率为h的弧线作为曲线锚线20,其中,垂直于水平线的直线锚线10左右各生成一条弧线。Specifically, for an RGB image input with a width of w and a height of h, 128 points are equally spaced on its bottom as the starting point of the anchor line, and each point has 9 θ values, namely θ1, θ2, ... ..., θ9, generate 9
分割线40依然是在纵轴上取72个等分点,作72条平行于横轴的水平线,与直线锚线10、曲线锚线20及真实车道线相交于若干个截断点。与水平线平行的直线段为各个直线锚线10、曲线锚线20与真实车道线之间的水平距离。可以看出,曲线锚线20可以更好地拟合曲线车道线,参见图6。这里,锚线起始点的数量与坐标、θ的数量与大小、曲线锚线20的曲率大小以及分割线40的纵坐标均根据经验选取,在实际应用中可根据情况作一定调整。选取不同的曲率或θ也属于本发明的范畴。该实施例中所有的曲线锚线20的曲率为单一的固定值,也可以在生成曲线锚线20时选取多个不同的曲率,生成多种不同曲率的曲线锚线20。本发明仅在底边选取锚线起始点生成锚线,没有在左、右两边选点。左、右两边也可以选取一定数量的点作为锚线起始点。The dividing
图7是根据本发明一个实施例的车道线检测模型的训练方法中直线锚线10和曲线锚线20的示意性图。如图7所示,在该实施例中,步骤S400之后,还包括以下步骤:Fig. 7 is a schematic diagram of a
步骤三:根据直线锚线10的第一夹角θ和曲线锚线20的半径R计算曲线锚线20的函数表达式,预设角度为直线锚线10与横轴之间的第一夹角θ。Step 3: Calculate the function expression of the
具体地,步骤三具体包括以下步骤:Specifically, step three specifically includes the following steps:
第一步,根据直线锚线10的第一夹角θ计算曲线锚线20的起始线与横轴之间的第二夹角,曲线锚线20的起始线为曲线锚线20的圆心与锚点50之间的直线;The first step is to calculate the second included angle between the starting line of the
第二步,根据第二夹角和曲线锚线20的半径R计算曲线锚线20的圆心坐标;The second step, according to the second included angle Calculate the center coordinates of the
第三步,根据曲线锚线20的圆心坐标确定曲线锚线20的函数表达式。The third step is to determine the function expression of the
在该实施例中,第三步之后,还包括以下步骤:In this embodiment, after the third step, the following steps are also included:
第四步,选取多个分割线40,多个分割线40为平行于横轴且纵坐标不为零的直线;The fourth step is to select a plurality of dividing
第五步,根据多个分割线40的纵坐标、直线锚线10的函数表达式和曲线锚线20的函数表达式分别计算多个分割线40与直线锚线10、曲线锚线20相交的交点的多个横坐标,直线锚线10的函数表达式根据第一夹角和锚点50的坐标计算得出。这里,多个分割线40之间的距离相等,可以理解为,多个分割线40的纵坐标之间的距离相等。The fifth step, according to the ordinates of
在该实施例中,步骤S500具体包括以下步骤:In this embodiment, step S500 specifically includes the following steps:
根据多个分割线40与直线锚线10、曲线锚线20相交的交点的多个横坐标与车道线训练图像中车道线之间的横向距离调整初始模型的参数,从而对初始模型进行训练。Adjust the parameters of the initial model according to the horizontal distance between multiple abscissas of intersection points where the
具体地,直线锚线10的函数为:y=(x-xs)*tanθ;Specifically, the function of the
其中,xs为锚点50的横坐标,θ为第一夹角;Wherein, x s is the abscissa of the
具体地,根据以下公式计算曲线锚线20的圆心坐标:Specifically, the center coordinates of the
x1=x0+R*cos(π/2-θ);x 1 =x 0 +R*cos(π/2-θ);
y1=-R*sin(π/2-θ);y 1 =-R*sin(π/2-θ);
其中,x1为圆心的横坐标,y1为圆心的纵坐标;Among them, x1 is the abscissa of the center of the circle, and y1 is the ordinate of the center of the circle;
xs为锚点50的横坐标,R为曲线锚线20的半径,θ为第一夹角,π/2-θ的值为第二夹角,即,第二夹角是根据圆与切线的性质计算得出的。x s is the abscissa of the
根据数学性质可求得,曲线锚线20所对应的圆的圆心坐标(x0-y0)=[(xs+R*cos(π/2–θ),-R*sin(π/2–θ)]。According to the mathematical properties, the center coordinates (x 0 -y 0 )=[(x s +R*cos(π/2–θ),-R*sin(π/2 –θ)].
所以,曲线锚线20的函数表达式为:(x–x0)2+(y-y0)2=0。Therefore, the function expression of the
假设(xl,yl)、(xc,yc)分别为分割线40与直线锚线10、曲线锚线20的交点坐标,其中,yl=yc,分别为两个交点的纵坐标,xl与xc分别为两个交点的横坐标。由于yl和yc是已知的,所以根据直线锚线10的函数和曲线锚线20的函数可以分别求得直线锚线10和曲线锚线20在该交点的横坐标xl和xc。所以可以计算出横坐标xl、xc与真实车道线40之间的距离,从而对初始模型的参数进行调整。Assume that (x l , y l ), (x c , y c ) are the intersection coordinates of the
至此,本领域技术人员应认识到,虽然本文已详尽示出和描述了本发明的多个示例性实施例,但是,在不脱离本发明精神和范围的情况下,仍可根据本发明公开的内容直接确定或推导出符合本发明原理的许多其他变型或修改。因此,本发明的范围应被理解和认定为覆盖了所有这些其他变型或修改。So far, those skilled in the art should appreciate that, although a number of exemplary embodiments of the present invention have been shown and described in detail herein, without departing from the spirit and scope of the present invention, the disclosed embodiments of the present invention can still be used. Many other variations or modifications consistent with the principles of the invention are directly identified or derived from the content. Accordingly, the scope of the present invention should be understood and deemed to cover all such other variations or modifications.
Claims (10)
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202211386783.2A CN115546754B (en) | 2022-11-07 | 2022-11-07 | A training method for a lane detection model |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202211386783.2A CN115546754B (en) | 2022-11-07 | 2022-11-07 | A training method for a lane detection model |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| CN115546754A true CN115546754A (en) | 2022-12-30 |
| CN115546754B CN115546754B (en) | 2026-01-30 |
Family
ID=84719755
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN202211386783.2A Active CN115546754B (en) | 2022-11-07 | 2022-11-07 | A training method for a lane detection model |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN115546754B (en) |
Cited By (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN118212232A (en) * | 2024-05-20 | 2024-06-18 | 安徽蔚来智驾科技有限公司 | Linear element detection method, intelligent device and computer readable storage medium |
| WO2024235960A1 (en) * | 2023-05-15 | 2024-11-21 | Cariad Se | Method for recognizing relationships between individual objects in the surroundings of a vehicle, analysis device, and vehicle |
Citations (9)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JP2014021525A (en) * | 2012-07-12 | 2014-02-03 | Honda Motor Co Ltd | Travel division line detection device |
| CN103699899A (en) * | 2013-12-23 | 2014-04-02 | 北京理工大学 | Traffic lane detection method based on equidistant curves |
| KR20140114502A (en) * | 2013-03-15 | 2014-09-29 | 주식회사 한라홀딩스 | Apparatus for predicting lane and method for predicting thereof |
| CN106407924A (en) * | 2016-09-10 | 2017-02-15 | 上海大学 | Binocular road identifying and detecting method based on pavement characteristics |
| CN107229906A (en) * | 2017-05-08 | 2017-10-03 | 上海工程技术大学 | A kind of automobile overtaking's method for early warning based on units of variance model algorithm |
| US20180354523A1 (en) * | 2017-06-08 | 2018-12-13 | Toyota Jidosha Kabushiki Kaisha | Driving consciousness estimation device |
| FR3085926A1 (en) * | 2018-09-19 | 2020-03-20 | Psa Automobiles Sa | METHOD FOR DETERMINING AN IMAGE CURVE OF A GROUND MARKING FOR AN AUTONOMOUS OR PARTIALLY AUTONOMOUS VEHICLE |
| CN112329553A (en) * | 2020-10-16 | 2021-02-05 | 福瑞泰克智能系统有限公司 | Lane line marking method and device |
| CN114581887A (en) * | 2022-03-07 | 2022-06-03 | 上海人工智能创新中心 | Method, device and equipment for detecting lane line and computer readable storage medium |
-
2022
- 2022-11-07 CN CN202211386783.2A patent/CN115546754B/en active Active
Patent Citations (9)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JP2014021525A (en) * | 2012-07-12 | 2014-02-03 | Honda Motor Co Ltd | Travel division line detection device |
| KR20140114502A (en) * | 2013-03-15 | 2014-09-29 | 주식회사 한라홀딩스 | Apparatus for predicting lane and method for predicting thereof |
| CN103699899A (en) * | 2013-12-23 | 2014-04-02 | 北京理工大学 | Traffic lane detection method based on equidistant curves |
| CN106407924A (en) * | 2016-09-10 | 2017-02-15 | 上海大学 | Binocular road identifying and detecting method based on pavement characteristics |
| CN107229906A (en) * | 2017-05-08 | 2017-10-03 | 上海工程技术大学 | A kind of automobile overtaking's method for early warning based on units of variance model algorithm |
| US20180354523A1 (en) * | 2017-06-08 | 2018-12-13 | Toyota Jidosha Kabushiki Kaisha | Driving consciousness estimation device |
| FR3085926A1 (en) * | 2018-09-19 | 2020-03-20 | Psa Automobiles Sa | METHOD FOR DETERMINING AN IMAGE CURVE OF A GROUND MARKING FOR AN AUTONOMOUS OR PARTIALLY AUTONOMOUS VEHICLE |
| CN112329553A (en) * | 2020-10-16 | 2021-02-05 | 福瑞泰克智能系统有限公司 | Lane line marking method and device |
| CN114581887A (en) * | 2022-03-07 | 2022-06-03 | 上海人工智能创新中心 | Method, device and equipment for detecting lane line and computer readable storage medium |
Non-Patent Citations (2)
| Title |
|---|
| 周磊 等: "分段切换模型参数寻优的车道检测算法", 《光电工程》, vol. 39, no. 1, 15 January 2012 (2012-01-15), pages 1 - 8 * |
| 韩浩;王舜燕;: "基于混合贝塞尔曲线模型的车道检测算法", 计算机工程与设计, no. 03, 16 March 2018 (2018-03-16), pages 1 - 8 * |
Cited By (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| WO2024235960A1 (en) * | 2023-05-15 | 2024-11-21 | Cariad Se | Method for recognizing relationships between individual objects in the surroundings of a vehicle, analysis device, and vehicle |
| CN118212232A (en) * | 2024-05-20 | 2024-06-18 | 安徽蔚来智驾科技有限公司 | Linear element detection method, intelligent device and computer readable storage medium |
| CN118212232B (en) * | 2024-05-20 | 2024-08-02 | 安徽蔚来智驾科技有限公司 | Linear element detection method, intelligent device and computer readable storage medium |
Also Published As
| Publication number | Publication date |
|---|---|
| CN115546754B (en) | 2026-01-30 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| CN109976262B (en) | A global curvature continuous smoothing method for micro-segment processing | |
| CN115546754A (en) | Training method of lane line detection model | |
| CN114092906B (en) | Lane line segmentation fitting method, system, electronic equipment and storage medium | |
| CN110766220A (en) | A Local Path Planning Method for Structured Roads | |
| CN108062073B (en) | Circular arc smooth compression interpolation method for high-quality machining | |
| CN111310106B (en) | A cutting contour fitting optimization method based on stepwise approximation of the original contour | |
| CN105550388B (en) | Method and device for generating process model of sheet metal process | |
| WO2020006764A1 (en) | Path detection method, related device, and computer readable storage medium | |
| CN104572924B (en) | Multi-scale expression information generating method for GIS vector building polygons | |
| CN102024180A (en) | Support vector machine-based parameter-adaptive motion prediction method | |
| CN115563440A (en) | Planning path reference line smoothing method based on curvature constraint pre-smoothing | |
| CN109931943A (en) | Unmanned ship global path planning method and electronic equipment | |
| CN105760549B (en) | Nearest Neighbor based on attribute graph model | |
| CN108391275A (en) | Sensor network cover control method based on three-dimensional directional sensing model and system | |
| CN113128307A (en) | Lane line detection processing method, and related device and system | |
| CN117315078A (en) | A parametric migration method for isogeometric analysis based on discrete geometric mapping | |
| US9152743B2 (en) | Computer process for determining best-fitting materials for constructing architectural surfaces | |
| CN119164403B (en) | Path planning method and device for passable area of unstructured environment | |
| CN114298949B (en) | A multi-region fusion trajectory generation method | |
| CN107180240B (en) | Two-dimensional profile layout method based on variable included angle chain codes | |
| CN111192216A (en) | Lane line smoothing method and system | |
| CN114593742A (en) | A local path planning method, device and device for an intelligent driving vehicle | |
| CN116175575A (en) | Welding gun attitude planning method for additive repair in confined space | |
| WO2013116859A1 (en) | Computer process for determining best-fitting materials for constructing architectural surfaces | |
| CN110399679B (en) | Foundation position optimization design method |
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 | ||
| GR01 | Patent grant | ||
| GR01 | Patent grant |




