[go: up one dir, main page]

CN111199567B - Lane line drawing method, device and terminal equipment - Google Patents

Lane line drawing method, device and terminal equipment Download PDF

Info

Publication number
CN111199567B
CN111199567B CN202010010586.5A CN202010010586A CN111199567B CN 111199567 B CN111199567 B CN 111199567B CN 202010010586 A CN202010010586 A CN 202010010586A CN 111199567 B CN111199567 B CN 111199567B
Authority
CN
China
Prior art keywords
lane
image
frame image
line
lane line
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.)
Active
Application number
CN202010010586.5A
Other languages
Chinese (zh)
Other versions
CN111199567A (en
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.)
Hebei University of Science and Technology
Original Assignee
Hebei University of Science and Technology
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 Hebei University of Science and Technology filed Critical Hebei University of Science and Technology
Priority to CN202010010586.5A priority Critical patent/CN111199567B/en
Publication of CN111199567A publication Critical patent/CN111199567A/en
Application granted granted Critical
Publication of CN111199567B publication Critical patent/CN111199567B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T11/002D [Two Dimensional] image generation
    • G06T11/20Drawing from basic elements, e.g. lines or circles
    • G06T11/203Drawing of straight lines or curves
    • 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)
  • Theoretical Computer Science (AREA)
  • Multimedia (AREA)
  • Image Analysis (AREA)

Abstract

本发明提供了一种车道线绘制方法、装置及终端设备,该方法应用于图像处理领域,包括:获取目标车道的车道图像,并对目标车道的车道图像进行检测,得到车道图像中各条车道线的像素点坐标;基于各条车道线的像素点坐标、每两条车道线之间的预设像素间隔绘制目标车道的车道线。本发明提供的车道线绘制方法、装置及终端设备能够节省车道线的绘制成本,实现车道线的快速准确绘制。

The invention provides a lane line drawing method, device and terminal equipment. The method is applied in the field of image processing and includes: acquiring a lane image of a target lane, detecting the lane image of the target lane, and obtaining each lane in the lane image. The pixel coordinates of the line; draw the lane lines of the target lane based on the pixel coordinates of each lane line and the preset pixel interval between each two lane lines. The lane line drawing method, device and terminal equipment provided by the present invention can save the cost of lane line drawing and realize fast and accurate lane line drawing.

Description

车道线绘制方法、装置及终端设备Lane line drawing method, device and terminal equipment

技术领域Technical field

本发明属于图像处理技术领域,更具体地说,是涉及一种车道线绘制方法、装置及终端设备。The present invention belongs to the field of image processing technology, and more specifically, relates to a lane line drawing method, device and terminal equipment.

背景技术Background technique

随着百度地图、高德地图和谷歌地图的快速发展,人们的出行变得越来越便利,这些电子地图可为用户提供路线规划,电子导航等服务,但这些功能所依赖的车道线目前均为人工绘制,其工程量巨大,成本较高且受人为因素的影响,容易产生人为偏差。With the rapid development of Baidu Maps, Amap and Google Maps, people's travel has become more and more convenient. These electronic maps can provide users with route planning, electronic navigation and other services. However, the lane lines on which these functions rely are currently not available. It is manually drawn, which requires a huge amount of work, high cost, and is affected by human factors, which is prone to human deviation.

因此,如何实现车道线的自动绘制,从而节省车道线的绘制成本成为亟待解决的问题。Therefore, how to realize automatic drawing of lane lines and thereby save the cost of drawing lane lines has become an urgent problem to be solved.

发明内容Contents of the invention

本发明的目的在于提供一种车道线绘制方法、装置及终端设备,以节省车道线的绘制成本。The object of the present invention is to provide a lane line drawing method, device and terminal equipment to save the cost of lane line drawing.

本发明实施例的第一方面,提供了一种车道线绘制方法,包括:A first aspect of the embodiment of the present invention provides a method for drawing lane lines, including:

获取目标车道的车道图像,并对目标车道的车道图像进行检测,得到车道图像中各条车道线的像素点坐标;Obtain the lane image of the target lane, detect the lane image of the target lane, and obtain the pixel coordinates of each lane line in the lane image;

基于各条车道线的像素点坐标、每两条车道线之间的预设像素间隔绘制目标车道的车道线。The lane lines of the target lane are drawn based on the pixel coordinates of each lane line and the preset pixel interval between each two lane lines.

本发明实施例的第二方面,提供了一种车道线绘制装置,包括:A second aspect of the embodiment of the present invention provides a lane line drawing device, including:

车道线检测模块,用于获取目标车道的车道图像,并对目标车道的车道图像进行检测,得到车道图像中各条车道线的像素点坐标;The lane line detection module is used to obtain the lane image of the target lane, detect the lane image of the target lane, and obtain the pixel coordinates of each lane line in the lane image;

车道线绘制模块,用于基于各条车道线的像素点坐标、每两条车道线之间的预设像素间隔绘制目标车道的车道线。The lane line drawing module is used to draw the lane lines of the target lane based on the pixel coordinates of each lane line and the preset pixel interval between each two lane lines.

本发明实施例的第三方面,提供了一种终端设备,包括存储器、处理器以及存储在所述存储器中并可在所述处理器上运行的计算机程序,所述处理器执行所述计算机程序时实现上述的车道线绘制方法的步骤。A third aspect of the embodiment of the present invention provides a terminal device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. The processor executes the computer program. Implement the steps of the above lane line drawing method.

本发明实施例的第四方面,提供了一种计算机可读存储介质,所述计算机可读存储介质存储有计算机程序,所述计算机程序被处理器执行时实现上述的车道线绘制方法的步骤。A fourth aspect of the embodiments of the present invention provides a computer-readable storage medium. The computer-readable storage medium stores a computer program. When the computer program is executed by a processor, the steps of the above-mentioned lane line drawing method are implemented.

本发明实施例提供的车道线绘制方法、装置及终端设备的有益效果在于:与现有技术相比,本发明实施例基于图像处理进行车道线的自动绘制,通过获取目标车道的车道图像,对目标车道的车道图像进行检测,得到了车道图像中各条车道线的像素点坐标,再基于各条车道线的像素点坐标、每两条车道线之间的预设像素间隔绘制目标车道的车道线。本发明实施例提供的车道线绘制方法不仅能够通过自动绘制节约人力成本,提高绘制效率,还能够基于车道线的像素点坐标进行绘制,相对于人工绘制的方法更加准确。The beneficial effects of the lane line drawing method, device and terminal equipment provided by the embodiments of the present invention are: compared with the existing technology, the embodiments of the present invention perform automatic drawing of lane lines based on image processing, and obtain the lane image of the target lane. The lane image of the target lane is detected to obtain the pixel coordinates of each lane line in the lane image, and then the lane of the target lane is drawn based on the pixel coordinates of each lane line and the preset pixel interval between each two lane lines. Wire. The lane line drawing method provided by the embodiment of the present invention can not only save labor costs and improve drawing efficiency through automatic drawing, but can also draw based on the pixel coordinates of the lane line, which is more accurate than manual drawing methods.

附图说明Description of drawings

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

图1为本发明一实施例提供的车道线绘制方法的流程示意图;Figure 1 is a schematic flow chart of a lane line drawing method provided by an embodiment of the present invention;

图2为本发明另一实施例提供的车道线绘制方法的流程示意图;Figure 2 is a schematic flow chart of a lane line drawing method provided by another embodiment of the present invention;

图3为本发明再一实施例提供的车道线绘制方法的流程示意图;Figure 3 is a schematic flow chart of a lane line drawing method provided by yet another embodiment of the present invention;

图4为本发明又一实施例提供的车道线绘制方法的流程示意图;Figure 4 is a schematic flow chart of a lane line drawing method provided by another embodiment of the present invention;

图5为本发明又一实施例提供的车道线绘制方法的流程示意图;Figure 5 is a schematic flow chart of a lane line drawing method provided by another embodiment of the present invention;

