WO2023279966A1 - Multi-lane-line detection method and apparatus, and detection device - Google Patents
Multi-lane-line detection method and apparatus, and detection device Download PDFInfo
- Publication number
- WO2023279966A1 WO2023279966A1 PCT/CN2022/100542 CN2022100542W WO2023279966A1 WO 2023279966 A1 WO2023279966 A1 WO 2023279966A1 CN 2022100542 W CN2022100542 W CN 2022100542W WO 2023279966 A1 WO2023279966 A1 WO 2023279966A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- straight line
- line segments
- lane
- line segment
- image
- Prior art date
Links
- 238000001514 detection method Methods 0.000 title claims abstract description 55
- 238000012545 processing Methods 0.000 claims abstract description 22
- 238000003708 edge detection Methods 0.000 claims abstract description 15
- 238000012216 screening Methods 0.000 claims abstract description 14
- 238000000034 method Methods 0.000 claims description 91
- 238000001914 filtration Methods 0.000 claims description 16
- 238000004590 computer program Methods 0.000 claims description 13
- 239000000284 extract Substances 0.000 claims description 5
- 238000000605 extraction Methods 0.000 claims description 3
- 238000012795 verification Methods 0.000 abstract description 4
- 230000000903 blocking effect Effects 0.000 abstract description 3
- 238000010586 diagram Methods 0.000 description 5
- 230000000694 effects Effects 0.000 description 5
- 238000005516 engineering process Methods 0.000 description 3
- 238000007781 pre-processing Methods 0.000 description 3
- 230000009286 beneficial effect Effects 0.000 description 2
- 238000004422 calculation algorithm Methods 0.000 description 2
- 238000004364 calculation method Methods 0.000 description 2
- 238000007621 cluster analysis Methods 0.000 description 2
- 230000011218 segmentation Effects 0.000 description 2
- 238000004458 analytical method Methods 0.000 description 1
- 238000013473 artificial intelligence Methods 0.000 description 1
- 230000005540 biological transmission Effects 0.000 description 1
- 238000012937 correction Methods 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 230000018109 developmental process Effects 0.000 description 1
- 238000009434 installation Methods 0.000 description 1
- 238000012544 monitoring process Methods 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 238000011160 research Methods 0.000 description 1
- 238000000926 separation method Methods 0.000 description 1
- 230000003068 static effect Effects 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V20/00—Scenes; Scene-specific elements
- G06V20/40—Scenes; Scene-specific elements in video content
- G06V20/46—Extracting features or characteristics from the video content, e.g. video fingerprints, representative shots or key frames
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V10/00—Arrangements for image or video recognition or understanding
- G06V10/40—Extraction of image or video features
- G06V10/44—Local feature extraction by analysis of parts of the pattern, e.g. by detecting edges, contours, loops, corners, strokes or intersections; Connectivity analysis, e.g. of connected components
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V20/00—Scenes; Scene-specific elements
- G06V20/50—Context or environment of the image
- G06V20/56—Context or environment of the image exterior to a vehicle by using sensors mounted on the vehicle
- G06V20/588—Recognition of the road, e.g. of lane markings; Recognition of the vehicle driving pattern in relation to the road
Definitions
- the present invention relates to the technical field of image processing, in particular to a multi-lane detection method, device and detection equipment.
- the present application provides a multi-lane line detection method, device and detection equipment, which are used to solve the problem that in the prior art, all the lane lines cannot be detected at one time, and the vehicles on the road will block the lane lines and thus affect the The detection effect, some identifiers and signs on the road will be falsely detected as lane lines.
- the present application provides a multi-lane line detection method, including:
- Determining the lane line according to the straight line segment obtained after the second merging process includes:
- the straight line segments obtained after the second merging process are determined as lane lines.
- the filtering out non-lane lines according to the position information corresponding to a plurality of straight line segments in each frame image includes:
- the non-lane lines in the multiple straight line segments are screened out.
- the filtering out non-lane lines in the multiple straight line segments according to the slopes of the multiple straight line segments in each frame of image and the first angle includes:
- ⁇ is the first angle
- ⁇ is the slope of the straight line segment
- the first merging process and/or the second merging process includes:
- the straight line segments satisfying the preset condition are merged into one straight line segment.
- the preset condition is:
- ⁇ is the preset angle
- D is the preset distance
- P 1 and P 2 are respectively the abscissas of the intersection points of the two straight line segments and the x-axis
- the step of determining the lane line according to the straight line segment obtained after the second merging process it further includes:
- the present application also provides a multi-lane detection device, including:
- the extraction module is configured to extract several frame images from the video of the road with multi-lane lines;
- a processing module configured to perform binarization processing and edge detection on each frame of image to obtain a plurality of straight line segments in each frame of image
- the filtering module is configured to filter out non-lane lines according to the position information corresponding to a plurality of straight line segments in each frame of image;
- the first merging module is configured to perform the first merging process on the straight line segments located on the same straight line among the multiple straight line segments obtained after screening in each frame of image;
- the second merging module is configured to perform the second merging process on the straight line segments obtained after the first merging process in all frame images;
- the determination module is configured to determine the lane line according to the straight line segment obtained after the second merging process
- the determination module includes:
- the determination unit is configured to determine, among the straight line segments obtained after the second merging process, the number of the combined straight line segments obtained after the first merging process is greater than a preset threshold value as the lane line.
- the screening module includes:
- an angle unit configured to determine a first angle formed between the shooting direction of the video and the direction of the road;
- the filtering unit is configured to filter out non-lane lines in the multiple straight line segments in each frame of image according to the slopes of the multiple straight line segments and the first angle.
- the screening unit includes:
- the first subunit is configured such that if the slope of a line segment meets the first angle: then retain the straight line segment;
- the second subunit is configured such that if the slope of a line segment meets the first angle: Then filter out the straight line segment;
- ⁇ is the first angle
- ⁇ is the slope of the straight line segment
- the first merging process and/or the second merging process includes:
- the straight line segments satisfying the preset condition are merged into one straight line segment.
- the preset condition is:
- ⁇ is the preset angle
- D is the preset distance
- P 1 and P 2 are respectively the abscissas of the intersection points of the two straight line segments and the x-axis
- it also includes:
- the third merging module is configured to merge two straight line segments whose distance is smaller than a preset distance into one straight line segment as a final lane line.
- the present application also provides a detection device, including a memory, a processor, and a computer program stored on the memory and operable on the processor; when the processor executes the computer program, the above-mentioned Any multi-lane line detection method.
- the present application further provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the steps in any one of the above multi-lane detection methods are implemented.
- multi-frame images in the road video are extracted to detect multi-lane lines, and the mutual complementation and mutual verification between multi-frame images is used to avoid the missed detection caused by vehicles blocking the lane lines. It prevents non-lane lines such as pavement symbol signs and text signs from being misdetected as lane lines, and improves the accuracy of lane line detection.
- FIG. 1 is a schematic flowchart of a multi-lane detection method provided in Embodiment 1 of the present application;
- Fig. 2 is the result figure after the image in embodiment one of the present application is binarized
- Fig. 3 is the result figure after edge detection is performed on the image in Embodiment 1 of the present application;
- FIG. 4 is a schematic structural diagram of a multi-lane detection device in Embodiment 2 of the present application.
- FIG. 5 is a schematic structural diagram of a detection device in Embodiment 3 of the present application.
- FIG. 1 is a schematic flowchart of a multi-lane detection method provided in Embodiment 1 of the present application. The method includes the following steps:
- Step 11 Extract several frames of images from the video of the road with multiple lanes.
- a video of a certain road is captured first, and the road captured in the video has multiple lane lines, and then the continuous frames of the acquired video are analyzed, and several frames of images are extracted from the video; optionally, When extracting, several frames of images can be extracted at intervals from consecutive frames, and the size of the interval and the specific number of frames to be extracted can be adjusted according to the specific conditions of the road and traffic.
- the vehicles driving on the road usually form certain occlusions to the lane lines, which makes the detection of the occluded lane lines more difficult. At the same time, if there are symbols, text signs, etc.
- the discrimination can be realized according to the number of straight line segments appearing in several frames of images.
- Using the method of mutual verification and complementarity between multiple frames of images can make the lane line detection results more complete and accurate, so that the lane lines existing on the road can be completely detected, and at the same time, the interference objects that do not belong to the lane line can be effectively eliminated.
- Step 12 Perform binarization processing and edge detection on each frame of image to obtain multiple straight line segments in each frame of image.
- each frame of images may be preprocessed first.
- the preprocessing may include: performing distortion correction on each frame of image according to the camera parameters of the camera that shoots the road video, so as to prevent the straight lines on the road from appearing non-linear in the image due to distortion; the preprocessing may also Including: According to the spatial position relationship of the camera's installation position, height, angle, etc. relative to the captured road, the approximate image range of the road in each frame of image is obtained through geometric calculation, and the image region of interest (region) is set according to this range.
- the follow-up process can only process the region of interest in the image, which can save computing time;
- the preprocessing can also include: converting each frame of image into grayscale through the color image to grayscale image formula Image, because the color image and grayscale image have little influence on the detection effect, and the multi-channel image becomes a single channel, which is beneficial to speed up image processing.
- each frame of image can be binarized, that is, binary Value-based segmentation, for example: given a threshold, the pixels in the image whose grayscale is higher than this threshold are assigned a value of 255, and the pixels lower than or equal to this threshold are assigned a value of 0.
- the key of binarization segmentation lies in the determination of the threshold value.
- the threshold value such as image gray level average method, etc.
- the result after binarization processing is shown in Figure 2.
- the image may also be filtered to improve the effect of image edge detection in the next step.
- FIG. 3 is a result diagram of edge detection performed on the image in Embodiment 1 of the present application.
- edge detection is further performed on the image, and the result after the edge detection is shown in FIG. 3 .
- the straight line segment of the vector can be obtained by means of straight line fitting, so as to obtain multiple straight line segments in each frame of the image, and the obtained after fitting
- Step 13 Filter out non-lane lines according to the position information corresponding to multiple straight line segments in each frame of image.
- the straight line segment fitted after edge detection are obviously not lane lines, for example, the lane line is consistent with the direction of the road, if the angle between the direction of the straight line segment and the direction of the road exceeds a certain value, the straight line segment is considered It is obviously not a lane line.
- some straight line segments that are obviously not a lane line may be screened out according to the position information corresponding to multiple straight line segments in each frame of image.
- the filtering out the non-lane lines according to the position information corresponding to the multiple straight line segments in each frame image includes:
- the non-lane lines in the multiple straight line segments are screened out.
- the position information corresponding to the straight line segment can include the position/coordinate of the straight line segment in the image, and the slope of the straight line segment.
- the determination of the slope threshold is related to The orientation relationship between the camera that shoots the video and the road is related. Therefore, the first angle formed between the shooting direction of the video and the direction of the road to be shot is determined, and part of the straight line segments can be screened out according to the slope of each straight line segment and the relationship between the first angle.
- the filtering out non-lane lines in the multiple straight line segments according to the slopes of the multiple straight line segments in each frame of image and the first angle includes:
- ⁇ is the first angle
- ⁇ is the slope of the straight line segment
- ⁇ be the first angle formed between the shooting direction of the video and the direction of the road being shot
- ⁇ be the slope of multiple straight line segments fitted in each frame of image
- the angle of the straight line segment is calculated by the arc tangent arctan, and then the angular relationship between the first angle ⁇ and the straight line segment is limited by the tangent value, so that some straight line segments that are obviously not lane lines can be screened out.
- Step 14 Perform the first merging process on the straight line segments located on the same straight line among the multiple straight line segments obtained after filtering in each frame of image.
- the edge fitting of the solid line lane lines is a complete straight line segment, that is, a solid line
- the edge of a lane line corresponds to a straight line segment; while each small segment of a dashed lane line will be fitted with a straight line segment, that is, the edge of a dashed lane line will correspond to multiple straight line segments, in fact, these straight line segments are all on the same line Therefore, in the detection process, these straight line segments that are actually on the same straight line need to be merged.
- the first merging process includes:
- the straight line segments satisfying the preset condition are merged into one straight line segment.
- the basis for merging is that for every two straight line segments, if the rotation angles and distances of the two straight line segments are very close, it can be determined that the two straight line segments are on the same straight line, and the two straight line segments can be combined segments are merged.
- ⁇ is the preset angle
- D is the preset distance
- P 1 and P 2 are respectively the abscissas of the intersection points of the two straight line segments and the x-axis
- the endpoints of the merged straight line segment can be the two endpoints farthest from the endpoints (four endpoints in total) of the two straight line segments before the merge, and the above-mentioned merge process is repeated until the dotted lane line corresponds to All the straight line segments lying on the same straight line are connected.
- a vector-type storage container may be created to store the straight line segment processed from each frame of image.
- Step 15 Perform the second merging process on the straight line segments obtained after the first merging process in all frame images.
- the second merging process includes:
- the straight line segments satisfying the preset condition are merged into one straight line segment.
- ⁇ is the preset angle
- D is the preset distance
- P 1 and P 2 are respectively the abscissas of the intersection points of the two straight line segments and the x-axis
- Step 16 Determining the lane line according to the straight line segment obtained after the second merging process, said determining the lane line according to the straight line segment obtained after the second merging process includes:
- the straight line segments obtained after the second merging process are determined as lane lines.
- the number of repetitions of the straight line segments corresponding to these symbols and characters in all frame images is usually higher than that of the straight line corresponding to the lane line. Therefore, by counting the number of straight line segments obtained after the first merge process combined by each straight line segment obtained after the second merge process, it can be determined which straight line segments are lane line. For example, the set of straight line segments before the second merging process (that is, the straight line segments obtained after the first merging process) can be set as A, and the set of straight line segments after the second merging process is B. While performing the second merging process, it is also counted how many straight line segments in set A each straight line segment in set B is merged from.
- the straight line segment is determined as the lane line. Therefore, by setting the preset threshold value, the straight line segment corresponding to the symbol mark and text mark on the road can be screened out, thereby improving the accuracy of detection.
- the value of the preset threshold can be adjusted according to specific road conditions.
- the step of determining the lane line according to the straight line segment obtained after the second merging process it further includes:
- a lane line on the road will detect two straight line segments in the image, that is, the straight line segments corresponding to the edges on both sides of the length direction of the lane line, and the detected lane line
- the goal of the line is to provide accurate lane separation information for driving, traffic monitoring, traffic scheduling, etc. Therefore, it is more convenient for each actual lane line to be marked with a straight line segment in the detection results of the lane line. Therefore, Among the straight line segments determined as lane lines, if two straight line segments correspond to both side edges of the same lane line, the two straight line segments may be merged into one line.
- straight line segments may be merged according to the actual width of the lanes on the road and/or the actual width of the lane lines. For example, two straight line segments whose distance is smaller than the preset distance are merged into one straight line segment as the final lane line.
- the final lane line takes an intermediate value, that is, an equidistant line between the two straight line segments.
- the straight line segments determined as lane lines can be sorted from left to right according to the intersection of their extension lines and the x-axis, and then cluster analysis is performed on the sorted straight line segments, that is, according to the relationship between the two straight line segments and The distance between the intersection points of the x-axis is used for cluster analysis.
- the two straight line segments belong to the two side edges of the same lane line. At this time, the two straight line segments can be merged into one, and if If the spacing is greater than the preset spacing, it is judged that the two straight line segments do not belong to the edges on both sides of the same lane line.
- multi-frame images in the road video are extracted to detect multi-lane lines, and the mutual complementation and mutual verification between multi-frame images is used to avoid missed detection caused by vehicles blocking lane lines. It also prevents non-lane lines such as road surface symbols and text signs from being misdetected as lane lines, and improves the accuracy of lane line detection.
- FIG. 4 is a schematic structural diagram of a multi-lane detection device provided in Embodiment 2 of the present application.
- the detection device 40 includes:
- the extraction module 41 is configured to extract several frames of images from the video of the road with multi-lane lines;
- the processing module 42 is configured to perform binarization processing and edge detection on each frame of image to obtain a plurality of straight line segments in each frame of image;
- the filtering module 43 is configured to filter out non-lane lines according to the position information corresponding to a plurality of straight line segments in each frame of image;
- the first merging module 44 is configured to perform the first merging process on the straight line segments located on the same straight line among the multiple straight line segments obtained after screening in each frame of image;
- the second merging module 45 is configured to perform a second merging process on the straight line segments obtained after the first merging process in all frame images;
- the determination module 46 is configured to determine the lane line according to the straight line segment obtained after the second merging process
- the determination module includes:
- the determination unit is configured to determine, among the straight line segments obtained after the second merging process, the number of the combined straight line segments obtained after the first merging process is greater than a preset threshold value as the lane line.
- the screening module includes:
- an angle unit configured to determine a first angle formed between the shooting direction of the video and the direction of the road;
- the filtering unit is configured to filter out non-lane lines in the multiple straight line segments in each frame of image according to the slopes of the multiple straight line segments and the first angle.
- the screening unit includes:
- the first subunit is configured such that if the slope of a line segment meets the first angle: then retain the straight line segment;
- the second subunit is configured such that if the slope of a line segment meets the first angle: Then filter out the straight line segment;
- ⁇ is the first angle
- ⁇ is the slope of the straight line segment
- the first merging process and/or the second merging process includes:
- the straight line segments satisfying the preset condition are merged into one straight line segment.
- the preset condition is:
- ⁇ is the preset angle
- D is the preset distance
- P 1 and P 2 are respectively the abscissas of the intersection points of the two straight line segments and the x-axis
- it also includes:
- the third merging module is configured to merge the two straight line segments whose distance is smaller than the preset distance into one straight line segment as the final lane line.
- the embodiment of the present application is a product embodiment corresponding to the above-mentioned method embodiment one, so details are not repeated here, please refer to the above-mentioned embodiment one for details.
- FIG. 5 is a schematic structural diagram of a detection device provided in Embodiment 3 of the present application.
- the detection device 50 includes a processor 51, a memory 52 and a The computer program that runs on; When described processor 51 executes described computer program, realize following steps:
- Determining the lane line according to the straight line segment obtained after the second merging process includes:
- the straight line segments obtained after the second merging process are determined as lane lines.
- Said filtering non-lane lines according to the position information corresponding to a plurality of straight line segments in each frame image includes:
- the non-lane lines in the multiple straight line segments are screened out.
- the filtering out non-lane lines in the multiple straight line segments according to the slopes of the multiple straight line segments in each frame of image and the first angle includes:
- ⁇ is the first angle
- ⁇ is the slope of the straight line segment
- the first merging process and/or the second merging process includes:
- the straight line segments satisfying the preset condition are merged into one straight line segment.
- the preset condition is:
- ⁇ is the preset angle
- D is the preset distance
- P 1 and P 2 are respectively the abscissas of the intersection points of the two straight line segments and the x-axis
- the step of determining the lane line according to the straight line segment obtained after the second merging process it further includes:
- Embodiment 4 of the present application provides a computer-readable storage medium, on which a computer program is stored.
- the computer program is executed by a processor, the steps in the method for detecting multi-lane markings in Embodiment 1 above are implemented.
- the steps in the method for detecting multi-lane markings in Embodiment 1 above are implemented.
- the above-mentioned computer-readable storage media include permanent and non-permanent, removable and non-removable media, and information storage may be realized by any method or technology.
- Information may be computer readable instructions, data structures, modules of a program, or other data.
- Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read only memory (ROM), Electrically Erasable Programmable Read-Only Memory (EEPROM), Flash memory or other memory technology, Compact Disc Read-Only Memory (CD-ROM), Digital Versatile Disc (DVD) or other optical storage, Magnetic tape cartridge, tape magnetic disk storage or other magnetic storage device or any other non-transmission medium that can be used to store information that can be accessed by a computing device.
- PRAM phase change memory
- SRAM static random access memory
- DRAM dynamic random access memory
- RAM random access memory
- ROM read only memory
- EEPROM Electrically Era
Landscapes
- Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Multimedia (AREA)
- Theoretical Computer Science (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Image Analysis (AREA)
- Image Processing (AREA)
Abstract
The present application belongs to the technical field of image processing. Provided are a multi-lane-line detection method and apparatus, and a detection device. The multi-lane-line detection method comprises: extracting a plurality of frames of images from a video of a road having a plurality of lane lines; performing binarization processing and edge detection on each frame of image, so as to obtain a plurality of straight line segments; according to position information corresponding to the plurality of straight line segments, screening out non-lane lines; performing first merging processing on a plurality of straight line segments obtained after same have been subjected to screening; performing second merging processing on straight line segments, which are obtained after same have been subjected to first merging processing, in all the frames of images; and determining lane lines according to straight line segments obtained after same have been subjected to second merging processing. In the present application, a plurality of frames of images are extracted from a video of a road to perform detection, and mutual compensation and verification between the plurality of frames of images are utilized, such that the situation of missing detection due to a vehicle blocking a lane line is avoided, and a non-lane line, such as a symbol or sign on a road, is also prevented from being mistakenly detected as a lane line, thereby increasing the accuracy rate of lane line detection.
Description
相关申请的交叉引用Cross References to Related Applications
本申请基于申请号为202110770354.4、申请日为2021年07月08日的中国专利申请提出,并要求该中国专利申请的优先权,该中国专利申请的全部内容在此引入本申请作为参考。This application is based on a Chinese patent application with application number 202110770354.4 and a filing date of July 08, 2021, and claims the priority of this Chinese patent application. The entire content of this Chinese patent application is hereby incorporated by reference into this application.
本发明涉及图像处理技术领域,尤其涉及一种多车道线检测方法、装置及检测设备。The present invention relates to the technical field of image processing, in particular to a multi-lane detection method, device and detection equipment.
目前,如何准确地把道路的车道线检测出来,是在进行智能驾驶、交通状况检测、交通调度等方面的研究时经常要面对的一个问题。随着计算机视觉和人工智能技术的发展,车道线检测算法也有了很大的进步,但还是存在一些问题,例如,不能一次性把所有车道线全部检测出来、道路上的车辆会对车道线进行遮挡从而影响检测效果、道路上的一些标识符和标识文字会被误检成车道线。At present, how to accurately detect the lane line of the road is a problem that is often faced when conducting research on intelligent driving, traffic condition detection, and traffic scheduling. With the development of computer vision and artificial intelligence technology, the lane line detection algorithm has also made great progress, but there are still some problems, for example, all the lane lines cannot be detected at one time, and the vehicles on the road will detect the lane lines. Occlusion will affect the detection effect, and some identifiers and signs on the road will be mistakenly detected as lane lines.
发明内容Contents of the invention
有鉴于此,本申请提供一种多车道线检测方法、装置及检测设备,用于解决现有技术中不能一次性把所有车道线全部检测出来、道路上的车辆会对车道线进行遮挡从而影响检测效果、道路上的一些标识符和标识文字会被误检成车道线的问题。In view of this, the present application provides a multi-lane line detection method, device and detection equipment, which are used to solve the problem that in the prior art, all the lane lines cannot be detected at one time, and the vehicles on the road will block the lane lines and thus affect the The detection effect, some identifiers and signs on the road will be falsely detected as lane lines.
为解决上述技术问题,第一方面,本申请提供一种多车道线检测方法, 包括:In order to solve the above technical problems, in the first aspect, the present application provides a multi-lane line detection method, including:
从具有多车道线的道路的视频中抽取若干帧图像;Extract several frames of images from a video of a road with multiple lanes;
对每一帧图像进行二值化处理以及边缘检测,得到每一帧图像中的多条直线段;Perform binarization processing and edge detection on each frame of image to obtain multiple straight line segments in each frame of image;
根据每一帧图像中的多条直线段对应的位置信息对非车道线进行筛除;Filter out non-lane lines according to the position information corresponding to multiple straight line segments in each frame of image;
将每一帧图像中经筛除后得到的多条直线段中位于同一直线的直线段进行第一次合并处理;Performing the first merging process on the straight line segments located on the same straight line among the multiple straight line segments obtained after screening in each frame of image;
将所有帧图像中经第一次合并处理后得到的直线段进行第二次合并处理;Perform a second merge process on the straight line segments obtained after the first merge process in all frame images;
根据第二次合并处理后得到的直线段确定车道线;Determine the lane line according to the straight line segment obtained after the second merging process;
所述根据第二次合并处理后得到的直线段确定车道线包括:Determining the lane line according to the straight line segment obtained after the second merging process includes:
将第二次合并处理后得到的直线段中所合并的经第一次合并处理后得到的直线段的数量大于预设阈值的直线段确定为车道线。Among the straight line segments obtained after the second merging process, the straight line segments whose number of the combined straight line segments obtained after the first merging process is greater than a preset threshold are determined as lane lines.
较佳地,所述根据每一帧图像中的多条直线段对应的位置信息对非车道线进行筛除包括:Preferably, the filtering out non-lane lines according to the position information corresponding to a plurality of straight line segments in each frame image includes:
确定所述视频的拍摄方向和所述道路的走向之间所成的第一角度;determining a first angle formed between the shooting direction of the video and the direction of the road;
根据每一帧图像中的多条直线段的斜率以及所述第一角度,筛除所述多条直线段中的非车道线。According to the slopes of the multiple straight line segments in each frame of image and the first angle, the non-lane lines in the multiple straight line segments are screened out.
较佳地,所述根据每一帧图像中的多条直线段的斜率以及所述第一角度,筛除所述多条直线段中的非车道线包括:Preferably, the filtering out non-lane lines in the multiple straight line segments according to the slopes of the multiple straight line segments in each frame of image and the first angle includes:
若一直线段的斜率与所述第一角度满足:
则保留所述直线段;
If the slope of a line segment meets the first angle: then retain the straight line segment;
若一直线段的斜率与所述第一角度满足:
则筛除所述直线段;
If the slope of a line segment meets the first angle: Then filter out the straight line segment;
其中,θ为所述第一角度,α为直线段的斜率。Wherein, θ is the first angle, and α is the slope of the straight line segment.
较佳地,所述第一次合并处理和/或所述第二次合并处理包括:Preferably, the first merging process and/or the second merging process includes:
若直线段之间的距离以及相对于一参考轴的旋转角度满足预设条件,则将满足预设条件的直线段合并为一条直线段。If the distance between the straight line segments and the rotation angle relative to a reference axis satisfy the preset condition, the straight line segments satisfying the preset condition are merged into one straight line segment.
较佳地,针对每两条直线段,所述预设条件为:Preferably, for every two straight line segments, the preset condition is:
其中,β为预设角度,D为预设距离,一直线段的表达式为y=a
1x+b
1,另一直线段的表达式为y=a
2x+b
2,
分别为两条直线段相对于x轴的旋转角度,
P
1、P
2分别为两条直线段所在直线与x轴的交点的横坐标,
Wherein, β is the preset angle, D is the preset distance, the expression of a straight line segment is y=a 1 x+b 1 , and the expression of another straight line segment is y=a 2 x+b 2 , are the rotation angles of the two straight line segments relative to the x-axis, P 1 and P 2 are respectively the abscissas of the intersection points of the two straight line segments and the x-axis,
较佳地,所述根据第二次合并处理后得到的直线段确定车道线的步骤之后,还包括:Preferably, after the step of determining the lane line according to the straight line segment obtained after the second merging process, it further includes:
将间距小于预设间距的两条直线段合并为一条直线段,作为最终车道线。Merge two straight line segments whose distance is smaller than the preset distance into one straight line segment as the final lane line.
第二方面,本申请还提供一种多车道线检测装置,包括:In a second aspect, the present application also provides a multi-lane detection device, including:
抽取模块,配置为从具有多车道线的道路的视频中抽取若干帧图像;The extraction module is configured to extract several frame images from the video of the road with multi-lane lines;
处理模块,配置为对每一帧图像进行二值化处理以及边缘检测,得到每一帧图像中的多条直线段;A processing module configured to perform binarization processing and edge detection on each frame of image to obtain a plurality of straight line segments in each frame of image;
筛除模块,配置为根据每一帧图像中的多条直线段对应的位置信息对非车道线进行筛除;The filtering module is configured to filter out non-lane lines according to the position information corresponding to a plurality of straight line segments in each frame of image;
第一合并模块,配置为将每一帧图像中经筛除后得到的多条直线段中位于同一直线的直线段进行第一次合并处理;The first merging module is configured to perform the first merging process on the straight line segments located on the same straight line among the multiple straight line segments obtained after screening in each frame of image;
第二合并模块,配置为将所有帧图像中经第一次合并处理后得到的直 线段进行第二次合并处理;The second merging module is configured to perform the second merging process on the straight line segments obtained after the first merging process in all frame images;
确定模块,配置为根据第二次合并处理后得到的直线段确定车道线;The determination module is configured to determine the lane line according to the straight line segment obtained after the second merging process;
所述确定模块包括:The determination module includes:
确定单元,配置为将第二次合并处理后得到的直线段中所合并的经第一次合并处理后得到的直线段的数量大于预设阈值的直线段确定为车道线。The determination unit is configured to determine, among the straight line segments obtained after the second merging process, the number of the combined straight line segments obtained after the first merging process is greater than a preset threshold value as the lane line.
较佳地,所述筛除模块包括:Preferably, the screening module includes:
角度单元,配置为确定所述视频的拍摄方向和所述道路的走向之间所成的第一角度;an angle unit configured to determine a first angle formed between the shooting direction of the video and the direction of the road;
筛除单元,配置为根据每一帧图像中的多条直线段的斜率以及所述第一角度,筛除所述多条直线段中的非车道线。The filtering unit is configured to filter out non-lane lines in the multiple straight line segments in each frame of image according to the slopes of the multiple straight line segments and the first angle.
较佳地,所述筛除单元包括:Preferably, the screening unit includes:
第一子单元,配置为若一直线段的斜率与所述第一角度满足:
则保留所述直线段;
The first subunit is configured such that if the slope of a line segment meets the first angle: then retain the straight line segment;
第二子单元,配置为若一直线段的斜率与所述第一角度满足:
则筛除所述直线段;
The second subunit is configured such that if the slope of a line segment meets the first angle: Then filter out the straight line segment;
其中,θ为所述第一角度,α为直线段的斜率。Wherein, θ is the first angle, and α is the slope of the straight line segment.
较佳地,所述第一次合并处理和/或所述第二次合并处理包括:Preferably, the first merging process and/or the second merging process includes:
若直线段之间的距离以及相对于一参考轴的旋转角度满足预设条件,则将满足预设条件的直线段合并为一条直线段。If the distance between the straight line segments and the rotation angle relative to a reference axis satisfy the preset condition, the straight line segments satisfying the preset condition are merged into one straight line segment.
较佳地,针对每两条直线段,所述预设条件为:Preferably, for every two straight line segments, the preset condition is:
其中,β为预设角度,D为预设距离,一直线段的表达式为y=a
1x+b
1,另一直线段的表达式为y=a
2x+b
2,
分别为两条直 线段相对于x轴的旋转角度,
P
1、P
2分别为两条直线段所在直线与x轴的交点的横坐标,
Wherein, β is the preset angle, D is the preset distance, the expression of a straight line segment is y=a 1 x+b 1 , and the expression of another straight line segment is y=a 2 x+b 2 , are the rotation angles of the two straight line segments relative to the x-axis, P 1 and P 2 are respectively the abscissas of the intersection points of the two straight line segments and the x-axis,
较佳地,还包括:Preferably, it also includes:
第三合并模块,配置为将间距小于预设间距的两条直线段合并为一条直线段,作为最终车道线。The third merging module is configured to merge two straight line segments whose distance is smaller than a preset distance into one straight line segment as a final lane line.
第三方面,本申请还提供一种检测设备,包括存储器、处理器及存储在所述存储器上并可在所述处理器上运行的计算机程序;所述处理器执行所述计算机程序时实现上述任一种多车道线检测方法。In a third aspect, the present application also provides a detection device, including a memory, a processor, and a computer program stored on the memory and operable on the processor; when the processor executes the computer program, the above-mentioned Any multi-lane line detection method.
第四方面,本申请还提供一种计算机可读存储介质,其上存储有计算机程序,该计算机程序被处理器执行时实现上述任一种多车道线检测方法中的步骤。In a fourth aspect, the present application further provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the steps in any one of the above multi-lane detection methods are implemented.
本申请的上述技术方案的有益效果如下:The beneficial effects of the above-mentioned technical scheme of the present application are as follows:
本申请实施例中,通过抽取道路视频中的多帧图像进行多车道线的检测,利用多帧图像之间的互相补充、互相验证,既避免了因车辆遮挡车道线造成漏检的情况,也防止了将路面符号标识、文字标识等非车道线误检为车道线,提高了车道线检测的准确率。In the embodiment of the present application, multi-frame images in the road video are extracted to detect multi-lane lines, and the mutual complementation and mutual verification between multi-frame images is used to avoid the missed detection caused by vehicles blocking the lane lines. It prevents non-lane lines such as pavement symbol signs and text signs from being misdetected as lane lines, and improves the accuracy of lane line detection.
图1为本申请实施例一提供的一种多车道线检测方法的流程示意图;FIG. 1 is a schematic flowchart of a multi-lane detection method provided in Embodiment 1 of the present application;
图2为本申请实施例一中的图像进行二值化处理后的结果图;Fig. 2 is the result figure after the image in embodiment one of the present application is binarized;
图3为本申请实施例一中的图像进行边缘检测后的结果图;Fig. 3 is the result figure after edge detection is performed on the image in Embodiment 1 of the present application;
图4为本申请实施例二中的一种多车道线检测装置的结构示意图;FIG. 4 is a schematic structural diagram of a multi-lane detection device in Embodiment 2 of the present application;
图5为本申请实施例三中的一种检测设备的结构示意图。FIG. 5 is a schematic structural diagram of a detection device in Embodiment 3 of the present application.
为使本申请实施例的目的、技术方案和优点更加清楚,下面将结合本申请实施例的附图,对本申请实施例的技术方案进行清楚、完整地描述。显然,所描述的实施例是本申请的一部分实施例,而不是全部的实施例。基于所描述的本申请的实施例,本领域普通技术人员所获得的所有其他实施例,都属于本申请保护的范围。In order to make the purpose, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions of the embodiments of the present application will be clearly and completely described below in conjunction with the drawings of the embodiments of the present application. Apparently, the described embodiments are some of the embodiments of the present application, but not all of them. All other embodiments obtained by persons of ordinary skill in the art based on the described embodiments of the present application belong to the protection scope of the present application.
请参阅图1,图1为本申请实施例一提供的一种多车道线检测方法的流程示意图,该方法包括以下步骤:Please refer to FIG. 1. FIG. 1 is a schematic flowchart of a multi-lane detection method provided in Embodiment 1 of the present application. The method includes the following steps:
步骤11:从具有多车道线的道路的视频中抽取若干帧图像。Step 11: Extract several frames of images from the video of the road with multiple lanes.
本申请实施例中,先获取拍摄有某一道路的视频,该视频中拍摄的道路具有多车道线,然后解析获取到的视频的连续帧,从该视频中抽取若干帧图像;可选的,抽取时可以从连续帧中间隔地抽取若干帧图像,间隔的大小以及抽取的具体帧数可以根据道路和交通的具体情况进行调整。由于单帧道路图像中,道路上正在行驶的车辆通常会对车道线形成一定的遮挡,使得被遮挡的车道线的检测困难增大,同时,如果道路上有符号标志、文字标识等非车道线图形时,这些非车道线图形的线条与车道线很难通过算法进行区分,容易被误检为车道线,而由于拍摄某一道路的视频中,不同的时刻道路上的车辆数量、车辆大小、车辆位置等通常会发生变化,因此在某一帧图像中被遮挡的车道线通常可以在其他帧中显露出来,由此,本申请通过从道路视频中抽取若干帧图像,道路上的符号标志、文字标识等非车道线图形大概率存在被行驶的车辆遮挡住的情况,这样便可将非车道线筛除,从而提高检测的准确度,而对于真正的车道线而言,被遮挡的概率较小,根据在若干帧图像中出现的直线段的次数即可实现判别。采用多帧图像之间互为验证、互为补充的方法,可以使车道线检测结果更加完整、更加准确,使道路上存在的车道线都被完整地检测出来,同时不属于车道 线的干扰物可以被有效剔除。In the embodiment of the present application, a video of a certain road is captured first, and the road captured in the video has multiple lane lines, and then the continuous frames of the acquired video are analyzed, and several frames of images are extracted from the video; optionally, When extracting, several frames of images can be extracted at intervals from consecutive frames, and the size of the interval and the specific number of frames to be extracted can be adjusted according to the specific conditions of the road and traffic. In a single-frame road image, the vehicles driving on the road usually form certain occlusions to the lane lines, which makes the detection of the occluded lane lines more difficult. At the same time, if there are symbols, text signs, etc. In graphics, the lines of these non-lane lines and lane lines are difficult to be distinguished by algorithms, and are easily misdetected as lane lines. However, in the video of a certain road, the number of vehicles on the road at different times, the size of vehicles, The position of the vehicle usually changes, so the lane line that is blocked in a certain frame of image can usually be revealed in other frames. Therefore, this application extracts several frames of images from the road video, and the symbols on the road, signs, There is a high probability that non-lane line graphics such as text signs will be blocked by driving vehicles. In this way, non-lane lines can be screened out, thereby improving the accuracy of detection. For real lane lines, the probability of being blocked is relatively low. Small, the discrimination can be realized according to the number of straight line segments appearing in several frames of images. Using the method of mutual verification and complementarity between multiple frames of images can make the lane line detection results more complete and accurate, so that the lane lines existing on the road can be completely detected, and at the same time, the interference objects that do not belong to the lane line can be effectively eliminated.
步骤12:对每一帧图像进行二值化处理以及边缘检测,得到每一帧图像中的多条直线段。Step 12: Perform binarization processing and edge detection on each frame of image to obtain multiple straight line segments in each frame of image.
可选的,在抽取出若干帧图像后,为了提高检测效果,可以先对每一帧图像进行预处理。所述预处理可以包括:根据拍摄所述道路视频的摄像头的相机参数对每一帧图像进行畸变校正,以免道路上的直线线条在图像中因为畸变而呈现出非直线;所述预处理还可以包括:根据摄像头的安装位置、高度、角度等相对于所拍摄的道路的空间位置关系,通过几何计算获得每一帧图像中的道路的大致图像范围,并根据此范围设置图像感兴趣区域(region of interest,ROI),后续过程可以只对图像感兴趣区域进行处理,这样可以节省计算时间;所述预处理还可以包括:将每一帧图像通过彩色图像转灰度图像公式,转换成灰度图像,由于彩色图像和灰度图像在检测效果方面影响不大,而多通道图像变成单通道则有利于加快图像处理速度。Optionally, after extracting several frames of images, in order to improve the detection effect, each frame of images may be preprocessed first. The preprocessing may include: performing distortion correction on each frame of image according to the camera parameters of the camera that shoots the road video, so as to prevent the straight lines on the road from appearing non-linear in the image due to distortion; the preprocessing may also Including: According to the spatial position relationship of the camera's installation position, height, angle, etc. relative to the captured road, the approximate image range of the road in each frame of image is obtained through geometric calculation, and the image region of interest (region) is set according to this range. of interest, ROI), the follow-up process can only process the region of interest in the image, which can save computing time; the preprocessing can also include: converting each frame of image into grayscale through the color image to grayscale image formula Image, because the color image and grayscale image have little influence on the detection effect, and the multi-channel image becomes a single channel, which is beneficial to speed up image processing.
请参考图2,为本申请实施例一中的图像进行二值化处理后的结果图。本申请实施例中,由于车道线一般是白色或者黄色这样较浅的颜色,与深色的路面区别较大,为了进一步突出车道线,可以对每一帧图像进行二值化处理,也即二值化分割,例如:给出一个阈值,图像中灰度高于此阈值的像素即赋值255,低于或等于此阈值的像素即赋值为0。二值化分割的关键在于阈值的确定,阈值的计算有多种方法,如图像灰度均值法等等,二值化处理后的结果如图2所示。可选的,在二值化处理之后,还可以对图像进行滤波处理,以提升下一步的图像边缘检测的效果。Please refer to FIG. 2 , which is a result of binarization processing on the image in Embodiment 1 of the present application. In the embodiment of the present application, since the lane line is generally a lighter color such as white or yellow, which is quite different from the dark road surface, in order to further highlight the lane line, each frame of image can be binarized, that is, binary Value-based segmentation, for example: given a threshold, the pixels in the image whose grayscale is higher than this threshold are assigned a value of 255, and the pixels lower than or equal to this threshold are assigned a value of 0. The key of binarization segmentation lies in the determination of the threshold value. There are many ways to calculate the threshold value, such as image gray level average method, etc. The result after binarization processing is shown in Figure 2. Optionally, after the binarization processing, the image may also be filtered to improve the effect of image edge detection in the next step.
请参考图3,为本申请实施例一中的图像进行边缘检测后的结果图。本申请实施例中,在对图像进行二值化处理后,进一步对图像进行边缘检测,边缘检测后的结果如图3所示。由于边缘检测后得到的边缘依旧显示为离 散的一个个像素点,因此可以用直线拟合的方式来得到矢量的直线段,以得到每一帧图像中的多条直线段,拟合之后得到的每条直线段可以用两个端点的坐标(x
1,y
1)和(x
2,y
2)来表示,也可以根据两个端点计算得到形如y=ax+b的直线表达式。
Please refer to FIG. 3 , which is a result diagram of edge detection performed on the image in Embodiment 1 of the present application. In the embodiment of the present application, after the binarization process is performed on the image, edge detection is further performed on the image, and the result after the edge detection is shown in FIG. 3 . Since the edge obtained after edge detection is still displayed as a discrete pixel point, the straight line segment of the vector can be obtained by means of straight line fitting, so as to obtain multiple straight line segments in each frame of the image, and the obtained after fitting Each straight line segment can be represented by the coordinates (x 1 , y 1 ) and (x 2 , y 2 ) of the two endpoints, or a straight line expression in the form of y=ax+b can be obtained through calculation based on the two endpoints.
步骤13:根据每一帧图像中的多条直线段对应的位置信息对非车道线进行筛除。Step 13: Filter out non-lane lines according to the position information corresponding to multiple straight line segments in each frame of image.
由于边缘检测后拟合得到的直线段中有一部分明显不是车道线,例如,车道线与道路的走向保持一致,若直线段的走向与道路的走向的夹角超过一定值,则认为该直线段明显不是车道线,本申请实施例中可以根据每一帧图像中的多条直线段对应的位置信息对一部分明显不是车道线的直线段进行筛除。Since some of the straight line segments fitted after edge detection are obviously not lane lines, for example, the lane line is consistent with the direction of the road, if the angle between the direction of the straight line segment and the direction of the road exceeds a certain value, the straight line segment is considered It is obviously not a lane line. In the embodiment of the present application, some straight line segments that are obviously not a lane line may be screened out according to the position information corresponding to multiple straight line segments in each frame of image.
本申请实施例中,可选的,所述根据每一帧图像中的多条直线段对应的位置信息对非车道线进行筛除包括:In the embodiment of the present application, optionally, the filtering out the non-lane lines according to the position information corresponding to the multiple straight line segments in each frame image includes:
确定所述视频的拍摄方向和所述道路的走向之间所成的第一角度;determining a first angle formed between the shooting direction of the video and the direction of the road;
根据每一帧图像中的多条直线段的斜率以及所述第一角度,筛除所述多条直线段中的非车道线。According to the slopes of the multiple straight line segments in each frame of image and the first angle, the non-lane lines in the multiple straight line segments are screened out.
具体的,直线段对应的位置信息可以包括直线段在图像中的位置/坐标、直线段的斜率,通过设置一个斜率阈值,即可以筛除一部分明显不是车道线的直线段,斜率阈值的确定与拍摄所述视频的摄像头和道路之间的方位关系相关。从而,确定所述视频的拍摄方向和被拍摄的道路的走向之间所成的第一角度,根据每一直线段的斜率以及所述第一角度之间的关系,即可筛除部分直线段。Specifically, the position information corresponding to the straight line segment can include the position/coordinate of the straight line segment in the image, and the slope of the straight line segment. By setting a slope threshold, it is possible to filter out some straight line segments that are obviously not lane lines. The determination of the slope threshold is related to The orientation relationship between the camera that shoots the video and the road is related. Therefore, the first angle formed between the shooting direction of the video and the direction of the road to be shot is determined, and part of the straight line segments can be screened out according to the slope of each straight line segment and the relationship between the first angle.
可选的,所述根据每一帧图像中的多条直线段的斜率以及所述第一角度,筛除所述多条直线段中的非车道线包括:Optionally, the filtering out non-lane lines in the multiple straight line segments according to the slopes of the multiple straight line segments in each frame of image and the first angle includes:
若一直线段的斜率与所述第一角度满足:
则保留所述直线段;
If the slope of a line segment meets the first angle: then retain the straight line segment;
若一直线段的斜率与所述第一角度满足:
则筛除所述直线段;
If the slope of a line segment meets the first angle: Then filter out the straight line segment;
其中,θ为所述第一角度,α为直线段的斜率。Wherein, θ is the first angle, and α is the slope of the straight line segment.
本申请实施例中,设θ为所述视频的拍摄方向和被拍摄的道路的走向之间所成的第一角度,α为每一帧图像中拟合得到的多条直线段的斜率,则通过反正切arctan计算出直线段的角度,再通过正切值限定第一角度θ与直线段的角度关系,即可筛除一部分明显不是车道线的直线段。In the embodiment of the present application, let θ be the first angle formed between the shooting direction of the video and the direction of the road being shot, and α be the slope of multiple straight line segments fitted in each frame of image, then The angle of the straight line segment is calculated by the arc tangent arctan, and then the angular relationship between the first angle θ and the straight line segment is limited by the tangent value, so that some straight line segments that are obviously not lane lines can be screened out.
步骤14:将每一帧图像中经筛除后得到的多条直线段中位于同一直线的直线段进行第一次合并处理。Step 14: Perform the first merging process on the straight line segments located on the same straight line among the multiple straight line segments obtained after filtering in each frame of image.
对于一帧图像而言,筛除部分非车道线之后,由于道路的车道线有实线条和虚线条之分,实线车道线的边缘拟合得到的是一条完整的直线段,即一条实线车道线的边缘对应于一条直线段;而虚线车道线的每一小段都会拟合得到一条直线段,即一条虚线车道线的边缘将对应于多条直线段,实际上这些直线段均位于同一直线上,因此,在检测过程中,需要把这些实际上处于同一直线的直线段进行合并处理。For a frame of image, after filtering out some non-lane lines, since the lane lines of the road are divided into solid lines and dashed lines, the edge fitting of the solid line lane lines is a complete straight line segment, that is, a solid line The edge of a lane line corresponds to a straight line segment; while each small segment of a dashed lane line will be fitted with a straight line segment, that is, the edge of a dashed lane line will correspond to multiple straight line segments, in fact, these straight line segments are all on the same line Therefore, in the detection process, these straight line segments that are actually on the same straight line need to be merged.
可选的,所述第一次合并处理包括:Optionally, the first merging process includes:
若直线段之间的距离以及相对于一参考轴的旋转角度满足预设条件,则将满足预设条件的直线段合并为一条直线段。If the distance between the straight line segments and the rotation angle relative to a reference axis satisfy the preset condition, the straight line segments satisfying the preset condition are merged into one straight line segment.
也就是说,合并处理的依据是,对于每两条直线段,若两条直线段的旋转角度和间距都非常接近,即可以判定这两条直线段位于同一直线上,可以将这两条直线段进行合并处理。That is to say, the basis for merging is that for every two straight line segments, if the rotation angles and distances of the two straight line segments are very close, it can be determined that the two straight line segments are on the same straight line, and the two straight line segments can be combined segments are merged.
其中,针对每两条直线段,所述预设条件为:Wherein, for every two straight line segments, the preset condition is:
其中,β为预设角度,D为预设距离,一直线段的表达式为y=a
1x+b
1,另一直线段的表达式为y=a
2x+b
2,
分别为两条直线段相对于x轴的旋转角度,
P
1、P
2分别为两条直线段所在直线与x轴的交点的横坐标,
Wherein, β is the preset angle, D is the preset distance, the expression of a straight line segment is y=a 1 x+b 1 , and the expression of another straight line segment is y=a 2 x+b 2 , are the rotation angles of the two straight line segments relative to the x-axis, P 1 and P 2 are respectively the abscissas of the intersection points of the two straight line segments and the x-axis,
具体的,由于每一帧图像经筛除后得到的直线段均可以用形如y=ax+b的直线表达式进行描述,因此,对于每两条直线段而言,可以令其中一条直线段的表达式为y=a
1x+b
1,另一直线段的表达式为y=a
2x+b
2,并令
分别为两条直线段相对于x轴的旋转角度,则
其中,a
1、a
2、b
1、b
2均为常数;而令P
1、P
2分别为两条直线段所在直线与x轴的交点的横坐标,则通过令y=0,可以求得
由此,若
即两条直线段相对于x轴的旋转角度的正差值小于等于预设角度β,并且|P
1-P
2|≤D,即两条直线段所在直线与x轴的交点的横坐标的正差值小于预设距离D,即判定这两条直线段在同一条直线上,可以将这两条直线段合并为一条新的直线段。可选的,合并后的直线段的端点可以取合并前的两条直线段的端点(共四个端点)中距离最远的两个端点,不断重复上述合并处理过程,直到将虚线车道线对应的直线段中位于同一直线上的所有直线段连接起来。
Specifically, since the straight line segment obtained after filtering each frame of image can be described by a straight line expression in the form of y=ax+b, therefore, for every two straight line segments, one of the straight line segments can be set The expression of is y=a 1 x+b 1 , the expression of another line segment is y=a 2 x+b 2 , and let are the rotation angles of the two straight line segments relative to the x-axis, then Among them, a 1 , a 2 , b 1 , and b 2 are all constants; and if P 1 and P 2 are respectively the abscissas of the intersection points of the straight line where the two straight line segments are located and the x-axis, then by setting y=0, we can find have to Therefore, if That is, the positive difference between the rotation angles of the two straight line segments relative to the x-axis is less than or equal to the preset angle β, and |P 1 -P 2 |≤D, that is, the abscissa of the intersection point of the straight line where the two straight line segments are located and the x-axis If the positive difference is less than the preset distance D, it means that the two straight line segments are determined to be on the same straight line, and the two straight line segments can be merged into a new straight line segment. Optionally, the endpoints of the merged straight line segment can be the two endpoints farthest from the endpoints (four endpoints in total) of the two straight line segments before the merge, and the above-mentioned merge process is repeated until the dotted lane line corresponds to All the straight line segments lying on the same straight line are connected.
本申请实施例中,可选的,可以开辟一个vector类型的存储容器存储从每一帧图像中处理得到的直线段。In the embodiment of the present application, optionally, a vector-type storage container may be created to store the straight line segment processed from each frame of image.
步骤15:将所有帧图像中经第一次合并处理后得到的直线段进行第二 次合并处理。Step 15: Perform the second merging process on the straight line segments obtained after the first merging process in all frame images.
由前述分析可知,若拍摄所述视频的摄像头位置不发生变化,即所述视频中的道路始终为同一区域,则从所述视频中抽取的若干帧图像经上述步骤之后得到的多条直线段中必然有许多是同一车道线的边缘在多张图像上的重复,因此,需要对这些重复的直线段进行第二次合并处理。From the foregoing analysis, it can be known that if the position of the camera that shoots the video does not change, that is, the road in the video is always in the same area, then the multiple straight line segments obtained after the above steps of several frames of images extracted from the video There must be many repetitions of the edges of the same lane line on multiple images. Therefore, it is necessary to perform a second merge process on these repeated straight line segments.
所述第二次合并处理包括:The second merging process includes:
若直线段之间的距离以及相对于一参考轴的旋转角度满足预设条件,则将满足预设条件的直线段合并为一条直线段。If the distance between the straight line segments and the rotation angle relative to a reference axis satisfy the preset condition, the straight line segments satisfying the preset condition are merged into one straight line segment.
其中,针对每两条直线段,所述预设条件为:Wherein, for every two straight line segments, the preset condition is:
其中,β为预设角度,D为预设距离,一直线段的表达式为y=a
1x+b
1,另一直线段的表达式为y=a
2x+b
2,
分别为两条直线段相对于x轴的旋转角度,
P
1、P
2分别为两条直线段所在直线与x轴的交点的横坐标,
Wherein, β is the preset angle, D is the preset distance, the expression of a straight line segment is y=a 1 x+b 1 , and the expression of another straight line segment is y=a 2 x+b 2 , are the rotation angles of the two straight line segments relative to the x-axis, P 1 and P 2 are respectively the abscissas of the intersection points of the two straight line segments and the x-axis,
也就是说,所述第二次合并处理和所述第一次合并处理的原理可以相同,为避免重复,在此不再赘述。That is to say, the principles of the second merging process and the first merging process may be the same, and to avoid repetition, details are not repeated here.
步骤16:根据第二次合并处理后得到的直线段确定车道线,所述根据第二次合并处理后得到的直线段确定车道线包括:Step 16: Determining the lane line according to the straight line segment obtained after the second merging process, said determining the lane line according to the straight line segment obtained after the second merging process includes:
将第二次合并处理后得到的直线段中所合并的经第一次合并处理后得到的直线段的数量大于预设阈值的直线段确定为车道线。Among the straight line segments obtained after the second merging process, the straight line segments whose number of the combined straight line segments obtained after the first merging process is greater than a preset threshold are determined as lane lines.
本申请实施例中,由于道路上的车辆会从道路上的符号标识、文字标识上驶过,这些符号标识、文字标识对应的直线段在所有帧图像中的重复次数通常比车道线对应的直线段的重复次数要少,因此,通过统计经过第 二次合并处理后得到的直线段中每一直线段所合并的经过第一次合并处理后得到的直线段的数量,即可确定哪些直线段为车道线。例如,可以设进行第二次合并处理前的直线段(即经过第一次合并处理后得到的直线段)的集合为A,而进行第二次合并处理后的直线段的集合为B,在进行第二次合并处理的同时还统计集合B中的每一条直线段是由集合A中的多少条直线段合并而来,若集合B中的某一直线段所合并的集合A中的直线段的数量大于预设阈值,则将该直线段确定为车道线,由此,通过设置预设阈值,可以筛除道路上的符号标识、文字标识所对应的直线段,从而提高检测的准确度。具体实施时,预设阈值的数值可以根据具体的道路情况进行调整。In the embodiment of the present application, since the vehicles on the road will pass by the symbols and characters on the road, the number of repetitions of the straight line segments corresponding to these symbols and characters in all frame images is usually higher than that of the straight line corresponding to the lane line. Therefore, by counting the number of straight line segments obtained after the first merge process combined by each straight line segment obtained after the second merge process, it can be determined which straight line segments are lane line. For example, the set of straight line segments before the second merging process (that is, the straight line segments obtained after the first merging process) can be set as A, and the set of straight line segments after the second merging process is B. While performing the second merging process, it is also counted how many straight line segments in set A each straight line segment in set B is merged from. If the number is greater than the preset threshold value, the straight line segment is determined as the lane line. Therefore, by setting the preset threshold value, the straight line segment corresponding to the symbol mark and text mark on the road can be screened out, thereby improving the accuracy of detection. During specific implementation, the value of the preset threshold can be adjusted according to specific road conditions.
本申请的一些实施例中,所述根据第二次合并处理后得到的直线段确定车道线的步骤之后,还包括:In some embodiments of the present application, after the step of determining the lane line according to the straight line segment obtained after the second merging process, it further includes:
将间距小于预设间距的两条直线段合并为一条直线段,作为最终车道线。Merge two straight line segments whose distance is smaller than the preset distance into one straight line segment as the final lane line.
具体来说,由于道路上的车道线具有一定的宽度,因此道路上的一条车道线在图像中将检测到两条直线段,即车道线的长度方向两侧边缘对应的直线段,而检测车道线的目标是为了给只能驾驶、交通监测、交通调度等提供准确的额车道分隔信息,因此车道线的检测结果中每条实际的车道线只以一条直线段进行标识会更加方便,因此,确定为车道线的直线段中,若两条直线段对应于同一条车道线的两侧边缘,则可以把这两条直线段合并为一条线。可选的,可以根据道路上的车道的实际宽度和/或车道线的实际宽度,对直线段进行合并。例如,将间距小于预设间距的两条直线段合并为一条直线段作为最终车道线,可选的,最终车道线取中间值,即该两条直线段之间的等距线。具体的,可以把确定为车道线的直线段根据其延长线与x轴的交点的位置从左到右进行排序,然后对排好序的直线段进行聚类分析,即根据两条直线段与x轴的交点的间距做聚类分析,若间距小 于预设间距,则判断两条直线段属于同一条车道线的两侧边缘,此时可以把这两条直线段进行合并为一条,而若间距大于预设间距,则判断两条直线段不属于同一条车道线的两侧边缘。Specifically, since the lane line on the road has a certain width, a lane line on the road will detect two straight line segments in the image, that is, the straight line segments corresponding to the edges on both sides of the length direction of the lane line, and the detected lane line The goal of the line is to provide accurate lane separation information for driving, traffic monitoring, traffic scheduling, etc. Therefore, it is more convenient for each actual lane line to be marked with a straight line segment in the detection results of the lane line. Therefore, Among the straight line segments determined as lane lines, if two straight line segments correspond to both side edges of the same lane line, the two straight line segments may be merged into one line. Optionally, straight line segments may be merged according to the actual width of the lanes on the road and/or the actual width of the lane lines. For example, two straight line segments whose distance is smaller than the preset distance are merged into one straight line segment as the final lane line. Optionally, the final lane line takes an intermediate value, that is, an equidistant line between the two straight line segments. Specifically, the straight line segments determined as lane lines can be sorted from left to right according to the intersection of their extension lines and the x-axis, and then cluster analysis is performed on the sorted straight line segments, that is, according to the relationship between the two straight line segments and The distance between the intersection points of the x-axis is used for cluster analysis. If the distance is less than the preset distance, it is judged that the two straight line segments belong to the two side edges of the same lane line. At this time, the two straight line segments can be merged into one, and if If the spacing is greater than the preset spacing, it is judged that the two straight line segments do not belong to the edges on both sides of the same lane line.
最后,把经上述处理后最终得到的直线段进行输出,作为最终的检测结果。Finally, the straight line segment finally obtained after the above processing is output as the final detection result.
由此,本申请实施例中,通过抽取道路视频中的多帧图像进行多车道线的检测,利用多帧图像之间的互相补充、互相验证,既避免了因车辆遮挡车道线造成漏检的情况,也防止了将路面符号标识、文字标识等非车道线误检为车道线,提高了车道线检测的准确率。Therefore, in the embodiment of the present application, multi-frame images in the road video are extracted to detect multi-lane lines, and the mutual complementation and mutual verification between multi-frame images is used to avoid missed detection caused by vehicles blocking lane lines. It also prevents non-lane lines such as road surface symbols and text signs from being misdetected as lane lines, and improves the accuracy of lane line detection.
请参阅图4,图4是本申请实施例二提供的一种多车道线检测装置的结构示意图,该检测装置40包括:Please refer to FIG. 4. FIG. 4 is a schematic structural diagram of a multi-lane detection device provided in Embodiment 2 of the present application. The detection device 40 includes:
抽取模块41,配置为从具有多车道线的道路的视频中抽取若干帧图像;The extraction module 41 is configured to extract several frames of images from the video of the road with multi-lane lines;
处理模块42,配置为对每一帧图像进行二值化处理以及边缘检测,得到每一帧图像中的多条直线段;The processing module 42 is configured to perform binarization processing and edge detection on each frame of image to obtain a plurality of straight line segments in each frame of image;
筛除模块43,配置为根据每一帧图像中的多条直线段对应的位置信息对非车道线进行筛除;The filtering module 43 is configured to filter out non-lane lines according to the position information corresponding to a plurality of straight line segments in each frame of image;
第一合并模块44,配置为将每一帧图像中经筛除后得到的多条直线段中位于同一直线的直线段进行第一次合并处理;The first merging module 44 is configured to perform the first merging process on the straight line segments located on the same straight line among the multiple straight line segments obtained after screening in each frame of image;
第二合并模块45,配置为将所有帧图像中经第一次合并处理后得到的直线段进行第二次合并处理;The second merging module 45 is configured to perform a second merging process on the straight line segments obtained after the first merging process in all frame images;
确定模块46,配置为根据第二次合并处理后得到的直线段确定车道线;The determination module 46 is configured to determine the lane line according to the straight line segment obtained after the second merging process;
所述确定模块包括:The determination module includes:
确定单元,配置为将第二次合并处理后得到的直线段中所合并的经第一次合并处理后得到的直线段的数量大于预设阈值的直线段确定为车道线。The determination unit is configured to determine, among the straight line segments obtained after the second merging process, the number of the combined straight line segments obtained after the first merging process is greater than a preset threshold value as the lane line.
较佳地,所述筛除模块包括:Preferably, the screening module includes:
角度单元,配置为确定所述视频的拍摄方向和所述道路的走向之间所成的第一角度;an angle unit configured to determine a first angle formed between the shooting direction of the video and the direction of the road;
筛除单元,配置为根据每一帧图像中的多条直线段的斜率以及所述第一角度,筛除所述多条直线段中的非车道线。The filtering unit is configured to filter out non-lane lines in the multiple straight line segments in each frame of image according to the slopes of the multiple straight line segments and the first angle.
较佳地,所述筛除单元包括:Preferably, the screening unit includes:
第一子单元,配置为若一直线段的斜率与所述第一角度满足:
则保留所述直线段;
The first subunit is configured such that if the slope of a line segment meets the first angle: then retain the straight line segment;
第二子单元,配置为若一直线段的斜率与所述第一角度满足:
则筛除所述直线段;
The second subunit is configured such that if the slope of a line segment meets the first angle: Then filter out the straight line segment;
其中,θ为所述第一角度,α为直线段的斜率。Wherein, θ is the first angle, and α is the slope of the straight line segment.
较佳地,所述第一次合并处理和/或所述第二次合并处理包括:Preferably, the first merging process and/or the second merging process includes:
若直线段之间的距离以及相对于一参考轴的旋转角度满足预设条件,则将满足预设条件的直线段合并为一条直线段。If the distance between the straight line segments and the rotation angle relative to a reference axis satisfy the preset condition, the straight line segments satisfying the preset condition are merged into one straight line segment.
较佳地,针对每两条直线段,所述预设条件为:Preferably, for every two straight line segments, the preset condition is:
其中,β为预设角度,D为预设距离,一直线段的表达式为y=a
1x+b
1,另一直线段的表达式为y=a
2x+b
2,
分别为两条直线段相对于x轴的旋转角度,
P
1、P
2分别为两条直线段所在直线与x轴的交点的横坐标,
Wherein, β is the preset angle, D is the preset distance, the expression of a straight line segment is y=a 1 x+b 1 , and the expression of another straight line segment is y=a 2 x+b 2 , are the rotation angles of the two straight line segments relative to the x-axis, P 1 and P 2 are respectively the abscissas of the intersection points of the two straight line segments and the x-axis,
较佳地,还包括:Preferably, it also includes:
第三合并模块,配置为将间距小于预设间距的两条直线段合并为一条 直线段,作为最终车道线。The third merging module is configured to merge the two straight line segments whose distance is smaller than the preset distance into one straight line segment as the final lane line.
本申请实施例是与上述方法实施例一对应的产品实施例,故在此不再赘述,详细请参阅上述实施例一。The embodiment of the present application is a product embodiment corresponding to the above-mentioned method embodiment one, so details are not repeated here, please refer to the above-mentioned embodiment one for details.
请参阅图5,图5是本申请实施例三提供的一种检测设备的结构示意图,该检测设备50包括处理器51、存储器52及存储在所述存储器52上并可在所述处理器51上运行的计算机程序;所述处理器51执行所述计算机程序时实现如下步骤:Please refer to FIG. 5. FIG. 5 is a schematic structural diagram of a detection device provided in Embodiment 3 of the present application. The detection device 50 includes a processor 51, a memory 52 and a The computer program that runs on; When described processor 51 executes described computer program, realize following steps:
从具有多车道线的道路的视频中抽取若干帧图像;Extract several frames of images from a video of a road with multiple lanes;
对每一帧图像进行二值化处理以及边缘检测,得到每一帧图像中的多条直线段;Perform binarization processing and edge detection on each frame of image to obtain multiple straight line segments in each frame of image;
根据每一帧图像中的多条直线段对应的位置信息对非车道线进行筛除;Filter out non-lane lines according to the position information corresponding to multiple straight line segments in each frame of image;
将每一帧图像中经筛除后得到的多条直线段中位于同一直线的直线段进行第一次合并处理;Performing the first merging process on the straight line segments located on the same straight line among the multiple straight line segments obtained after screening in each frame of image;
将所有帧图像中经第一次合并处理后得到的直线段进行第二次合并处理;Perform a second merge process on the straight line segments obtained after the first merge process in all frame images;
根据第二次合并处理后得到的直线段确定车道线;Determine the lane line according to the straight line segment obtained after the second merging process;
所述根据第二次合并处理后得到的直线段确定车道线包括:Determining the lane line according to the straight line segment obtained after the second merging process includes:
将第二次合并处理后得到的直线段中所合并的经第一次合并处理后得到的直线段的数量大于预设阈值的直线段确定为车道线。Among the straight line segments obtained after the second merging process, the straight line segments whose number of the combined straight line segments obtained after the first merging process is greater than a preset threshold are determined as lane lines.
本申请实施例中,所述处理器51执行所述计算机程序时还可实现如下步骤:In the embodiment of the present application, when the processor 51 executes the computer program, the following steps may also be implemented:
所述根据每一帧图像中的多条直线段对应的位置信息对非车道线进行筛除包括:Said filtering non-lane lines according to the position information corresponding to a plurality of straight line segments in each frame image includes:
确定所述视频的拍摄方向和所述道路的走向之间所成的第一角度;determining a first angle formed between the shooting direction of the video and the direction of the road;
根据每一帧图像中的多条直线段的斜率以及所述第一角度,筛除所述多条直线段中的非车道线。According to the slopes of the multiple straight line segments in each frame of image and the first angle, the non-lane lines in the multiple straight line segments are screened out.
较佳地,所述根据每一帧图像中的多条直线段的斜率以及所述第一角度,筛除所述多条直线段中的非车道线包括:Preferably, the filtering out non-lane lines in the multiple straight line segments according to the slopes of the multiple straight line segments in each frame of image and the first angle includes:
若一直线段的斜率与所述第一角度满足:
则保留所述直线段;
If the slope of a line segment meets the first angle: then retain the straight line segment;
若一直线段的斜率与所述第一角度满足:
则筛除所述直线段;
If the slope of a line segment meets the first angle: Then filter out the straight line segment;
其中,θ为所述第一角度,α为直线段的斜率。Wherein, θ is the first angle, and α is the slope of the straight line segment.
较佳地,所述第一次合并处理和/或所述第二次合并处理包括:Preferably, the first merging process and/or the second merging process includes:
若直线段之间的距离以及相对于一参考轴的旋转角度满足预设条件,则将满足预设条件的直线段合并为一条直线段。If the distance between the straight line segments and the rotation angle relative to a reference axis satisfy the preset condition, the straight line segments satisfying the preset condition are merged into one straight line segment.
较佳地,针对每两条直线段,所述预设条件为:Preferably, for every two straight line segments, the preset condition is:
其中,β为预设角度,D为预设距离,一直线段的表达式为y=a
1x+b
1,另一直线段的表达式为y=a
2x+b
2,
分别为两条直线段相对于x轴的旋转角度,
P
1、P
2分别为两条直线段所在直线与x轴的交点的横坐标,
Wherein, β is the preset angle, D is the preset distance, the expression of a straight line segment is y=a 1 x+b 1 , and the expression of another straight line segment is y=a 2 x+b 2 , are the rotation angles of the two straight line segments relative to the x-axis, P 1 and P 2 are respectively the abscissas of the intersection points of the two straight line segments and the x-axis,
较佳地,所述根据第二次合并处理后得到的直线段确定车道线的步骤之后,还包括:Preferably, after the step of determining the lane line according to the straight line segment obtained after the second merging process, it further includes:
将间距小于预设间距的两条直线段合并为一条直线段,作为最终车道线。Merge two straight line segments whose distance is smaller than the preset distance into one straight line segment as the final lane line.
本申请实施例的具体工作过程与上述方法实施例一中的一致,故在此不再赘述,详细请参阅上述实施例一中方法步骤的说明。The specific working process of the embodiment of the present application is consistent with that in the first method embodiment above, so it will not be repeated here. For details, please refer to the description of the method steps in the first embodiment above.
本申请实施例四提供一种计算机可读存储介质,其上存储有计算机程序,该计算机程序被处理器执行时实现上述实施例一中多车道线检测方法中的步骤。详细请参阅以上对应实施例中方法步骤的说明。Embodiment 4 of the present application provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps in the method for detecting multi-lane markings in Embodiment 1 above are implemented. For details, please refer to the description of the method steps in the above corresponding embodiments.
上述计算机可读存储介质包括永久性和非永久性、可移动和非可移动媒体可以由任何方法或技术来实现信息存储。信息可以是计算机可读指令、数据结构、程序的模块或其他数据。计算机的存储介质的例子包括,但不限于相变内存(PRAM)、静态随机存取存储器(SRAM)、动态随机存取存储器(DRAM)、其他类型的随机存取存储器(RAM)、只读存储器(ROM)、电可擦除可编程只读存储器(EEPROM)、快闪记忆体或其他内存技术、只读光盘只读存储器(CD-ROM)、数字多功能光盘(DVD)或其他光学存储、磁盒式磁带,磁带磁磁盘存储或其他磁性存储设备或任何其他非传输介质,可用于存储可以被计算设备访问的信息。The above-mentioned computer-readable storage media include permanent and non-permanent, removable and non-removable media, and information storage may be realized by any method or technology. Information may be computer readable instructions, data structures, modules of a program, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read only memory (ROM), Electrically Erasable Programmable Read-Only Memory (EEPROM), Flash memory or other memory technology, Compact Disc Read-Only Memory (CD-ROM), Digital Versatile Disc (DVD) or other optical storage, Magnetic tape cartridge, tape magnetic disk storage or other magnetic storage device or any other non-transmission medium that can be used to store information that can be accessed by a computing device.
需要说明的是:“第一”、“第二”等是用于区别类似的对象,而不必用于描述特定的顺序或先后次序。It should be noted that: "first", "second", etc. are used to distinguish similar objects, and not necessarily used to describe a specific order or sequence.
另外,本申请实施例所记载的技术方案之间,在不冲突的情况下,可以任意组合。In addition, the technical solutions described in the embodiments of the present application may be combined arbitrarily if there is no conflict.
以上所述,仅为本发明的具体实施方式,但本发明的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本发明揭露的技术范围内,可轻易想到变化或替换,都应涵盖在本发明的保护范围之内。因此,本发明的保护范围应以所述权利要求的保护范围为准。The above is only a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Anyone skilled in the art can easily think of changes or substitutions within the technical scope disclosed in the present invention. Should be covered within the protection scope of the present invention. Therefore, the protection scope of the present invention should be determined by the protection scope of the claims.
Claims (14)
- 一种多车道线检测方法,包括:A multi-lane line detection method, comprising:从具有多车道线的道路的视频中抽取若干帧图像;Extract several frames of images from a video of a road with multiple lanes;对每一帧图像进行二值化处理以及边缘检测,得到每一帧图像中的多条直线段;Perform binarization processing and edge detection on each frame of image to obtain multiple straight line segments in each frame of image;根据每一帧图像中的多条直线段对应的位置信息对非车道线进行筛除;Filter out non-lane lines according to the position information corresponding to multiple straight line segments in each frame of image;将每一帧图像中经筛除后得到的多条直线段中位于同一直线的直线段进行第一次合并处理;Performing the first merging process on the straight line segments located on the same straight line among the multiple straight line segments obtained after screening in each frame of image;将所有帧图像中经第一次合并处理后得到的直线段进行第二次合并处理;Perform a second merge process on the straight line segments obtained after the first merge process in all frame images;根据第二次合并处理后得到的直线段确定车道线;Determine the lane line according to the straight line segment obtained after the second merging process;所述根据第二次合并处理后得到的直线段确定车道线包括:Determining the lane line according to the straight line segment obtained after the second merging process includes:将第二次合并处理后得到的直线段中所合并的经第一次合并处理后得到的直线段的数量大于预设阈值的直线段确定为车道线。Among the straight line segments obtained after the second merging process, the straight line segments whose number of the combined straight line segments obtained after the first merging process is greater than a preset threshold are determined as lane lines.
- 根据权利要求1所述的多车道线检测方法,其中,所述根据每一帧图像中的多条直线段对应的位置信息对非车道线进行筛除包括:The method for detecting multi-lane lines according to claim 1, wherein said filtering out non-lane lines according to position information corresponding to a plurality of straight line segments in each frame image comprises:确定所述视频的拍摄方向和所述道路的走向之间所成的第一角度;determining a first angle formed between the shooting direction of the video and the direction of the road;根据每一帧图像中的多条直线段的斜率以及所述第一角度,筛除所述多条直线段中的非车道线。According to the slopes of the multiple straight line segments in each frame of image and the first angle, the non-lane lines in the multiple straight line segments are screened out.
- 根据权利要求2所述的多车道线检测方法,其中,所述根据每一帧图像中的多条直线段的斜率以及所述第一角度,筛除所述多条直线段中的非车道线包括:The method for detecting multi-lane lines according to claim 2, wherein, according to the slopes of the multiple straight line segments in each frame image and the first angle, the non-lane lines in the multiple straight line segments are screened out include:若一直线段的斜率与所述第一角度满足: 则保留所述直线段; If the slope of a line segment meets the first angle: then retain the straight line segment;若一直线段的斜率与所述第一角度满足: 则筛除所述直线段; If the slope of a line segment meets the first angle: Then filter out the straight line segment;其中,θ为所述第一角度,α为直线段的斜率。Wherein, θ is the first angle, and α is the slope of the straight line segment.
- 根据权利要求1所述的多车道线检测方法,其中,所述第一次合并处理和/或所述第二次合并处理包括:The multi-lane line detection method according to claim 1, wherein the first merging process and/or the second merging process comprises:若直线段之间的距离以及相对于一参考轴的旋转角度满足预设条件,则将满足预设条件的直线段合并为一条直线段。If the distance between the straight line segments and the rotation angle relative to a reference axis satisfy the preset condition, the straight line segments satisfying the preset condition are merged into one straight line segment.
- 根据权利要求4所述的多车道线检测方法,其中,针对每两条直线段,所述预设条件为:The multi-lane line detection method according to claim 4, wherein, for every two straight line segments, the preset condition is:@R 一 尺@三D; @R Yichi @三D;其中,β为预设角度,D为预设距离,一直线段的表达式为y=a 1x+b 1,另一直线段的表达式为y=a 2x+b 2, 分别为两条直线段相对于x轴的旋转角度, P 1、P 2分别为两条直线段所在直线与x轴的交点的横坐标, Wherein, β is the preset angle, D is the preset distance, the expression of a straight line segment is y=a 1 x+b 1 , and the expression of another straight line segment is y=a 2 x+b 2 , are the rotation angles of the two straight line segments relative to the x-axis, P 1 and P 2 are respectively the abscissas of the intersection points of the two straight line segments and the x-axis,
- 根据权利要求1所述的多车道线检测方法,其中,所述根据第二次合并处理后得到的直线段确定车道线的步骤之后,还包括:The multi-lane line detection method according to claim 1, wherein, after the step of determining the lane line according to the straight line segment obtained after the second merging process, further comprising:将间距小于预设间距的两条直线段合并为一条直线段,作为最终车道线。Merge two straight line segments whose distance is smaller than the preset distance into one straight line segment as the final lane line.
- 一种多车道线检测装置,包括:A multi-lane detection device, comprising:抽取模块,配置为从具有多车道线的道路的视频中抽取若干帧图像;The extraction module is configured to extract several frame images from the video of the road with multi-lane lines;处理模块,配置为对每一帧图像进行二值化处理以及边缘检测,得到每一帧图像中的多条直线段;A processing module configured to perform binarization processing and edge detection on each frame of image to obtain a plurality of straight line segments in each frame of image;筛除模块,配置为根据每一帧图像中的多条直线段对应的位置信息对非车道线进行筛除;The filtering module is configured to filter out non-lane lines according to the position information corresponding to a plurality of straight line segments in each frame of image;第一合并模块,配置为将每一帧图像中经筛除后得到的多条直线段中位于同一直线的直线段进行第一次合并处理;The first merging module is configured to perform the first merging process on the straight line segments located on the same straight line among the multiple straight line segments obtained after screening in each frame of image;第二合并模块,配置为将所有帧图像中经第一次合并处理后得到的直线段进行第二次合并处理;The second merging module is configured to perform a second merging process on the straight line segments obtained after the first merging process in all frame images;确定模块,配置为根据第二次合并处理后得到的直线段确定车道线;The determination module is configured to determine the lane line according to the straight line segment obtained after the second merging process;所述确定模块包括:The determination module includes:确定单元,配置为将第二次合并处理后得到的直线段中所合并的经第一次合并处理后得到的直线段的数量大于预设阈值的直线段确定为车道线。The determination unit is configured to determine, among the straight line segments obtained after the second merging process, the number of the combined straight line segments obtained after the first merging process is greater than a preset threshold value as the lane line.
- 根据权利要求7所述的多车道线检测装置,其中,所述筛除模块包括:The multi-lane detection device according to claim 7, wherein the screening module comprises:角度单元,配置为确定所述视频的拍摄方向和所述道路的走向之间所成的第一角度;an angle unit configured to determine a first angle formed between the shooting direction of the video and the direction of the road;筛除单元,配置为根据每一帧图像中的多条直线段的斜率以及所述第一角度,筛除所述多条直线段中的非车道线。The filtering unit is configured to filter out non-lane lines in the multiple straight line segments in each frame of image according to the slopes of the multiple straight line segments and the first angle.
- 根据权利要求8所述的多车道线检测装置,其中,所述筛除单元包括:The multi-lane detection device according to claim 8, wherein the screening unit comprises:第一子单元,配置为若一直线段的斜率与所述第一角度满足: 则保留所述直线段; The first subunit is configured such that if the slope of a line segment meets the first angle: then retain the straight line segment;第二子单元,配置为若一直线段的斜率与所述第一角度满足: 则筛除所述直线段; The second subunit is configured such that if the slope of a line segment meets the first angle: Then filter out the straight line segment;其中,θ为所述第一角度,α为直线段的斜率。Wherein, θ is the first angle, and α is the slope of the straight line segment.
- 根据权利要求7所述的多车道线检测装置,其中,所述第一次合并处理和/或所述第二次合并处理包括:The multi-lane line detection device according to claim 7, wherein the first merging process and/or the second merging process comprises:若直线段之间的距离以及相对于一参考轴的旋转角度满足预设条件,则将满足预设条件的直线段合并为一条直线段。If the distance between the straight line segments and the rotation angle relative to a reference axis satisfy the preset condition, the straight line segments satisfying the preset condition are merged into one straight line segment.
- 根据权利要求10所述的多车道线检测装置,其中,针对每两条直线段,所述预设条件为:The multi-lane line detection device according to claim 10, wherein, for every two straight line segments, the preset condition is:|P 1-P 2|≤D; |P 1 -P 2 |≤D;其中,β为预设角度,D为预设距离,一直线段的表达式为y=a 1x+b 1,另一直线段的表达式为y=a 2x+b 2, 分别为两条直线段相对于x轴的旋转角度, P 1、P 2分别为两条直线段所在直线与x轴的交点的横坐标, Wherein, β is the preset angle, D is the preset distance, the expression of a straight line segment is y=a 1 x+b 1 , and the expression of another straight line segment is y=a 2 x+b 2 , are the rotation angles of the two straight line segments relative to the x-axis, P 1 and P 2 are respectively the abscissas of the intersection points of the two straight line segments and the x-axis,
- 根据权利要求7所述的多车道线检测装置,其中,还包括:The multi-lane detection device according to claim 7, further comprising:第三合并模块,配置为将间距小于预设间距的两条直线段合并为一条直线段,作为最终车道线。The third merging module is configured to merge two straight line segments whose distance is smaller than a preset distance into one straight line segment as a final lane line.
- 一种检测设备,包括存储器、处理器及存储在所述存储器上并可在所述处理器上运行的计算机程序;所述处理器执行所述计算机程序时实现如权利要求1至6中任一项所述的多车道线检测方法。A detection device, comprising a memory, a processor, and a computer program stored on the memory and operable on the processor; when the processor executes the computer program, any one of claims 1 to 6 is realized. The multi-lane line detection method described in the item.
- 一种计算机可读存储介质,其上存储有计算机程序,该计算机程序被处理器执行时实现如权利要求1至6中任一项所述的多车道线检测方法中的步骤。A computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the steps in the multi-lane line detection method according to any one of claims 1 to 6 are realized.
Applications Claiming Priority (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110770354.4 | 2021-07-08 | ||
CN202110770354.4A CN113221861B (en) | 2021-07-08 | 2021-07-08 | Multi-lane line detection method, device and detection equipment |
Publications (1)
Publication Number | Publication Date |
---|---|
WO2023279966A1 true WO2023279966A1 (en) | 2023-01-12 |
Family
ID=77081151
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
PCT/CN2022/100542 WO2023279966A1 (en) | 2021-07-08 | 2022-06-22 | Multi-lane-line detection method and apparatus, and detection device |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN113221861B (en) |
WO (1) | WO2023279966A1 (en) |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN116599699A (en) * | 2023-04-19 | 2023-08-15 | 泉州年盛信息科技有限公司 | Industrial Internet platform data safety protection system based on cloud computing |
CN116912273A (en) * | 2023-09-13 | 2023-10-20 | 国网山东省电力公司莱芜供电公司 | Three-dimensional GIS-based transmission line crossing construction scheme visualization method |
CN117237240A (en) * | 2023-11-15 | 2023-12-15 | 湖南蚁为软件有限公司 | Data intelligent acquisition method and system based on data characteristics |
Families Citing this family (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113221861B (en) * | 2021-07-08 | 2021-11-09 | 中移(上海)信息通信科技有限公司 | Multi-lane line detection method, device and detection equipment |
CN117611752B (en) * | 2024-01-22 | 2024-04-02 | 卓世未来(成都)科技有限公司 | Method and system for generating 3D model of digital person |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN107229908A (en) * | 2017-05-16 | 2017-10-03 | 浙江理工大学 | A kind of method for detecting lane lines |
CN111291603A (en) * | 2018-12-07 | 2020-06-16 | 长沙智能驾驶研究院有限公司 | Lane line detection method, device, system and storage medium |
CN112507852A (en) * | 2020-12-02 | 2021-03-16 | 上海眼控科技股份有限公司 | Lane line identification method, device, equipment and storage medium |
CN112597846A (en) * | 2020-12-14 | 2021-04-02 | 合肥英睿系统技术有限公司 | Lane line detection method, lane line detection device, computer device, and storage medium |
CN113221861A (en) * | 2021-07-08 | 2021-08-06 | 中移(上海)信息通信科技有限公司 | Multi-lane line detection method, device and detection equipment |
Family Cites Families (11)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102663403B (en) * | 2012-04-26 | 2014-04-16 | 北京工业大学 | System and method used for extracting lane information in express way intelligent vehicle-navigation and based on vision |
CN102722705B (en) * | 2012-06-12 | 2014-04-30 | 武汉大学 | Method for detecting multi-lane line on basis of random sample consensus (RANSAC) algorithm |
CN103295420B (en) * | 2013-01-30 | 2015-12-02 | 吉林大学 | A kind of method of Lane detection |
CN104392212B (en) * | 2014-11-14 | 2017-09-01 | 北京工业大学 | The road information detection and front vehicles recognition methods of a kind of view-based access control model |
CN104537342B (en) * | 2014-12-24 | 2017-08-11 | 福州大学 | A kind of express lane line detecting method of combination ridge border detection and Hough transformation |
CN105426864B (en) * | 2015-12-04 | 2018-09-04 | 华中科技大学 | One kind being based on the matched Multi-lane Lines Detection method of equidistant marginal point |
CN105740836B (en) * | 2016-02-03 | 2019-04-26 | 安徽清新互联信息科技有限公司 | A kind of illegal detection method for occupying Emergency Vehicle Lane |
CN105868696B (en) * | 2016-03-23 | 2019-06-14 | 奇瑞汽车股份有限公司 | A kind of method and apparatus detecting multilane lane line |
CN106529493B (en) * | 2016-11-22 | 2019-12-20 | 北京联合大学 | Robust multi-lane line detection method based on perspective view |
CN107563331B (en) * | 2017-09-04 | 2020-02-14 | 中国地质大学(武汉) | Road sign line detection method and system based on geometric relationship |
CN111439259B (en) * | 2020-03-23 | 2020-11-27 | 成都睿芯行科技有限公司 | Agricultural garden scene lane deviation early warning control method and system based on end-to-end convolutional neural network |
-
2021
- 2021-07-08 CN CN202110770354.4A patent/CN113221861B/en active Active
-
2022
- 2022-06-22 WO PCT/CN2022/100542 patent/WO2023279966A1/en unknown
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN107229908A (en) * | 2017-05-16 | 2017-10-03 | 浙江理工大学 | A kind of method for detecting lane lines |
CN111291603A (en) * | 2018-12-07 | 2020-06-16 | 长沙智能驾驶研究院有限公司 | Lane line detection method, device, system and storage medium |
CN112507852A (en) * | 2020-12-02 | 2021-03-16 | 上海眼控科技股份有限公司 | Lane line identification method, device, equipment and storage medium |
CN112597846A (en) * | 2020-12-14 | 2021-04-02 | 合肥英睿系统技术有限公司 | Lane line detection method, lane line detection device, computer device, and storage medium |
CN113221861A (en) * | 2021-07-08 | 2021-08-06 | 中移(上海)信息通信科技有限公司 | Multi-lane line detection method, device and detection equipment |
Cited By (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN116599699A (en) * | 2023-04-19 | 2023-08-15 | 泉州年盛信息科技有限公司 | Industrial Internet platform data safety protection system based on cloud computing |
CN116912273A (en) * | 2023-09-13 | 2023-10-20 | 国网山东省电力公司莱芜供电公司 | Three-dimensional GIS-based transmission line crossing construction scheme visualization method |
CN116912273B (en) * | 2023-09-13 | 2023-12-12 | 国网山东省电力公司莱芜供电公司 | Three-dimensional GIS-based transmission line crossing construction scheme visualization method |
CN117237240A (en) * | 2023-11-15 | 2023-12-15 | 湖南蚁为软件有限公司 | Data intelligent acquisition method and system based on data characteristics |
CN117237240B (en) * | 2023-11-15 | 2024-02-02 | 湖南蚁为软件有限公司 | Data intelligent acquisition method and system based on data characteristics |
Also Published As
Publication number | Publication date |
---|---|
CN113221861A (en) | 2021-08-06 |
CN113221861B (en) | 2021-11-09 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
WO2023279966A1 (en) | Multi-lane-line detection method and apparatus, and detection device | |
CN108647572B (en) | Lane departure early warning method based on Hough transform | |
CN103324930B (en) | A kind of registration number character dividing method based on grey level histogram binaryzation | |
US8184859B2 (en) | Road marking recognition apparatus and method | |
dos Santos et al. | Text line segmentation based on morphology and histogram projection | |
CN111382704B (en) | Vehicle line pressing violation judging method and device based on deep learning and storage medium | |
CN108038481A (en) | A kind of combination maximum extreme value stability region and the text positioning method of stroke width change | |
CN103530600A (en) | License plate recognition method and system under complicated illumination | |
CN109886168B (en) | Ground traffic sign identification method based on hierarchy | |
CN110598566A (en) | Image processing method, device, terminal and computer readable storage medium | |
EP2813973A1 (en) | Method and system for processing video image | |
CN110689003A (en) | Low-illumination imaging license plate recognition method and system, computer equipment and storage medium | |
CN112927283A (en) | Distance measuring method and device, storage medium and electronic equipment | |
CN111369570A (en) | Multi-target detection tracking method for video image | |
CN111310576B (en) | Channel target passing detection method, device and equipment | |
Chen et al. | A novel lane departure warning system for improving road safety | |
CN107977608B (en) | Method for extracting road area of highway video image | |
CN107506739B (en) | Night forward vehicle detection and distance measurement method | |
CN107066929B (en) | Hierarchical recognition method for parking events of expressway tunnel integrating multiple characteristics | |
CN111241911B (en) | Self-adaptive lane line detection method | |
CN107704864B (en) | Salient object detection method based on image object semantic detection | |
CN110569801B (en) | Identification method for key content of driving license | |
CN108009480A (en) | A kind of image human body behavioral value method of feature based identification | |
Lu | A lane detection, tracking and recognition system for smart vehicles | |
CN110059695B (en) | Character segmentation method based on vertical projection and terminal |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
NENP | Non-entry into the national phase |
Ref country code: DE |