图6为本发明又一实施例提供的车道线绘制方法的流程示意图;Figure 6 is a schematic flowchart of a lane line drawing method provided by another embodiment of the present invention;

图7为本发明又一实施例提供的车道线绘制方法的流程示意图;Figure 7 is a schematic flow chart of a lane line drawing method provided by another embodiment of the present invention;

图8为本发明一实施例提供的车道线绘制装置的结构框图;Figure 8 is a structural block diagram of a lane line drawing device provided by an embodiment of the present invention;

图9为本发明一实施例提供的终端设备的示意框图。Figure 9 is a schematic block diagram of a terminal device provided by an embodiment of the present invention.

具体实施方式Detailed ways

为了使本发明所要解决的技术问题、技术方案及有益效果更加清楚明白,以下结合附图及实施例,对本发明进行进一步详细说明。应当理解,此处所描述的具体实施例仅仅用以解释本发明,并不用于限定本发明。In order to make the technical problems, technical solutions and beneficial effects to be solved by the present invention clearer, the present invention will be further described in detail below with reference to the drawings and embodiments. It should be understood that the specific embodiments described here are only used to explain the present invention and are not intended to limit the present invention.

请参考图1,图1为本发明一实施例提供的车道线绘制方法的流程示意图,该方法包括:Please refer to Figure 1. Figure 1 is a schematic flow chart of a lane line drawing method provided by an embodiment of the present invention. The method includes:

S101:获取目标车道的车道图像,并对目标车道的车道图像进行检测,得到车道图像中各条车道线的像素点坐标。S101: Obtain the lane image of the target lane, detect the lane image of the target lane, and obtain the pixel coordinates of each lane line in the lane image.

在本实施例中,可采集目标车道的视频数据,提取目标车道的视频数据中的多帧图像,作为目标车道的车道图像。In this embodiment, video data of the target lane can be collected, and multiple frames of images in the video data of the target lane can be extracted as lane images of the target lane.

在本实施例中,可基于窗口搜索法对目标车道的车道图像进行检测,检测出车道图像中的各条车道线,得到车道图像中各条车道线的像素点坐标。In this embodiment, the lane image of the target lane can be detected based on the window search method, each lane line in the lane image is detected, and the pixel point coordinates of each lane line in the lane image are obtained.

S102:基于各条车道线的像素点坐标、每两条车道线之间的预设像素间隔绘制目标车道的车道线。S102: Draw the lane lines of the target lane based on the pixel coordinates of each lane line and the preset pixel interval between each two lane lines.

在本实施例中,可基于各条车道线的像素点坐标以及每两条车道线之间的预设像素间隔对目标车道的多帧图像进行拼接。其中,可直接将拼接后的图像作为绘制完成的车道线图像输出,也可对拼接后图像进行扫描,将扫描后的图像作为绘制完成的车道线图像输出。In this embodiment, multiple frames of images of the target lane can be spliced based on the pixel coordinates of each lane line and the preset pixel interval between each two lane lines. Among them, the spliced image can be directly output as a completed lane line image, or the spliced image can be scanned, and the scanned image can be output as a completed lane line image.

由上可以得出,本发明实施例基于图像处理进行车道线的自动绘制,通过获取目标车道的车道图像,对目标车道的车道图像进行检测,得到了车道图像中各条车道线的像素点坐标,再基于各条车道线的像素点坐标、每两条车道线之间的预设像素间隔绘制目标车道的车道线。本发明实施例提供的车道线绘制方法不仅能够通过自动绘制节约人力成本,提高绘制效率,还能够基于车道线的像素点坐标进行绘制,相对于人工绘制的方法更加准确。It can be concluded from the above that the embodiment of the present invention performs automatic drawing of lane lines based on image processing. By obtaining the lane image of the target lane and detecting the lane image of the target lane, the pixel coordinates of each lane line in the lane image are obtained. , and then draw the lane lines of the target lane based on the pixel coordinates of each lane line and the preset pixel interval between each two lane lines. The lane line drawing method provided by the embodiment of the present invention can not only save labor costs and improve drawing efficiency through automatic drawing, but can also draw based on the pixel coordinates of the lane line, which is more accurate than manual drawing methods.

请一并参考图1及图2,图2为本申请另一实施例提供的车道线绘制方法的流程示意图。在上述实施例的基础上,在获取目标车道的车道图像之前,还可以包括:Please refer to FIG. 1 and FIG. 2 together. FIG. 2 is a schematic flowchart of a lane line drawing method provided by another embodiment of the present application. Based on the above embodiment, before acquiring the lane image of the target lane, it may also include:

S201:采集目标车道的视频数据。S201: Collect video data of the target lane.

S202:提取目标车道的视频数据中的多帧图像,得到目标车道的车道图像。S202: Extract multiple frames of images from the video data of the target lane to obtain the lane image of the target lane.

在本实施例中,可通过汽车上的行车记录仪来采集目标车道的视频数据,再提取目标车道的视频数据中的多帧图像,得到目标车道的车道图像。In this embodiment, the video data of the target lane can be collected through the driving recorder on the car, and then multiple frames of images in the video data of the target lane can be extracted to obtain the lane image of the target lane.

请一并参考图1及图3,图3为本申请再一实施例提供的车道线绘制方法的流程示意图。在上述实施例的基础上,在对目标车道的车道图像进行检测之前,还可以包括对目标车道的车道图像进行预处理的步骤。对目标车道的车道图像进行预处理的步骤,包括:Please refer to FIG. 1 and FIG. 3 together. FIG. 3 is a schematic flow chart of a lane line drawing method provided by yet another embodiment of the present application. Based on the above embodiments, before detecting the lane image of the target lane, a step of preprocessing the lane image of the target lane may also be included. The steps to preprocess the lane image of the target lane include:

S301:基于棋盘格矫正方法对车道图像中的畸变图像进行矫正。S301: Correct the distorted image in the lane image based on the checkerboard correction method.

S302:对矫正后的车道图像进行透视变换和二值化处理,得到预处理后的目标车道的车道图像。S302: Perform perspective transformation and binarization processing on the corrected lane image to obtain a preprocessed lane image of the target lane.

在本实施例中,可对矫正后的车道图像进行透视变换以提取车道图像中的ROI区域(Region of Inters,感兴趣区域)。其中,透视变换的方法可以为:In this embodiment, perspective transformation can be performed on the corrected lane image to extract the ROI region (Region of Inters, region of interest) in the lane image. Among them, the perspective transformation method can be:

首先,在车道图像中选取一个包含车道线的梯形区域,将梯形区域的任意一个顶点作为图像坐标的原点。然后,基于图像坐标的原点对该梯形区域进行透视变换,通过预设的透视变换矩阵将车道线图像像素还原成相互平行且粗细均匀的车道线物理像素。First, select a trapezoidal area containing lane lines in the lane image, and use any vertex of the trapezoidal area as the origin of the image coordinates. Then, a perspective transformation is performed on the trapezoidal area based on the origin of the image coordinates, and the lane line image pixels are restored into lane line physical pixels that are parallel to each other and of uniform thickness through a preset perspective transformation matrix.

在本实施例中,可预先设置梯形区域顶点经过透视变换后的坐标值,再根据梯形区域顶点透视变换前的坐标值和透视变换后的坐标值确定预设的透视变换矩阵,从而根据预设的透视变换矩阵对整个梯形区域进行透视变换。In this embodiment, the coordinate values of the vertices of the trapezoidal region after perspective transformation can be set in advance, and then the preset perspective transformation matrix is determined based on the coordinate values of the vertices of the trapezoidal region before perspective transformation and the coordinate values after perspective transformation, so that according to the preset The perspective transformation matrix performs perspective transformation on the entire trapezoidal area.

在本实施例中,为了去除噪声、减少计算量,在对矫正后的车道图像进行透视变换后,可将透视变换后的车道图像存储为预设大小的图片。该预设大小的图片的覆盖区域为包含所有车道线的最小区域。In this embodiment, in order to remove noise and reduce the amount of calculation, after perspective transformation is performed on the corrected lane image, the perspective transformed lane image can be stored as a picture of a preset size. The coverage area of this preset size image is the smallest area that contains all lane lines.

在本实施例中,为了提高车道线的检测精度,还可在对车道图像进行透视变换后,对透视变换后的车道图像进行像素检测,以对车道图像进行分类,将包含有白色车道线的车道图像与包含有黄色车道线的车道图像进行分离。In this embodiment, in order to improve the detection accuracy of lane lines, after perspective transformation of the lane image, pixel detection can be performed on the perspective transformed lane image to classify the lane images, and classify the lane images containing white lane lines. Lane images are separated from lane images containing yellow lane lines.

在本实施例中,对车道图像进行分类后,可对分类后的车道图像进行二值化处理,以方便后续的图像处理操作。In this embodiment, after classifying the lane images, the classified lane images can be binarized to facilitate subsequent image processing operations.

请一并参考图1及图4,作为本发明提供的车道线绘制方法的一个具体实施方式,在上述实施例的基础上,对目标车道的车道图像进行检测,得到车道图像中各条车道线的像素点坐标,可以详述为:Please refer to Figure 1 and Figure 4 together. As a specific implementation of the lane line drawing method provided by the present invention, based on the above embodiment, the lane image of the target lane is detected to obtain each lane line in the lane image. The pixel coordinates of can be detailed as:

S401:基于标准车道线的长度、目标车道的车道图像的宽度确定滑动窗口的预设长度和预设宽度。S401: Determine the preset length and preset width of the sliding window based on the length of the standard lane line and the width of the lane image of the target lane.

在本实施例中,可将滑动窗口的预设长度设置为单条标准车道线的宽度的两倍,可将滑动窗口的预设宽度设置为目标车道的车道图像宽度的十分之一。In this embodiment, the preset length of the sliding window can be set to twice the width of a single standard lane line, and the preset width of the sliding window can be set to one-tenth of the lane image width of the target lane.

S402:基于预设长度和预设宽度的滑动窗口对目标车道的车道图像进行搜索,并在搜索过程中基于车道图像的像素密度对车道图像中的车道线进行识别,确定车道图像中各条车道线的像素点坐标。S402: Search the lane image of the target lane based on a sliding window of preset length and preset width, and during the search process, identify the lane lines in the lane image based on the pixel density of the lane image, and determine each lane in the lane image. The pixel coordinates of the line.

在本实施例中,可以车道图像的任意顶点作为原点,以车道图像的边缘线作为坐标轴建立直角坐标系。在直接坐标系中,基于预设长度和预设宽度的滑动窗口从原点开始,对车道图像进行搜索。在搜索过程中,以像素密度为标准区分车道图像中的车道线区域和非车道线区域,并确定车道线区域的各个像素点坐标(也即确定各条车道线的像素点坐标)。In this embodiment, any vertex of the lane image can be used as the origin, and the edge line of the lane image can be used as the coordinate axis to establish a rectangular coordinate system. In the direct coordinate system, the lane image is searched starting from the origin based on a sliding window of preset length and preset width. During the search process, the lane line area and non-lane line area in the lane image are distinguished based on the pixel density, and the coordinates of each pixel point in the lane line area are determined (that is, the pixel point coordinates of each lane line are determined).

请一并参考图1及图5,作为本发明提供的车道线绘制方法的一个具体实施方式,在上述实施例的基础上,步骤S102可以详述为:Please refer to Figure 1 and Figure 5 together. As a specific implementation of the lane line drawing method provided by the present invention, based on the above embodiment, step S102 can be described in detail as:

S501:设定n=1、目标车道的车道图像中的图像帧数为NmaxS501: Set n=1 and the number of image frames in the lane image of the target lane to N max .

S502:获取目标车道的车道图像中的第n帧图像和第n+1帧图像。S502: Obtain the n-th frame image and the n+1-th frame image in the lane image of the target lane.

S503:对第n帧图像和第n+1帧图像进行形态学处理,并根据形态学处理结果判断第n帧图像中的上边缘车道线是否和第n+1帧图像中的下边缘车道线连通。S503: Perform morphological processing on the n-th frame image and the n+1-th frame image, and determine whether the upper edge lane line in the n-th frame image is consistent with the lower edge lane line in the n+1-th frame image based on the morphological processing results. Connected.

S504:若第n帧图像中的上边缘车道线和第n+1帧图像中的下边缘车道线连通,则基于第n帧图像和第n+1帧图像中车道线的像素点坐标对第n帧图像和第n+1帧图像进行拼接,并将拼接后的图像作为第n+1帧图像。S504: If the upper edge lane line in the n-th frame image and the lower edge lane line in the n+1-th frame image are connected, then based on the pixel point coordinates of the lane line in the n-th frame image and the n+1-th frame image, the The n frame image and the n+1th frame image are spliced, and the spliced image is used as the n+1th frame image.

S505:若第n帧图像中的上边缘车道线和第n+1帧图像中的下边缘车道线不连通,则根据基于第n帧图像和第n+1帧图像中车道线的像素点坐标、每两条车道线之间的预设像素间隔确定第n帧图像与第n+1帧图像之间的过渡图像。对第n帧图像、第n帧图像与第n+1帧图像之间的过渡图像、第n+1帧图像进行拼接,并将拼接后的图像作为第n+1帧图像。S505: If the upper edge lane line in the nth frame image and the lower edge lane line in the n+1th frame image are not connected, based on the pixel point coordinates of the lane line in the nth frame image and the n+1th frame image , the preset pixel interval between each two lane lines determines the transition image between the n-th frame image and the n+1-th frame image. The n-th frame image, the transition image between the n-th frame image and the n+1-th frame image, and the n+1-th frame image are spliced, and the spliced image is used as the n+1-th frame image.

S506:若n+1<Nmax,则令n=n+1,并返回执行获取目标车道的车道图像中的第n帧图像和第n+1帧图像的步骤。若n+1=Nmax,则将第n+1帧图像作为绘制完成的车道线图像输出。S506: If n+1<N max , set n=n+1, and return to the step of obtaining the n-th frame image and the n+1-th frame image in the lane image of the target lane. If n+1=N max , the n+1th frame image is output as the completed lane line image.

在本实施例中,可按照目标车道图像中各个帧图像的时间顺序,对各个帧图像进行拼接处理。In this embodiment, each frame image can be spliced according to the time sequence of each frame image in the target lane image.

在本实施例中,若第n帧图像中的上边缘车道线和第n+1帧图像中的下边缘车道线连通,则说明车道线未移动,也即第n帧图像中的上边缘车道线和第n+1帧图像中的下边缘车道线是同一车道线,因此,可直接基于第n帧图像和第n+1帧图像中车道线的像素点坐标对第n帧图像和第n+1帧图像进行拼接。In this embodiment, if the upper edge lane line in the nth frame image is connected to the lower edge lane line in the n+1th frame image, it means that the lane line has not moved, that is, the upper edge lane line in the nth frame image is connected. The line and the lower edge lane line in the n+1th frame image are the same lane line. Therefore, the nth frame image and the nth frame image can be directly based on the pixel coordinates of the lane line in the n+1th frame image. +1 frame image for stitching.

在本实施例中,若第n帧图像中的上边缘车道线和第n+1帧图像中的下边缘车道线不连通,则说明车道线发生了移动,也即第n帧图像中的上边缘车道线和第n+1帧图像中的下边缘车道线不是同一车道线,因此,需要根据每两条车道线之间的预设像素间隔确定第n帧图像与第n+1帧图像之间的像素间隔,也即需要确定第n帧图像与第n+1帧图像之间的过渡图像,最后对第n帧图像、第n帧图像与第n+1帧图像之间的过渡图像、第n+1帧图像进行拼接。In this embodiment, if the upper edge lane line in the nth frame image and the lower edge lane line in the n+1th frame image are not connected, it means that the lane line has moved, that is, the upper edge lane line in the nth frame image is not connected. The edge lane line and the lower edge lane line in the n+1th frame image are not the same lane line. Therefore, it is necessary to determine the distance between the nth frame image and the n+1th frame image based on the preset pixel interval between each two lane lines. The pixel interval between the n-th frame image and the n+1-th frame image needs to be determined, and finally the transition image between the n-th frame image, the n-th frame image and the n+1-th frame image, The n+1th frame image is spliced.

其中,预设的像素间隔可根据“公路工程技术标准”设定,例如,两条中车道线的之间的距离为8米,两条虚线车道线之间的距离为9米,可将两条车道线之间的距离转换为像素点数,将像素点数作为两条车道线之间预设的像素间隔。也就是说,对于不同类型的车道线,两条车道线之间的预设像素间隔是不同的,对于此,可根据目标车道的车道线类型选取对应的两条车道线之间的预设像素间隔。Among them, the preset pixel interval can be set according to "Highway Engineering Technical Standards". For example, the distance between two middle lane lines is 8 meters, and the distance between two dotted lane lines is 9 meters. The distance between lane lines is converted into the number of pixels, and the number of pixels is used as the preset pixel interval between the two lane lines. That is to say, for different types of lane lines, the preset pixel intervals between the two lane lines are different. For this, the corresponding preset pixels between the two lane lines can be selected according to the lane line type of the target lane. interval.

可选地,请参考图6,作为本发明实施例提供的车道线绘制方法的一种具体实施方式,在步骤S102之前,还可以包括:Optionally, please refer to Figure 6. As a specific implementation of the lane line drawing method provided by the embodiment of the present invention, before step S102, it may also include:

S601:根据车道图像中各条车道线的像素点坐标确定各条车道线的偏置向量。S601: Determine the offset vector of each lane line based on the pixel coordinates of each lane line in the lane image.

S602:基于各条车道线的偏置向量对目标车道的车道图像中的车道线进行修正。S602: Correct the lane lines in the lane image of the target lane based on the offset vector of each lane line.

在本实施例中,为避免视频数据采集过程中因汽车变道导致车道线图像倾斜,可根据各条车道线的像素点坐标检测车道图像中的车道线是否倾斜。若检测到车道图像中的车道线图像倾斜,则根据车道图像中各条车道线的像素点坐标确定各条车道线的偏置向量,基于各条车道线的偏置向量对目标车道的车道图像中的车道线进行修正。若检测到车道图像中的车道线图像未倾斜,则将车道图像中的车道线的偏置向量置为零。In this embodiment, in order to avoid the lane line image being tilted due to the car changing lanes during the video data collection process, whether the lane line in the lane image is tilted can be detected based on the pixel coordinates of each lane line. If it is detected that the lane line image in the lane image is tilted, the offset vector of each lane line is determined based on the pixel coordinates of each lane line in the lane image, and the lane image of the target lane is calculated based on the offset vector of each lane line. The lane markings in the vehicle are corrected. If it is detected that the lane line image in the lane image is not tilted, the offset vector of the lane line in the lane image is set to zero.

可选地,请参考图7,作为本发明实施例提供的车道线绘制方法的一种具体实施方式,对于某一条车道线,步骤S601可以详述为:Optionally, please refer to Figure 7. As a specific implementation of the lane line drawing method provided by the embodiment of the present invention, for a certain lane line, step S601 can be described in detail as:

S701:基于该车道线的起始像素点坐标和竖直方向的终止像素点坐标确定第一线段,基于该车道线的起始像素点坐标和水平方向的终止像素点坐标确定第二线段。S701: Determine the first line segment based on the starting pixel coordinates of the lane line and the ending pixel coordinates in the vertical direction, and determine the second line segment based on the starting pixel coordinates of the lane line and the ending pixel coordinates in the horizontal direction.

S702:若第一线段与第二线段的夹角大于第一预设阈值,则将第一线段与第二线段的夹角的正切值作为该车道线的偏置向量。若第一线段与第二线段的夹角不大于第一预设阈值,则将该车道线的偏置向量置为零。S702: If the angle between the first line segment and the second line segment is greater than the first preset threshold, use the tangent value of the angle between the first line segment and the second line segment as the offset vector of the lane line. If the angle between the first line segment and the second line segment is not greater than the first preset threshold, then the offset vector of the lane line is set to zero.

在本实施例中,若第一线段与第二线段的夹角大于第一预设阈值,则说明车道图像中的该车道线倾斜,可将第一线段与第二线段的夹角的正切值作为该车道线的偏置向量,根据偏置向量以及该车道线下边缘的像素点坐标修正该车道线。In this embodiment, if the angle between the first line segment and the second line segment is greater than the first preset threshold, it means that the lane line in the lane image is tilted. The angle between the first line segment and the second line segment can be The tangent value is used as the offset vector of the lane line, and the lane line is corrected according to the offset vector and the pixel point coordinates of the lower edge of the lane line.

在本实施例中,若第一线段与第二线段的夹角不大于第一预设阈值,则说明车道图像中的该车道线为弯道车道线,此时将该车道线对应的偏置向量置为零。In this embodiment, if the angle between the first line segment and the second line segment is not greater than the first preset threshold, it means that the lane line in the lane image is a curved lane line. At this time, the offset corresponding to the lane line is Set the vector to zero.

可选地,作为本发明实施例提供的车道线绘制方法的一种具体实施方式,本发明实施例还可根据绘制完成的车道线图像以及实际车道线大小确定绘制完成的车道线图像与实际车道线的比例关系,根据该比例关系进行绘制完成的车道线图像中的物理像素点的统计。Optionally, as a specific implementation of the lane line drawing method provided by the embodiment of the present invention, the embodiment of the present invention can also determine the difference between the drawn lane line image and the actual lane size based on the drawn lane line image and the actual lane line size. The proportional relationship of the line, and the statistics of the physical pixels in the completed lane line image are calculated based on this proportional relationship.

可选地,作为本发明实施例提供的车道线绘制方法的一种具体实施方式,还可对绘制完成的车道线图像进行检测,检测绘制完成的车道图像中的车道线是否完整,若不完整,则对不完整的车道线进行填补。Optionally, as a specific implementation of the lane line drawing method provided by the embodiment of the present invention, the drawn lane line image can also be detected to detect whether the lane line in the drawn lane image is complete. If it is incomplete, , then fill in the incomplete lane lines.

对应于上文实施例的车道线绘制方法,图8为本发明一实施例提供的车道线绘制装置的结构框图。为了便于说明,仅示出了与本发明实施例相关的部分。参考图8,该装置包括:车道线检测模块81、车道线绘制模块82。Corresponding to the lane line drawing method of the above embodiment, FIG. 8 is a structural block diagram of a lane line drawing device provided by an embodiment of the present invention. For convenience of explanation, only parts related to the embodiments of the present invention are shown. Referring to FIG. 8 , the device includes: a lane line detection module 81 and a lane line drawing module 82 .

其中,车道线检测模块81,用于获取目标车道的车道图像,并对目标车道的车道图像进行检测,得到车道图像中各条车道线的像素点坐标。Among them, the lane line detection module 81 is used to obtain the lane image of the target lane, detect the lane image of the target lane, and obtain the pixel point coordinates of each lane line in the lane image.

车道线绘制模块82,用于基于各条车道线的像素点坐标、每两条车道线之间的预设像素间隔绘制目标车道的车道线。The lane line drawing module 82 is used to draw the lane lines of the target lane based on the pixel point coordinates of each lane line and the preset pixel interval between every two lane lines.

参考图8,在本发明的另一个实施例中,车道线绘制装置还可以包括视频处理模块83,该视频处理模块83用于执行以下步骤:Referring to Figure 8, in another embodiment of the present invention, the lane line drawing device may further include a video processing module 83, which is used to perform the following steps:

采集目标车道的视频数据。Collect video data of the target lane.

提取目标车道的视频数据中的多帧图像,得到目标车道的车道图像。Extract multiple frames of images from the video data of the target lane to obtain the lane image of the target lane.

参考图8,在本发明的再一个实施例中,车道线绘制装置还可以包括图像预处理模块84,该图像预处理模块84用于执行以下步骤:Referring to Figure 8, in yet another embodiment of the present invention, the lane line drawing device may further include an image preprocessing module 84, which is used to perform the following steps:

基于棋盘格矫正方法对车道图像中的畸变图像进行矫正。The distorted image in the lane image is corrected based on the checkerboard correction method.

对矫正后的车道图像进行透视变换和二值化处理,得到预处理后的目标车道的车道图像。Perform perspective transformation and binarization processing on the corrected lane image to obtain the preprocessed lane image of the target lane.

可选地,作为本发明实施例提供的车道线绘制装置的一种具体实施方式,车道线检测模块81具体用于执行以下步骤:Optionally, as a specific implementation of the lane line drawing device provided by the embodiment of the present invention, the lane line detection module 81 is specifically configured to perform the following steps:

获取目标车道的车道图像。Get the lane image of the target lane.

基于标准车道线的长度、目标车道的车道图像的宽度确定滑动窗口的预设长度和预设宽度。The preset length and preset width of the sliding window are determined based on the length of the standard lane line and the width of the lane image of the target lane.

基于预设长度和预设宽度的滑动窗口对目标车道的车道图像进行搜索,并在搜索过程中基于车道图像的像素密度对车道图像中的车道线进行识别,确定车道图像中各条车道线的像素点坐标。The lane image of the target lane is searched based on a sliding window of preset length and width, and during the search process, the lane lines in the lane image are identified based on the pixel density of the lane image, and the lane lines in the lane image are determined. Pixel coordinates.

可选地,作为本发明实施例提供的车道线绘制装置的一种具体实施方式,车道线绘制模块82具体用于执行以下步骤:Optionally, as a specific implementation of the lane line drawing device provided by the embodiment of the present invention, the lane line drawing module 82 is specifically configured to perform the following steps:

设定n=1、目标车道的车道图像中的图像帧数为NmaxSet n=1 and the number of image frames in the lane image of the target lane is N max .

获取目标车道的车道图像中的第n帧图像和第n+1帧图像。Obtain the n-th frame image and the n+1-th frame image in the lane image of the target lane.

对第n帧图像和第n+1帧图像进行形态学处理,并根据形态学处理结果判断第n帧图像中的上边缘车道线是否和第n+1帧图像中的下边缘车道线连通。Morphological processing is performed on the nth frame image and the n+1th frame image, and based on the morphological processing results, it is determined whether the upper edge lane line in the nth frame image is connected to the lower edge lane line in the n+1th frame image.

若第n帧图像中的上边缘车道线和第n+1帧图像中的下边缘车道线连通,则基于第n帧图像和第n+1帧图像中车道线的像素点坐标对第n帧图像和第n+1帧图像进行拼接,并将拼接后的图像作为第n+1帧图像。If the upper edge lane line in the nth frame image is connected to the lower edge lane line in the n+1th frame image, then based on the pixel point coordinates of the lane line in the nth frame image and the n+1th frame image, the nth frame The image and the n+1th frame image are spliced, and the spliced image is used as the n+1th frame image.

若第n帧图像中的上边缘车道线和第n+1帧图像中的下边缘车道线不连通,则根据基于第n帧图像和第n+1帧图像中车道线的像素点坐标、每两条车道线之间的预设像素间隔确定第n帧图像与第n+1帧图像之间的过渡图像。对第n帧图像、第n帧图像与第n+1帧图像之间的过渡图像、第n+1帧图像进行拼接,并将拼接后的图像作为第n+1帧图像。If the upper edge lane line in the nth frame image and the lower edge lane line in the n+1th frame image are not connected, then based on the pixel coordinates of the lane lines in the nth frame image and the n+1th frame image, each The preset pixel interval between the two lane lines determines the transition image between the n-th frame image and the n+1-th frame image. The n-th frame image, the transition image between the n-th frame image and the n+1-th frame image, and the n+1-th frame image are spliced, and the spliced image is used as the n+1-th frame image.

若n+1<Nmax,则令n=n+1,并返回执行获取目标车道的车道图像中的第n帧图像和第n+1帧图像的步骤。若n+1=Nmax,则将第n+1帧图像作为绘制完成的车道线图像输出。If n+1<N max , let n=n+1, and return to the step of obtaining the n-th frame image and the n+1-th frame image in the lane image of the target lane. If n+1=N max , the n+1th frame image is output as the completed lane line image.

可选地,请参考图8,作为本发明实施例提供的车道线绘制装置的一种具体实施方式,车道线绘制装置还可以包括车道线修正模块85,该车道线修正模块85用于执行以下步骤:Optionally, please refer to Figure 8. As a specific implementation of the lane line drawing device provided by the embodiment of the present invention, the lane line drawing device may also include a lane line correction module 85, which is used to perform the following: step:

根据车道图像中各条车道线的像素点坐标确定各条车道线的偏置向量。The offset vector of each lane line is determined based on the pixel coordinates of each lane line in the lane image.

基于各条车道线的偏置向量对目标车道的车道图像中的车道线进行修正。The lane lines in the lane image of the target lane are corrected based on the offset vector of each lane line.

可选地,作为本发明实施例提供的车道线绘制装置的一种具体实施方式,对于某一条车道线,确定该车道线的偏置向量的方法为:Optionally, as a specific implementation of the lane line drawing device provided by the embodiment of the present invention, for a certain lane line, the method of determining the offset vector of the lane line is:

基于该车道线的起始像素点坐标和竖直方向的终止像素点坐标确定第一线段,基于该车道线的起始像素点坐标和水平方向的终止像素点坐标确定第二线段。The first line segment is determined based on the starting pixel coordinates of the lane line and the ending pixel coordinates in the vertical direction, and the second line segment is determined based on the starting pixel coordinates of the lane line and the ending pixel coordinates in the horizontal direction.

若第一线段与第二线段的夹角大于第一预设阈值,则将第一线段与第二线段的夹角的正切值作为该车道线的偏置向量。若第一线段与第二线段的夹角不大于第一预设阈值,则将该车道线的偏置向量置为零。If the angle between the first line segment and the second line segment is greater than the first preset threshold, then the tangent value of the angle between the first line segment and the second line segment is used as the offset vector of the lane line. If the angle between the first line segment and the second line segment is not greater than the first preset threshold, then the offset vector of the lane line is set to zero.

参见图9,图9为本发明一实施例提供的终端设备的示意框图。如图9所示的本实施例中的终端900可以包括:一个或多个处理器901、一个或多个输入设备902、一个或多个输出设备903及一个或多个存储器904。上述处理器901、输入设备902、则输出设备903及存储器904通过通信总线905完成相互间的通信。存储器904用于存储计算机程序,计算机程序包括程序指令。处理器901用于执行存储器904存储的程序指令。其中,处理器901被配置用于调用程序指令执行以下操作上述各装置实施例中各模块/单元的功能,例如图8所示模块81至85的功能。Referring to Figure 9, Figure 9 is a schematic block diagram of a terminal device provided by an embodiment of the present invention. The terminal 900 in this embodiment as shown in FIG. 9 may include: one or more processors 901, one or more input devices 902, one or more output devices 903, and one or more memories 904. The above-mentioned processor 901, input device 902, output device 903 and memory 904 complete communication with each other through the communication bus 905. Memory 904 is used to store computer programs, which include program instructions. The processor 901 is used to execute program instructions stored in the memory 904. The processor 901 is configured to call program instructions to perform the following operations on the functions of each module/unit in each of the above device embodiments, such as the functions of modules 81 to 85 shown in FIG. 8 .

应当理解,在本发明实施例中,所称处理器901可以是中央处理单元(CentralProcessing Unit,CPU),该处理器还可以是其他通用处理器、数字信号处理器(DigitalSignal Processor,DSP)、专用集成电路(Application Specific Integrated Circuit,ASIC)、现成可编程门阵列(Field-Programmable Gate Array,FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件等。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。It should be understood that in the embodiment of the present invention, the so-called processor 901 can be a central processing unit (Central Processing Unit, CPU), and the processor can also be other general-purpose processors, digital signal processors (Digital Signal Processor, DSP), dedicated Integrated circuit (Application Specific Integrated Circuit, ASIC), off-the-shelf programmable gate array (Field-Programmable Gate Array, FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or the processor may be any conventional processor, etc.

输入设备902可以包括触控板、指纹采传感器(用于采集用户的指纹信息和指纹的方向信息)、麦克风等,输出设备903可以包括显示器(LCD等)、扬声器等。The input device 902 may include a touch pad, a fingerprint sensor (used to collect the user's fingerprint information and the direction information of the fingerprint), a microphone, etc., and the output device 903 may include a display (LCD, etc.), a speaker, etc.

该存储器904可以包括只读存储器和随机存取存储器,并向处理器901提供指令和数据。存储器904的一部分还可以包括非易失性随机存取存储器。例如,存储器904还可以存储设备类型的信息。The memory 904 may include read-only memory and random access memory and provides instructions and data to the processor 901. A portion of memory 904 may also include non-volatile random access memory. For example, memory 904 may also store device type information.

具体实现中,本发明实施例中所描述的处理器901、输入设备902、输出设备903可执行本发明实施例提供的车道线绘制方法的第一实施例和第二实施例中所描述的实现方式,也可执行本发明实施例所描述的终端的实现方式,在此不再赘述。In specific implementation, the processor 901, input device 902, and output device 903 described in the embodiment of the present invention can execute the implementation described in the first and second embodiments of the lane line drawing method provided by the embodiment of the present invention. In this way, the implementation of the terminal described in the embodiment of the present invention can also be performed, which will not be described again here.

在本发明的另一实施例中提供一种计算机可读存储介质,计算机可读存储介质存储有计算机程序,计算机程序包括程序指令,程序指令被处理器执行时实现上述实施例方法中的全部或部分流程,也可以通过计算机程序来指令相关的硬件来完成,计算机程序可存储于一计算机可读存储介质中,该计算机程序在被处理器执行时,可实现上述各个方法实施例的步骤。其中,计算机程序包括计算机程序代码,计算机程序代码可以为源代码形式、对象代码形式、可执行文件或某些中间形式等。计算机可读介质可以包括:能够携带计算机程序代码的任何实体或装置、记录介质、U盘、移动硬盘、磁碟、光盘、计算机存储器、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random Access Memory)、电载波信号、电信信号以及软件分发介质等。需要说明的是,计算机可读介质包含的内容可以根据司法管辖区内立法和专利实践的要求进行适当的增减,例如在某些司法管辖区,根据立法和专利实践,计算机可读介质不包括是电载波信号和电信信号。In another embodiment of the present invention, a computer-readable storage medium is provided. The computer-readable storage medium stores a computer program. The computer program includes program instructions. When the program instructions are executed by a processor, all or all of the methods in the above embodiments are implemented. Part of the process can also be completed by instructing relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium. When executed by the processor, the computer program can implement the steps of each of the above method embodiments. Among them, the computer program includes computer program code, and the computer program code can be in the form of source code, object code, executable file or some intermediate form, etc. Computer-readable media may include: any entity or device capable of carrying computer program code, recording media, USB flash drives, mobile hard drives, magnetic disks, optical disks, computer memory, read-only memory (ROM, Read-Only Memory), random access Memory (RAM, Random Access Memory), electrical carrier signals, telecommunications signals, and software distribution media, etc. It should be noted that the content contained in the computer-readable medium can be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, the computer-readable medium does not include They are electrical carrier signals and telecommunications signals.

计算机可读存储介质可以是前述任一实施例的终端的内部存储单元,例如终端的硬盘或内存。计算机可读存储介质也可以是终端的外部存储设备,例如终端上配备的插接式硬盘,智能存储卡(Smart Media Card,SMC),安全数字(Secure Digital,SD)卡,闪存卡(Flash Card)等。进一步地,计算机可读存储介质还可以既包括终端的内部存储单元也包括外部存储设备。计算机可读存储介质用于存储计算机程序及终端所需的其他程序和数据。计算机可读存储介质还可以用于暂时地存储已经输出或者将要输出的数据。The computer-readable storage medium may be an internal storage unit of the terminal of any of the aforementioned embodiments, such as a hard disk or memory of the terminal. The computer-readable storage medium can also be an external storage device of the terminal, such as a plug-in hard drive equipped on the terminal, a Smart Media Card (SMC), a Secure Digital (SD) card, or a Flash Card (Flash Card). )wait. Further, the computer-readable storage medium may also include both an internal storage unit of the terminal and an external storage device. Computer-readable storage media are used to store computer programs and other programs and data required by the terminal. Computer-readable storage media can also be used to temporarily store data that has been output or is to be output.

本领域普通技术人员可以意识到,结合本文中所公开的实施例描述的各示例的单元及算法步骤,能够以电子硬件、计算机软件或者二者的结合来实现,为了清楚地说明硬件和软件的可互换性,在上述说明中已经按照功能一般性地描述了各示例的组成及步骤。这些功能究竟以硬件还是软件方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本发明的范围。Those of ordinary skill in the art can appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented with electronic hardware, computer software, or a combination of both. In order to clearly illustrate the relationship between hardware and software Interchangeability, in the above description, the composition and steps of each example have been generally described according to functions. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Skilled artisans may implement the described functionality using different methods for each specific application, but such implementations should not be considered to be beyond the scope of the present invention.

所属领域的技术人员可以清楚地了解到,为了描述的方便和简洁,上述描述的终端和单元的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。Those skilled in the art can clearly understand that for the convenience and simplicity of description, the specific working processes of the terminal and unit described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be described again here.

在本申请所提供的几个实施例中,应该理解到,所揭露的终端和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另外,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口或单元的间接耦合或通信连接,也可以是电的,机械的或其它的形式连接。In the several embodiments provided in this application, it should be understood that the disclosed terminal and method can be implemented in other ways. For example, the device embodiments described above are only illustrative. For example, the division of units is only a logical function division. In actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated. to another system, or some features can be ignored, or not implemented. In addition, the coupling or direct coupling or communication connection between each other shown or discussed may be an indirect coupling or communication connection through some interfaces or units, or may be an electrical, mechanical or other form of connection.

作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本发明实施例方案的目的。A unit described as a separate component may or may not be physically separate. A component shown as a unit may or may not be a physical unit, that is, it may be located in one place, or it may be distributed to multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the embodiments of the present invention.

另外,在本发明各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以是两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。In addition, each functional unit in various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically alone, or two or more units can be integrated into one unit. The above integrated units can be implemented in the form of hardware or software functional units.

以上,仅为本发明的具体实施方式,但本发明的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本发明揭露的技术范围内,可轻易想到各种等效的修改或替换,这些修改或替换都应涵盖在本发明的保护范围之内。因此,本发明的保护范围应以权利要求的保护范围为准。The above are only specific embodiments of the present invention, but the protection scope of the present invention is not limited thereto. Any person familiar with the technical field can easily think of various equivalent modifications or modifications within the technical scope disclosed in the present invention. Replacement, these modifications or substitutions should be covered by the protection scope of the present invention. Therefore, the protection scope of the present invention should be subject to the protection scope of the claims.

Claims (7)

1.一种车道线绘制方法,其特征在于,包括:1. A lane line drawing method, characterized by including: 获取目标车道的车道图像,并对目标车道的车道图像进行检测,得到车道图像中各条车道线的像素点坐标;Obtain the lane image of the target lane, detect the lane image of the target lane, and obtain the pixel coordinates of each lane line in the lane image; 根据车道图像中各条车道线的像素点坐标确定各条车道线的偏置向量;Determine the offset vector of each lane line based on the pixel coordinates of each lane line in the lane image; 基于各条车道线的偏置向量对目标车道的车道图像中的车道线进行修正;Correct the lane lines in the lane image of the target lane based on the offset vector of each lane line; 对于某一条车道线,确定该车道线的偏置向量的方法为:For a certain lane line, the method of determining the offset vector of the lane line is: 基于该车道线的起始像素点坐标和竖直方向的终止像素点坐标确定第一线段,基于该车道线的起始像素点坐标和水平方向的终止像素点坐标确定第二线段;The first line segment is determined based on the starting pixel coordinates of the lane line and the ending pixel coordinates in the vertical direction, and the second line segment is determined based on the starting pixel coordinates of the lane line and the ending pixel coordinates in the horizontal direction; 若第一线段与第二线段的夹角大于第一预设阈值,则将第一线段与第二线段的夹角的正切值作为该车道线的偏置向量;若第一线段与第二线段的夹角不大于第一预设阈值,则将该车道线的偏置向量置为零;If the angle between the first line segment and the second line segment is greater than the first preset threshold, then the tangent value of the angle between the first line segment and the second line segment is used as the offset vector of the lane line; if the first line segment is equal to If the angle between the second line segment is not greater than the first preset threshold, then the offset vector of the lane line is set to zero; 基于各条车道线的像素点坐标、每两条车道线之间的预设像素间隔绘制目标车道的车道线;Draw the lane lines of the target lane based on the pixel coordinates of each lane line and the preset pixel interval between each two lane lines; 所述基于各条车道线的像素点坐标、每两条车道线之间的预设像素间隔绘制目标车道的车道线,包括:The method of drawing the lane lines of the target lane based on the pixel coordinates of each lane line and the preset pixel interval between every two lane lines includes: 设定n=1、目标车道的车道图像中的图像帧数为NmaxSet n=1 and the number of image frames in the lane image of the target lane is N max ; 获取目标车道的车道图像中的第n帧图像和第n+1帧图像;Obtain the n-th frame image and the n+1-th frame image in the lane image of the target lane; 对第n帧图像和第n+1帧图像进行形态学处理,并根据形态学处理结果判断第n帧图像中的上边缘车道线是否和第n+1帧图像中的下边缘车道线连通;Perform morphological processing on the n-th frame image and the n+1-th frame image, and determine whether the upper edge lane line in the n-th frame image is connected to the lower edge lane line in the n+1-th frame image based on the morphological processing results; 若第n帧图像中的上边缘车道线和第n+1帧图像中的下边缘车道线连通,则基于第n帧图像和第n+1帧图像中车道线的像素点坐标对第n帧图像和第n+1帧图像进行拼接,并将拼接后的图像作为第n+1帧图像;If the upper edge lane line in the nth frame image is connected to the lower edge lane line in the n+1th frame image, then based on the pixel point coordinates of the lane line in the nth frame image and the n+1th frame image, the nth frame The image is spliced with the n+1th frame image, and the spliced image is used as the n+1th frame image; 若第n帧图像中的上边缘车道线和第n+1帧图像中的下边缘车道线不连通,则根据基于第n帧图像和第n+1帧图像中车道线的像素点坐标、每两条车道线之间的预设像素间隔确定第n帧图像与第n+1帧图像之间的过渡图像;对第n帧图像、第n帧图像与第n+1帧图像之间的过渡图像、第n+1帧图像进行拼接,并将拼接后的图像作为第n+1帧图像;If the upper edge lane line in the nth frame image and the lower edge lane line in the n+1th frame image are not connected, then based on the pixel coordinates of the lane lines in the nth frame image and the n+1th frame image, each The preset pixel interval between the two lane lines determines the transition image between the nth frame image and the n+1th frame image; for the nth frame image, the transition between the nth frame image and the n+1th frame image image and the n+1th frame image are spliced, and the spliced image is used as the n+1th frame image; 若n+1<Nmax,则令n=n+1,并返回执行获取目标车道的车道图像中的第n帧图像和第n+1帧图像的步骤;若n+1=Nmax,则将第n+1帧图像作为绘制完成的车道线图像输出。If n+1<N max , then let n=n+1, and return to the steps of obtaining the n-th frame image and the n+1-th frame image in the lane image of the target lane; if n+1=N max , then Output the n+1th frame image as the completed lane line image. 2.如权利要求1所述的车道线绘制方法,其特征在于,在获取目标车道的车道图像之前,还包括:2. The lane line drawing method according to claim 1, characterized in that, before acquiring the lane image of the target lane, it further includes: 采集目标车道的视频数据;Collect video data of the target lane; 提取目标车道的视频数据中的多帧图像,得到目标车道的车道图像。Extract multiple frames of images from the video data of the target lane to obtain the lane image of the target lane. 3.如权利要求1所述的车道线绘制方法,其特征在于,在对目标车道的车道图像进行检测之前,还包括对目标车道的车道图像进行预处理的步骤;3. The lane line drawing method according to claim 1, characterized in that, before detecting the lane image of the target lane, it also includes the step of preprocessing the lane image of the target lane; 所述对目标车道的车道图像进行预处理的步骤,包括:The steps of preprocessing the lane image of the target lane include: 基于棋盘格矫正方法对车道图像中的畸变图像进行矫正;Correct the distorted image in the lane image based on the checkerboard correction method; 对矫正后的车道图像进行透视变换和二值化处理,得到预处理后的目标车道的车道图像。Perform perspective transformation and binarization processing on the corrected lane image to obtain the preprocessed lane image of the target lane. 4.如权利要求1所述的车道线绘制方法,其特征在于,所述对目标车道的车道图像进行检测,得到车道图像中各条车道线的像素点坐标,包括:4. The lane line drawing method according to claim 1, wherein the lane image of the target lane is detected to obtain the pixel point coordinates of each lane line in the lane image, including: 基于标准车道线的长度、目标车道的车道图像的宽度确定滑动窗口的预设长度和预设宽度;Determine the preset length and preset width of the sliding window based on the length of the standard lane line and the width of the lane image of the target lane; 基于预设长度和预设宽度的滑动窗口对目标车道的车道图像进行搜索,并在搜索过程中基于车道图像的像素密度对车道图像中的车道线进行识别,确定车道图像中各条车道线的像素点坐标。The lane image of the target lane is searched based on a sliding window of preset length and width, and during the search process, the lane lines in the lane image are identified based on the pixel density of the lane image, and the lane lines in the lane image are determined. Pixel coordinates. 5.一种车道线绘制装置,其特征在于,包括:5. A lane line drawing device, characterized in that it includes: 车道线检测模块,用于获取目标车道的车道图像,并对目标车道的车道图像进行检测,得到车道图像中各条车道线的像素点坐标;The lane line detection module is used to obtain the lane image of the target lane, detect the lane image of the target lane, and obtain the pixel coordinates of each lane line in the lane image; 车道线修正模块,用于根据车道图像中各条车道线的像素点坐标确定各条车道线的偏置向量;The lane line correction module is used to determine the offset vector of each lane line based on the pixel coordinates of each lane line in the lane image; 基于各条车道线的偏置向量对目标车道的车道图像中的车道线进行修正;Correct the lane lines in the lane image of the target lane based on the offset vector of each lane line; 对于某一条车道线,确定该车道线的偏置向量的方法为:For a certain lane line, the method of determining the offset vector of the lane line is: 基于该车道线的起始像素点坐标和竖直方向的终止像素点坐标确定第一线段,基于该车道线的起始像素点坐标和水平方向的终止像素点坐标确定第二线段;The first line segment is determined based on the starting pixel coordinates of the lane line and the ending pixel coordinates in the vertical direction, and the second line segment is determined based on the starting pixel coordinates of the lane line and the ending pixel coordinates in the horizontal direction; 若第一线段与第二线段的夹角大于第一预设阈值,则将第一线段与第二线段的夹角的正切值作为该车道线的偏置向量;若第一线段与第二线段的夹角不大于第一预设阈值,则将该车道线的偏置向量置为零;If the angle between the first line segment and the second line segment is greater than the first preset threshold, then the tangent value of the angle between the first line segment and the second line segment is used as the offset vector of the lane line; if the first line segment is equal to If the angle between the second line segment is not greater than the first preset threshold, then the offset vector of the lane line is set to zero; 车道线绘制模块,用于基于各条车道线的像素点坐标、每两条车道线之间的预设像素间隔绘制目标车道的车道线;The lane line drawing module is used to draw the lane lines of the target lane based on the pixel coordinates of each lane line and the preset pixel interval between each two lane lines; 所述车道线绘制模块,具体用于执行以下步骤:The lane line drawing module is specifically used to perform the following steps: 设定n=1、目标车道的车道图像中的图像帧数为NmaxSet n=1 and the number of image frames in the lane image of the target lane is N max ; 获取目标车道的车道图像中的第n帧图像和第n+1帧图像;Obtain the n-th frame image and the n+1-th frame image in the lane image of the target lane; 对第n帧图像和第n+1帧图像进行形态学处理,并根据形态学处理结果判断第n帧图像中的上边缘车道线是否和第n+1帧图像中的下边缘车道线连通;Perform morphological processing on the n-th frame image and the n+1-th frame image, and determine whether the upper edge lane line in the n-th frame image is connected to the lower edge lane line in the n+1-th frame image based on the morphological processing results; 若第n帧图像中的上边缘车道线和第n+1帧图像中的下边缘车道线连通,则基于第n帧图像和第n+1帧图像中车道线的像素点坐标对第n帧图像和第n+1帧图像进行拼接,并将拼接后的图像作为第n+1帧图像;If the upper edge lane line in the nth frame image is connected to the lower edge lane line in the n+1th frame image, then based on the pixel point coordinates of the lane line in the nth frame image and the n+1th frame image, the nth frame The image is spliced with the n+1th frame image, and the spliced image is used as the n+1th frame image; 若第n帧图像中的上边缘车道线和第n+1帧图像中的下边缘车道线不连通,则根据基于第n帧图像和第n+1帧图像中车道线的像素点坐标、每两条车道线之间的预设像素间隔确定第n帧图像与第n+1帧图像之间的过渡图像;对第n帧图像、第n帧图像与第n+1帧图像之间的过渡图像、第n+1帧图像进行拼接,并将拼接后的图像作为第n+1帧图像;If the upper edge lane line in the nth frame image and the lower edge lane line in the n+1th frame image are not connected, then based on the pixel coordinates of the lane lines in the nth frame image and the n+1th frame image, each The preset pixel interval between the two lane lines determines the transition image between the nth frame image and the n+1th frame image; for the nth frame image, the transition between the nth frame image and the n+1th frame image image and the n+1th frame image are spliced, and the spliced image is used as the n+1th frame image; 若n+1<Nmax,则令n=n+1,并返回执行获取目标车道的车道图像中的第n帧图像和第n+1帧图像的步骤;若n+1=Nmax,则将第n+1帧图像作为绘制完成的车道线图像输出。If n+1<N max , then let n=n+1, and return to the steps of obtaining the n-th frame image and the n+1-th frame image in the lane image of the target lane; if n+1=N max , then Output the n+1th frame image as the completed lane line image. 6.一种终端设备,包括存储器、处理器以及存储在所述存储器中并可在所述处理器上运行的计算机程序,其特征在于,所述处理器执行所述计算机程序时实现如权利要求1至4任一项所述方法的步骤。6. A terminal device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that when the processor executes the computer program, the processor implements the claims as claimed in Steps of the method described in any one of 1 to 4. 7.一种计算机可读存储介质,所述计算机可读存储介质存储有计算机程序,其特征在于,所述计算机程序被处理器执行时实现如权利要求1至4任一项所述方法的步骤。7. A computer-readable storage medium, the computer-readable storage medium stores a computer program, characterized in that, when the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 4 are implemented. .
CN202010010586.5A 2020-01-06 2020-01-06 Lane line drawing method, device and terminal equipment Active CN111199567B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010010586.5A CN111199567B (en) 2020-01-06 2020-01-06 Lane line drawing method, device and terminal equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010010586.5A CN111199567B (en) 2020-01-06 2020-01-06 Lane line drawing method, device and terminal equipment

Publications (2)

Publication Number Publication Date
CN111199567A CN111199567A (en) 2020-05-26
CN111199567B true CN111199567B (en) 2023-09-12

Family

ID=70746847

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010010586.5A Active CN111199567B (en) 2020-01-06 2020-01-06 Lane line drawing method, device and terminal equipment

Country Status (1)

Country Link
CN (1) CN111199567B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113888671B (en) * 2021-10-19 2024-04-19 智道网联科技(北京)有限公司 Map road rendering method, device, equipment and storage medium
CN114719872B (en) * 2022-05-13 2022-09-23 高德软件有限公司 Lane line processing method and device and electronic equipment
CN115797506B (en) * 2022-12-16 2023-11-17 江苏泽景汽车电子股份有限公司 Method, device, terminal equipment and storage medium for drawing lane line object

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110426051A (en) * 2019-08-05 2019-11-08 武汉中海庭数据技术有限公司 A kind of lane line method for drafting, device and storage medium

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110426051A (en) * 2019-08-05 2019-11-08 武汉中海庭数据技术有限公司 A kind of lane line method for drafting, device and storage medium

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
陈涵深.基于多帧叠加和窗口搜索的快速车道检测.《计算机科学》.2018,第45卷(第45期),第255-260页. *

Also Published As

Publication number Publication date
CN111199567A (en) 2020-05-26

Similar Documents

Publication Publication Date Title
CN111199567B (en) Lane line drawing method, device and terminal equipment
TWI619080B (en) Method for calculating fingerprint overlapping region and electronic device
KR101805090B1 (en) Method and device for region identification
CN112712023B (en) Vehicle type identification method, system and electronic equipment
CN112101305A (en) Multi-path image processing method and device and electronic equipment
US10410053B2 (en) Method, apparatus, system, and storage medium for detecting information card in image
CN110781823B (en) Screen recording detection method and device, readable medium and electronic equipment
CN103488984A (en) Method and device for identifying second-generation identity cards based on intelligent mobile equipment
CN111950353A (en) Seal text recognition method, device and electronic equipment
WO2020151156A1 (en) Video stream playing method and system, computer apparatus and readable storage medium
CN110740315B (en) Camera correction method and device, electronic equipment and storage medium
WO2018184255A1 (en) Image correction method and device
CN102980535A (en) Angle measurement method and device
CN113592792A (en) Rockfill image particle size identification method and device, electronic device and storage medium
CN114897684A (en) Vehicle image splicing method and device, computer equipment and storage medium
CN111368698A (en) Subject recognition method, subject recognition device, electronic device, and medium
CN116884065A (en) Face recognition method and computer-readable storage medium
CN109300322B (en) Guideline drawing method, apparatus, device, and medium
CN112633143B (en) Image processing system, method, head-mounted device, processing device, and storage medium
CN114359147A (en) Crack detection method, device, server and storage medium
US12333824B2 (en) Object detection method and apparatus for vehicle, device, vehicle and medium
CN117876994A (en) Parking space recognition model training method, parking space recognition method and related device
WO2022027191A1 (en) Method and device for plane correction, computer-readable medium, and electronic device
CN110874814B (en) An image processing method, image processing device and terminal equipment
CN117351511A (en) Detection methods, devices and equipment for high-precision maps

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