Lane matching method, device and computer readable storage medium

By merging lane lines and establishing a global grid, the problem of low accuracy in vehicle-lane association is solved, and the reliability and correlation of lane trajectory are improved.

CN119169567BActive Publication Date: 2025-03-04ZHEJIANG GEELY HLDG GRP CO LTD +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411680458.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-11-22
Publication Date
2025-03-04
Estimated Expiration
2044-11-22

AI Technical Summary

Technical Problem

In intelligent driving technology, the correlation accuracy between vehicles and lanes is low, mainly due to the jitter of lane line detection results and the reduction of perceived accuracy, which affects the accuracy and correlation of lane line.

Method used

By combining the lane lines with associated relationships, the global lane lines are obtained, and a global grid is established based on the global trajectory point coordinates of the global lane lines, the global lane number is marked, and the target grid of the traffic vehicle is determined to achieve the correlation between the vehicle and the lane.

Benefits of technology

The number of lane trajectory points is reduced, the jitter problem between lane lines is reduced, the reliability of lane trajectory is improved, and the correlation accuracy between vehicles and lanes is significantly improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119169567B_ABST
    Figure CN119169567B_ABST
Patent Text Reader

Abstract

The present application discloses a lane matching method, device and computer-readable storage medium, the method comprising: based on the association relationship corresponding to each lane line, merging the lane lines to obtain the global lane line; establishing a first global grid based on the global trajectory point coordinates, and marking the global lane number in each grid of the first global grid; determining the target grid corresponding to each traffic vehicle in the first global grid; if there is a first target grid in the target grid, determining the second target grid in the first global grid based on the preset number of grids and the first target grid; determining the first target lane number of the first traffic vehicle based on the second target grid. The present application obtains the target lane number corresponding to each traffic vehicle according to the vehicle coordinates and the first global grid, establishes a binding relationship between the traffic vehicle and the lane, reduces the jitter problem between consecutive different frames, and improves the accuracy of the association between the vehicle and the lane.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of intelligent driving technology, and in particular to a lane matching method, device and computer-readable storage medium. Background Art

[0002] Currently, after constructing lane lines, it is necessary to associate multiple lane line detection results in different frames, for example, to construct a local semantic map. The local semantic map contains not only the image detected by the vehicle in the current frame, but also the image detection results at the time or distance before the current moment. In order to fuse lane lines in different frames at different times, it is necessary to associate lane lines in different frames.

[0003] In the LCC (Lane Centering Control) scenario of pure perception map, due to the limited vehicle perception, the length L of the lane that can be identified is short (usually 20~60 meters), and the perception accuracy will decrease as the distance from the ego increases. There may be occlusion of other vehicles during vehicle driving, making it difficult to identify a larger range of map information in a single frame scenario. When the map information is perceived through consecutive different frames, due to the jitter problem between consecutive different frames, when tracking the same lane, even if the lane number is the same, its information in different frames is inconsistent, resulting in low accuracy of the constructed lane line, low accuracy of lane line association in different frames, and low accuracy of association between vehicles and lanes.

[0004] Therefore, how to improve the accuracy of the association between vehicles and lanes is a problem that needs to be solved urgently. Summary of the invention

[0005] The main purpose of this application is to provide a lane matching method, device and computer-readable storage medium, aiming to solve the technical problem of how to improve the accuracy of the association between vehicles and lanes.

[0006] To achieve the above object, the present application provides a lane matching method, which includes the following steps:

[0007] Based on the association relationship corresponding to each lane line in a preset number of continuous image frames, the lane lines are merged to obtain global lane lines, wherein the global lane lines include merged lane lines and lane lines without an association relationship;

[0008] Based on the global trajectory point coordinates corresponding to the global lane line, a first global grid is established, and a global lane number corresponding to the global lane line is marked in each grid of the first global grid;

[0009] Based on the vehicle coordinates of the traffic vehicles in each image frame, determining a target grid corresponding to each traffic vehicle in the first global grid;

[0010] If there is a first target grid whose element is a non-global lane number in the target grid, determining a second target grid in the first global grid based on the preset number of grids and the first target grid;

[0011] A first target lane number of a first traffic vehicle corresponding to the first target grid is determined based on the second target grid.

[0012] In addition, to achieve the above-mentioned purpose, the present application also provides a lane matching device, which includes: a memory, a processor, and a lane matching program stored in the memory and executable on the processor, and the lane matching program implements the steps of the aforementioned lane matching method when executed by the processor.

[0013] In addition, to achieve the above-mentioned purpose, the present application also provides a computer-readable storage medium, on which a lane matching program is stored, and when the lane matching program is executed by a processor, the steps of the aforementioned lane matching method are implemented.

[0014] The present application obtains an independent global lane line by merging lanes with an associated relationship, establishes a first global grid according to the global trajectory point coordinates of the global lane line, marks the global lane number of the global lane line in the first global grid, obtains the target lane number corresponding to each traffic vehicle according to the vehicle coordinates and the first global grid, realizes the association between traffic vehicles and lanes through lane numbers, establishes a binding relationship between traffic vehicles and lanes, can greatly reduce the number of trajectory points of the original lane trajectory points, reduce the jitter problem between consecutive frames, ensure the reliability of lane trajectory, and improve the accuracy of the association between vehicles and lanes. BRIEF DESCRIPTION OF THE DRAWINGS

[0015] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.

[0016] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.

[0017] Figure 1 A schematic diagram of a process flow provided for the first embodiment of the lane matching method of the present application;

[0018] Figure 2 This is a schematic diagram of a scene in an embodiment of a lane matching method of the present application;

[0019] Figure 3 This is a schematic diagram of the data structure of the dictionary in an embodiment of the lane matching method of the present application;

[0020] Figure 4 This is a schematic diagram of a lane line scene in an embodiment of a lane matching method of the present application;

[0021] Figure 5 A schematic diagram of a first two-dimensional grid in an embodiment of a lane matching method of the present application;

[0022] Figure 6 A schematic diagram of a second two-dimensional grid in an embodiment of the lane matching method of the present application;

[0023] Figure 7 A schematic diagram of a first global grid in an embodiment of a lane matching method of the present application;

[0024] Figure 8 This is a schematic diagram of the module structure of the lane matching device according to an embodiment of the present application.

[0025] The realization of the purpose, functional features and advantages of this application will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION

[0026] It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0027] In order to better understand the technical solution of the present application, a detailed description will be given below in conjunction with the accompanying drawings and specific implementation methods.

[0028] The main solution of the present application is: based on the association relationship corresponding to each lane line in a preset number of continuous image frames, the lane lines are merged to obtain global lane lines, wherein the global lane lines include merged lane lines and lane lines without association relationship; based on the global trajectory point coordinates corresponding to the global lane lines, a first global grid is established, and the global lane number corresponding to the global lane line is marked in each grid of the first global grid; based on the vehicle coordinates of the traffic vehicle in each image frame, the target grid corresponding to each traffic vehicle is determined in the first global grid; if there is a first target grid whose elements are non-global lane numbers in the target grid, a second target grid is determined in the first global grid based on the preset number of grids and the first target grid; based on the second target grid, the first target lane number of the first traffic vehicle corresponding to the first target grid is determined.

[0029] Currently, after constructing lane lines, it is necessary to associate multiple lane line detection results in different frames, for example, to construct a local semantic map. The local semantic map contains not only the image detected by the vehicle in the current frame, but also the image detection results at the time or distance before the current moment. In order to fuse lane lines in different frames at different times, it is necessary to associate lane lines in different frames.

[0030] In the LCC (Lane Centering Control) scenario of pure perception maps, due to the limited perception of the vehicle, the length of the lane L that can be recognized is short (usually 20~60 meters), and the perception accuracy will decrease as the distance from the ego increases. There may be occlusions from other vehicles during the vehicle's driving, making it difficult to recognize a large range of map information in a single frame scenario. When the map information is perceived through consecutive different frames, due to the jitter problem between consecutive different frames, when tracking the same lane, even if the lane number is the same, its information in different frames is inconsistent, resulting in low accuracy of the constructed lane line, low accuracy of lane line association in different frames, and low accuracy of the association between vehicles and lanes. Therefore, how to improve the accuracy of the association between vehicles and lanes is a problem that needs to be solved urgently.

[0031] The present application obtains an independent global lane line by merging lanes with an associated relationship, establishes a first global grid according to the global trajectory point coordinates of the global lane line, marks the global lane number of the global lane line in the first global grid, obtains the target lane number corresponding to each traffic vehicle according to the vehicle coordinates and the first global grid, realizes the association between traffic vehicles and lanes through lane numbers, establishes a binding relationship between traffic vehicles and lanes, can greatly reduce the number of trajectory points of the original lane trajectory points, reduce the jitter problem between consecutive frames, ensure the reliability of lane trajectory, and improve the accuracy of the association between vehicles and lanes.

[0032] It should be noted that the execution subject of this embodiment may be a lane matching device, or a computing service device with data processing, network communication and program running functions, such as a tablet computer, a personal computer, a mobile phone, etc., or a vehicle lane binding device capable of realizing the above functions, etc., and this embodiment does not specifically limit this. The following takes the lane matching device as an example of the execution subject to explain this embodiment and the following embodiments.

[0033] Based on this, this application proposes a lane matching method of the first embodiment, please refer to Figure 1 , the lane matching method includes steps S310 to S350:

[0034] Step S310, based on the association relationship corresponding to each lane line in a preset number of continuous image frames, the lane lines are merged to obtain global lane lines, wherein the global lane lines include merged lane lines and lane lines without an association relationship;

[0035] In this embodiment, a data stream of images taken by the vehicle before the current moment may be acquired in chronological order, the data stream including a preset number of continuous image frames, the preset number may be 1000, and the interval between frames in the continuous image frames may be 0.1s.

[0036] After obtaining a preset number of continuous image frames, the association relationship corresponding to each lane line in the preset number of continuous image frames is obtained. In a feasible implementation, step S310 may include steps S210 to S240:

[0037] Step S210, obtaining the trajectory point coordinates of the trajectory points corresponding to each lane line in a preset number of continuous image frames, and performing a thinning process on the trajectory point coordinates to obtain the first trajectory point coordinates corresponding to each lane line;

[0038] Step S220, determining a horizontal coordinate span and a vertical coordinate span based on the coordinates of the first trajectory point, and establishing a first two-dimensional grid based on the horizontal coordinate span and the vertical coordinate span;

[0039] Step S230, marking the lane number of the lane line in each grid of the first two-dimensional grid based on the coordinates of the first trajectory point;

[0040] Step S240: determining the association relationship between lane lines based on the marked first two-dimensional grid.

[0041] In this embodiment, the trajectory point coordinates of the trajectory points corresponding to each lane line in a preset number of continuous image frames are obtained, and the trajectory point coordinates are thinned to obtain the first trajectory point coordinates corresponding to each lane line. In a feasible implementation, step S210 may include steps S110 to S140:

[0042] Step S110, generating a dictionary based on lane lines in a preset number of consecutive image frames, wherein the dictionary includes lane numbers of lane lines and track point coordinates of track points on the lane lines;

[0043] Step S120, determining the coordinates of the third track points corresponding to the lane lines of each lane number based on the dictionary;

[0044] Step S130, establishing two-dimensional grids corresponding to each lane line based on a preset grid spacing and the coordinates of the third trajectory point;

[0045] Step S140: performing thinning processing on the third trajectory point coordinates of each lane line based on the two-dimensional grid to obtain the first trajectory point coordinates corresponding to each lane line.

[0046] In this embodiment, a dictionary lane_dict can be initialized in advance. The key value of the dictionary is the lane number laneid that has appeared in consecutive image frames. The value of the dictionary is the data information of the lane corresponding to the key spliced ​​between different frames. It can be a list list, which is used to store the trajectory point sequence of the lane line corresponding to the key.

[0047] Next, based on the lane number of the lane line within the preset area corresponding to the vehicle in the image frame, the trajectory point coordinates are added to the dictionary. Specifically, for the target image frame in each image frame, the target lane line within the preset area corresponding to the vehicle in the target image frame is determined; the trajectory point coordinates of the trajectory point on the target lane line are obtained; and the trajectory point coordinates of the trajectory point on the target lane line are added to the end of the list corresponding to the lane number of the target lane line in the dictionary.

[0048] In this embodiment, for the target image frame in each image frame, the target lane line in the preset area corresponding to the vehicle in the target image frame is determined. Specifically, the lane line in the target image frame and the preset area corresponding to the vehicle in the target image frame can be identified by a recognition algorithm in the relevant technology, and then the target lane line in the preset area corresponding to the vehicle in the target image frame is determined, such as Figure 2 As shown, Figure 2 Where v is the driving direction of the vehicle (ego vehicle), the line segment with an arrow is the lane line, the dotted box is the preset area, the lane line in the dotted box is the target lane line, including lane line 1 (lane1), lane line 2 (lane2), lane line 3 (lane3) and lane line 4 (lane4), the trajectory points on lane line 1 (lane1) include trajectory point 1 (point1), trajectory point 2 (point2), trajectory point 3 (point3), where the preset area can be the area between α meters directly behind the vehicle and β meters directly in front of the vehicle, for example, α=5, β=50.

[0049] Next, obtain the trajectory point coordinates of the target lane line, such as Figure 2 As shown in , point1, point2, and point3 are the track point coordinates of the track points on lane line lane1. After obtaining the track point coordinates of the track point on the target lane line, add the track point coordinates of the track point on the target lane line to the end of the list corresponding to the lane number of the target lane line in the dictionary, such as Figure 3As shown in the figure, taking lane 1 (lane1) as an example, the value of lane 1 in the dictionary includes track point 1 (point1), track point 2 (point2), track point 3 (point3) in image frame 1 (frame1), track point 4 (point4), track point 5 (point5) in image frame 2 (frame2), track point M (pointM), track point M+1 (pointM+1), track point M+2 (pointM+2) in image frame M (frameM), etc.

[0050] It should be noted that the coordinates of the trajectory points are all coordinates in the vehicle coordinate system, and the lane line can be the lane center line, lane boundary line, road edge, etc.

[0051] In this embodiment, after adding the trajectory point coordinates corresponding to all image frames in the continuous image frames to the dictionary, the third trajectory point coordinates corresponding to the lane lines of each lane number are determined based on the dictionary. For example, for the lane line lane1, its third trajectory point coordinates include point1, point2, point3, point4, point5…pointM, pointM+1, pointM+2…pointN.

[0052] In this embodiment, after obtaining the third trajectory point coordinates corresponding to the lane lines of each lane number, the preset grid spacing is obtained, and based on the preset grid spacing and the third trajectory point coordinates, the two-dimensional grids corresponding to each lane line are established respectively. Specifically, for the lane line of each lane number, the maximum value of the horizontal coordinate, the minimum value of the horizontal coordinate, the maximum value of the vertical coordinate and the minimum value of the vertical coordinate are obtained in all the third trajectory point coordinates of the lane line, and based on the maximum value of the horizontal coordinate, the minimum value of the horizontal coordinate, the maximum value of the vertical coordinate, the minimum value of the vertical coordinate and the preset grid spacing, the two-dimensional grid corresponding to the lane line is established, wherein the preset grid spacing may be 1m*1m, and the basic unit of 1m*1m is a grid of the two-dimensional grid, and the elements of the grid are initialized to a first preset value, which may be 0, and the second preset value may be 1.

[0053] In a feasible implementation, step S130 may include steps S131-S132:

[0054] Step S131, obtaining the maximum value of the horizontal coordinate, the minimum value of the horizontal coordinate, the maximum value of the vertical coordinate, and the minimum value of the vertical coordinate corresponding to each lane line in the third trajectory point coordinates corresponding to each lane line;

[0055] Step S132, based on the maximum value of the horizontal coordinate, the minimum value of the horizontal coordinate, the maximum value of the vertical coordinate, the minimum value of the vertical coordinate and the preset grid spacing, respectively establish a two-dimensional grid corresponding to each lane line.

[0056] In this embodiment, after obtaining the third trajectory point coordinates corresponding to the lane lines of each lane number, the maximum horizontal coordinate, minimum horizontal coordinate, maximum vertical coordinate and minimum vertical coordinate corresponding to each lane line are obtained in the third trajectory point coordinates corresponding to each lane line. For each lane line with a lane number, horizontal coordinate comparison and vertical coordinate comparison are performed respectively in all the third trajectory point coordinates of the lane line to obtain the maximum horizontal coordinate, minimum horizontal coordinate, maximum vertical coordinate and minimum vertical coordinate corresponding to the lane line.

[0057] Next, the preset grid spacing is obtained, and based on the maximum value of the horizontal coordinate, the minimum value of the horizontal coordinate, the maximum value of the vertical coordinate, the minimum value of the vertical coordinate and the preset grid spacing, the two-dimensional grids corresponding to each lane line are established respectively, wherein the preset grid spacing can be 1m*1m, and the basic unit of 1m*1m is a grid of the two-dimensional grid, and the elements of the grid are initialized to a first preset value, which can be 0, and the second preset value can be 1.

[0058] Specifically, for each lane line with a lane number, a two-dimensional grid corresponding to the lane line is established based on the maximum value of the horizontal coordinate, the minimum value of the horizontal coordinate, the maximum value of the vertical coordinate, the minimum value of the vertical coordinate and the preset grid spacing of the lane line, wherein the horizontal spacing of the two-dimensional grid is the spacing between the maximum value of the horizontal coordinate and the minimum value of the horizontal coordinate, and the vertical spacing of the two-dimensional grid is the spacing between the maximum value of the vertical coordinate and the minimum value of the vertical coordinate, so that the grid row index and the grid column index of each grid in the two-dimensional grid are both integers, so as to facilitate the thinning of the trajectory points through the two-dimensional grid.

[0059] In this embodiment, after establishing a two-dimensional grid, the third trajectory point coordinates of each lane line are thinned out based on the two-dimensional grid to obtain the first trajectory point coordinates corresponding to each lane line. Specifically, for each lane line with a lane number, one trajectory point coordinate is obtained in turn from all the third trajectory point coordinates of the lane line, and the obtained trajectory point coordinates are projected to the two-dimensional grid to obtain a grid corresponding to the obtained trajectory point coordinates. If an element of the grid is a first preset value, the obtained trajectory point coordinate is retained, that is, the obtained trajectory point coordinate is added to the first trajectory point coordinates corresponding to the lane line, and the elements of the grid are set to the second preset value; if the elements of the grid are the second preset value, the obtained trajectory point coordinate is discarded to achieve screening of the trajectory points of the lane line.

[0060] In a feasible implementation, step S140 may include steps S141 to S143:

[0061] Step S141, based on the coordinates of the third track points corresponding to each lane line, determining the horizontal coordinate spacing and the vertical coordinate spacing between two adjacent track points corresponding to each lane line;

[0062] Step S142, based on the preset spacing, the horizontal coordinate spacing and the vertical coordinate spacing, the third track point coordinates corresponding to each lane line are screened to obtain the fourth track point coordinates corresponding to each lane line;

[0063] Step S143: performing thinning processing on the fourth trajectory point coordinates of each lane line based on the two-dimensional grid to obtain the first trajectory point coordinates corresponding to each lane line.

[0064] In this embodiment, after establishing a two-dimensional grid, based on the third trajectory point coordinates corresponding to each lane line, the horizontal coordinate spacing and the vertical coordinate spacing between two adjacent trajectory points corresponding to each lane line are determined. Specifically, for each lane line with a lane number, in all the third trajectory point coordinates of the lane line, the trajectory point coordinates of two adjacent trajectory points are obtained in turn, and based on the horizontal coordinates and the vertical coordinates in the trajectory point coordinates of the two adjacent trajectory points, the corresponding horizontal coordinate spacing and vertical coordinate spacing are calculated respectively, wherein the horizontal coordinate spacing is the absolute value of the difference between the horizontal coordinates of the two adjacent trajectory points, and the vertical coordinate spacing is the absolute value of the difference between the vertical coordinates of the two adjacent trajectory points, and finally the horizontal coordinate spacing and the vertical coordinate spacing of all two adjacent trajectory points in the third trajectory point coordinates of the lane line are obtained.

[0065] After obtaining the horizontal coordinate spacing and the vertical coordinate spacing, the third trajectory point coordinates corresponding to each lane line are screened based on the preset spacing, the horizontal coordinate spacing and the vertical coordinate spacing to obtain the fourth trajectory point coordinates corresponding to each lane line. Specifically, for each lane line with a lane number, the horizontal coordinate spacing and the vertical coordinate spacing of each group of two adjacent trajectory points are compared with the preset spacing to determine whether there are two adjacent trajectory points of the lane line whose horizontal coordinate spacing is less than the preset spacing and whose vertical coordinate spacing is less than the preset spacing. If so, the latter trajectory point of the two adjacent trajectory points is discarded, wherein the front-to-back order of the two adjacent trajectory points is the order of the coordinates of the two trajectory points in the third trajectory point coordinates.

[0066] After obtaining the fourth trajectory point coordinates, the fourth trajectory point coordinates of each lane line are thinned out based on the two-dimensional grid to obtain the first trajectory point coordinates corresponding to each lane line. Specifically, for each lane line with a lane number, one trajectory point coordinate is obtained in turn from all the fourth trajectory point coordinates of the lane line, and the obtained trajectory point coordinates are projected onto the two-dimensional grid to obtain a grid corresponding to the obtained trajectory point coordinates. If an element of the grid is a first preset value, the obtained trajectory point coordinates are retained, that is, the obtained trajectory point coordinates are added to the first trajectory point coordinates corresponding to the lane line, and the elements of the grid are set to the second preset values; if the elements of the grid are the second preset values, the obtained trajectory point coordinates are discarded to achieve screening of the trajectory points of the lane line.

[0067] In a feasible implementation, step S143 may include steps S1431 to S1434:

[0068] Step S1431, rounding down the coordinates of the fourth track point to obtain the coordinates of the fifth track point corresponding to each lane line;

[0069] Step S1432, performing thinning processing on the fifth track point coordinates of each lane line based on the two-dimensional grid to obtain the sixth track point coordinates corresponding to each lane line;

[0070] Step S1433, rounding the coordinates of the sixth track point to obtain the coordinates of the seventh track point corresponding to each lane line;

[0071] Step S1434: thinning the coordinates of the seventh trajectory point of each lane line based on the two-dimensional grid to obtain the coordinates of the first trajectory point corresponding to each lane line.

[0072] In this embodiment, after obtaining the fourth trajectory point coordinates, the fourth trajectory point coordinates are rounded down to obtain the corresponding fifth trajectory point coordinates of each lane line. For example, the coordinate 1.1 is rounded down to 1, and the coordinate 1.9 is rounded down to 1. By rounding down, the coordinates of each fourth trajectory point are converted into integer fifth trajectory point coordinates, and then the horizontal coordinate and the vertical coordinate of the fifth trajectory point coordinate can be used as the grid row and grid column indexes in the two-dimensional grid, respectively.

[0073] After obtaining the coordinates of the fifth track point, the coordinates of the fifth track point of each lane line are thinned out based on the two-dimensional grid to obtain the coordinates of the sixth track point corresponding to each lane line. Specifically, in a feasible implementation, step S1432 may include steps a1 to a3:

[0074] Step a1, for each first target lane line in the lane lines, traverse the coordinates of the fifth track point of the first target lane line in sequence to obtain the first coordinates;

[0075] Step a2, determining a third grid corresponding to the first coordinate in the two-dimensional grid, and obtaining a first grid element of the third grid;

[0076] Step a3, if the first grid element is the first preset value, then the trajectory point coordinates corresponding to the first coordinates in the fourth trajectory point coordinates are added to the sixth trajectory point coordinates corresponding to the first target lane line, and the first grid element is set to the second preset value until the traversal of each fifth trajectory point coordinate is completed.

[0077] In this embodiment, for each first target lane line in the lane lines, the fifth track point coordinates of the first target lane line are traversed in sequence to obtain the first coordinate (the fifth track point coordinate currently traversed), and the traversal is performed in sequence according to the order of the fifth track point coordinates in the target lane lines. The third grid corresponding to the first coordinate is determined in the two-dimensional grid, that is, the grid row and grid column indexes of the third grid are consistent with the two coordinate values ​​of the first coordinate, the grid row index is the horizontal coordinate of the first coordinate, and the grid column index is the vertical coordinate of the first coordinate, the first grid element of the third grid is obtained, and it is determined whether the first grid element is the first preset value.

[0078] If the first grid element is the first preset value, the trajectory point coordinate corresponding to the first coordinate in the fourth trajectory point coordinate is added to the sixth trajectory point coordinate corresponding to the first target lane line, and the first grid element is set to the second preset value to add the trajectory point coordinate before rounding down to the corresponding sixth trajectory point coordinate; if the first grid element is the second preset value, the first coordinate is discarded; until the traversal of each fifth trajectory point coordinate is completed, all the sixth trajectory point coordinates of the target lane line are obtained.

[0079] In this embodiment, after obtaining the coordinates of the sixth trajectory point, the coordinates of the sixth trajectory point are rounded to obtain the coordinates of the seventh trajectory point corresponding to each lane line; for example, the coordinate 1.4 is rounded to 1, and the coordinate 1.9 is rounded to 2. By rounding, the coordinates of each sixth trajectory point are converted into integer coordinates of the seventh trajectory point, and then the horizontal coordinate and the vertical coordinate of the seventh trajectory point coordinate can be used as the grid row and grid column indexes in the two-dimensional grid, respectively.

[0080] After obtaining the coordinates of the seventh track point, the coordinates of the seventh track point of each lane line are thinned out based on the two-dimensional grid to obtain the coordinates of the first track point corresponding to each lane line. Specifically, in a feasible implementation, step S1434 may include steps b1 to b4:

[0081] Step b1, setting the elements of each grid in the two-dimensional grid to a first preset value;

[0082] Step b2, for each second target lane line in the lane line, traverse the coordinates of the seventh track point of the second target lane line in sequence to obtain the second coordinates;

[0083] Step b3, determining a fourth grid corresponding to the second coordinate in the two-dimensional grid, and obtaining a second grid element of the fourth grid;

[0084] Step b4, if the second grid element is the first preset value, then the trajectory point coordinates corresponding to the second coordinates in the sixth trajectory point coordinates are added to the first trajectory point coordinates corresponding to the second target lane line, and the second grid element is set to the second preset value until the traversal of each seventh trajectory point coordinate is completed.

[0085] In this embodiment, after the coordinates of the seventh trajectory point are acquired, the elements of each grid in the two-dimensional grid are set to the first preset value, that is, the elements of each grid in the two-dimensional grid are reset to the first preset value.

[0086] Next, for each second target lane line in the lane line, the seventh track point coordinates of the second target lane line are traversed in sequence to obtain the second coordinate (the seventh track point coordinate currently traversed), and the traversal is performed in sequence according to the order of the seventh track point coordinates in the target lane line, and the fourth grid corresponding to the second coordinate is determined in the two-dimensional grid, that is, the grid row and grid column indexes of the fourth grid are consistent with the two coordinate values ​​of the second coordinate, the grid row index is the horizontal coordinate of the second coordinate, and the grid column index is the vertical coordinate of the second coordinate, the second grid element of the fourth grid is obtained, and it is determined whether the second grid element is the first preset value.

[0087] If the second grid element is the first preset value, the trajectory point coordinate corresponding to the second coordinate in the sixth trajectory point coordinate is added to the first trajectory point coordinate corresponding to the second target lane line, and the second grid element is set to the second preset value, so as to add the trajectory point coordinate before rounding to the corresponding first trajectory point coordinate; if the first grid element is the second preset value, the first coordinate is discarded; until the traversal of each seventh trajectory point coordinate is completed, all the first trajectory point coordinates of the target lane line are obtained, such as Figure 4 As shown, Figure 4 This is the sequence of trajectory points of the lane line after two thinning processes. By performing two thinning processes on the coordinates of the trajectory points of the lane line, the number of trajectory points of each lane line is reduced, and the jitter problem between the trajectory points in the lane line is reduced.

[0088] In this embodiment, after the fourth trajectory point coordinates of all lane lines are processed by the processing method of this embodiment, the first trajectory point coordinates corresponding to each lane line can be obtained.

[0089] In this embodiment, after obtaining the first track point coordinates corresponding to each lane line, the horizontal coordinate span and the vertical coordinate span are determined based on the first track point coordinates. Specifically, the maximum horizontal coordinate, the minimum horizontal coordinate, the maximum vertical coordinate and the minimum vertical coordinate can be determined in the first track point coordinates corresponding to each lane line, that is, the maximum horizontal coordinate is the maximum value of all horizontal coordinates in the first track point coordinates, the minimum horizontal coordinate is the minimum value of all horizontal coordinates in the first track point coordinates, the maximum vertical coordinate is the maximum value of all vertical coordinates in the first track point coordinates, and the minimum vertical coordinate is the maximum value of all vertical coordinates in the first track point coordinates. minimum value; then, determine the horizontal coordinate span based on the maximum horizontal coordinate and the minimum horizontal coordinate, and determine the vertical coordinate span based on the maximum vertical coordinate and the minimum vertical coordinate, wherein the horizontal coordinate span can be determined according to the result of rounding up the difference between the maximum horizontal coordinate and the minimum horizontal coordinate, and the vertical coordinate span can be determined according to the result of rounding up the difference between the maximum vertical coordinate and the minimum vertical coordinate, or, first round the maximum horizontal coordinate and the minimum horizontal coordinate, determine the horizontal coordinate span based on the difference of the rounding results, round the maximum horizontal coordinate and the minimum horizontal coordinate, and determine the vertical coordinate span based on the difference of the rounding results.

[0090] After obtaining the horizontal coordinate span and the vertical coordinate span, a first two-dimensional grid is established based on the horizontal coordinate span and the vertical coordinate span. Specifically, a preset grid spacing can be obtained, and the first two-dimensional grid is established based on the preset grid spacing, the horizontal coordinate span and the vertical coordinate span, wherein n is the horizontal coordinate span, m is the vertical coordinate span, the first two-dimensional grid is a grid of m rows and n columns, and the length and width of each grid in the first two-dimensional grid are both the preset grid spacing.

[0091] The horizontal distance of the first two-dimensional grid is the horizontal coordinate span, and the vertical distance is the vertical coordinate span. The length and width of each grid in the first two-dimensional grid are both preset grid spacings.

[0092] In a feasible implementation, step S220 may include steps S221 to S223:

[0093] Step S221, determining the maximum horizontal coordinate, the minimum horizontal coordinate, the maximum vertical coordinate and the minimum vertical coordinate in the first track point coordinates corresponding to each lane line;

[0094] Step S222, determining the horizontal coordinate span based on the maximum horizontal coordinate and the minimum horizontal coordinate, and determining the vertical coordinate span based on the maximum vertical coordinate and the minimum vertical coordinate;

[0095] Step S223: establishing a first two-dimensional grid based on the preset grid spacing, the horizontal coordinate span, and the vertical coordinate span.

[0096] In this embodiment, after obtaining the first trajectory point coordinates corresponding to each lane line, the maximum horizontal coordinate, the minimum horizontal coordinate, the maximum vertical coordinate and the minimum vertical coordinate are determined in the first trajectory point coordinates corresponding to each lane line, that is, the horizontal coordinates of each trajectory point in the first trajectory point coordinates are compared to obtain the maximum horizontal coordinate and the minimum horizontal coordinate, and the vertical coordinates of each trajectory point in the first trajectory point coordinates are compared to obtain the maximum vertical coordinate and the minimum vertical coordinate.

[0097] Next, the horizontal coordinate span is determined based on the maximum horizontal coordinate and the minimum horizontal coordinate, and the vertical coordinate span is determined based on the maximum vertical coordinate and the minimum vertical coordinate; in a feasible implementation, step S222 may include steps S2221 to S2225:

[0098] Step S2221, respectively rounding down and rounding off the maximum horizontal coordinate, and taking the maximum value of the rounding results as the target maximum horizontal coordinate;

[0099] Step S2222, respectively rounding down and rounding the minimum horizontal coordinate, and taking the minimum value of the rounding results as the target minimum horizontal coordinate;

[0100] Step S2223, respectively rounding down and rounding off the maximum vertical coordinate, and taking the maximum value of the rounding results as the target maximum vertical coordinate;

[0101] Step S2224, respectively rounding down and rounding the minimum vertical coordinate, and taking the minimum value of the rounding results as the target minimum vertical coordinate;

[0102] Step S2225, determining the horizontal coordinate span based on the target maximum horizontal coordinate and the target minimum horizontal coordinate, and determining the vertical coordinate span based on the target maximum vertical coordinate and the target minimum vertical coordinate.

[0103] In this embodiment, the maximum horizontal coordinate is rounded down and rounded up to obtain two rounding results of the maximum horizontal coordinate, and the maximum value of the rounding results is used as the target maximum horizontal coordinate. If the two rounding results are equal, the target maximum horizontal coordinate is any one of the two rounding results.

[0104] The minimum horizontal coordinate is rounded down and rounded up respectively to obtain two rounding results of the minimum horizontal coordinate, and the minimum value of the rounding results is used as the target minimum horizontal coordinate. If the two rounding results are equal, the target minimum horizontal coordinate is any one of the two rounding results.

[0105] The maximum vertical coordinate is rounded down and rounded to obtain two rounding results of the maximum vertical coordinate, and the maximum value of the rounding results is used as the target maximum vertical coordinate. If the two rounding results are equal, the target maximum vertical coordinate is any one of the two rounding results.

[0106] The minimum vertical coordinate is rounded down and rounded to obtain two rounding results of the minimum vertical coordinate, and the minimum value of the rounding results is used as the target minimum vertical coordinate. If the two rounding results are equal, the target minimum vertical coordinate is any one of the two rounding results.

[0107] After obtaining the maximum horizontal coordinate and the minimum horizontal coordinate of the target, the horizontal coordinate span is determined based on the maximum horizontal coordinate and the minimum horizontal coordinate of the target, and the vertical coordinate span is determined based on the maximum vertical coordinate and the minimum vertical coordinate of the target. The formulas for the horizontal coordinate span and the vertical coordinate span are:

[0108] m=max(round(y_global_max),int(y_global_max))- min(round(y_global_min), int(y_global_min)) + 1;

[0109] n=max(round(x_global_max), int(x_global_max)) - min(round(x_global_min), int(x_global_min)) + 1;

[0110] Among them, n is the horizontal coordinate span, m is the vertical coordinate span, x_global_max is the maximum horizontal coordinate in the coordinates of the first track point, x_global_min is the minimum horizontal coordinate in the coordinates of the first track point, y_global_max is the maximum vertical coordinate in the coordinates of the first track point, y_global_min is the minimum vertical coordinate in the coordinates of the first track point, round(x) means rounding x to the nearest integer, int(x) means rounding x down, max(x, y) means taking the larger value of x and y, min(x, y) means taking the smaller value of x and y.

[0111] After obtaining the horizontal coordinate span and the vertical coordinate span, a first two-dimensional grid is established based on the preset grid spacing, the horizontal coordinate span and the vertical coordinate span, wherein the first two-dimensional grid is a grid of m rows and n columns, and the length and width of each grid in the first two-dimensional grid are both the preset grid spacing.

[0112] In this embodiment, after the first two-dimensional grid is established, the lane number of the lane line is marked in each grid of the first two-dimensional grid based on the coordinates of the first trajectory point. Specifically, the coordinates of each first trajectory point may be rounded first, and the trajectory point index of the corresponding trajectory point may be determined according to the rounded coordinates. According to the trajectory point index of each trajectory point, the lane number of each lane line is marked in each grid of the first two-dimensional grid, that is, for a grid where there is no lane number corresponding to the current trajectory point, the lane code corresponding to the trajectory point having the same trajectory point index and grid index (grid row index and grid column index) is marked in the grid, such as Figure 5 In a feasible implementation, step S230 may include steps S231 to S233:

[0113] Step S231, performing rounding processing on the coordinates of each first trajectory point to obtain the coordinates of the second trajectory point;

[0114] Step S232, determining the trajectory point index of each trajectory point corresponding to the first trajectory point coordinate based on the second trajectory point coordinate;

[0115] Step S233: based on the index of each trajectory point, marking the lane number of each lane line in each grid of the first two-dimensional grid.

[0116] In this embodiment, after establishing the first two-dimensional grid, the coordinates of each first trajectory point are rounded to obtain the coordinates of the second trajectory point, and based on the second trajectory point coordinates, the trajectory point index of each trajectory point corresponding to the first trajectory point coordinate is determined. Specifically, the formula of the trajectory point index is:

[0117] index_x = int(x) - int(x_global_min);

[0118] index_y = int(y) - int(y_global_min);

[0119] or

[0120] index_x = round(x) - int(x_global_min);

[0121] index_y = round(y) - int(y_global_min);

[0122] Among them, round(x) means rounding x to the nearest integer, int(x) means rounding x to the nearest integer, x_global_min means the minimum value of the horizontal coordinate in the coordinates of the first trajectory point, y_global_min means the minimum value of the vertical coordinate in the coordinates of the first trajectory point, and (index_x, index_y) is the index of the trajectory point corresponding to the coordinates (x, y).

[0123] After obtaining the trajectory point index, the lane number of each lane line is marked on each grid of the first two-dimensional grid based on each trajectory point index. That is, for a grid where there is no lane number corresponding to the current trajectory point, the lane code corresponding to the trajectory point with the same trajectory point index and grid index (grid row index and grid column index) is marked on the grid, such as Figure 5 In a feasible implementation, step S233 may include steps S2331 to S2333:

[0124] Step S2331, for each target trajectory point index in the trajectory point index, obtaining the target lane number of the lane line to which the trajectory point corresponding to the target trajectory point index belongs;

[0125] Step S2332, determining a third grid corresponding to the target trajectory point index in the first two-dimensional grid;

[0126] Step S2333: If the target lane number does not exist in the elements of the third grid, add the target lane number to the elements of the third grid.

[0127] In this embodiment, for each target trajectory point index in the trajectory point index, the target lane number of the lane line to which the trajectory point corresponding to the target trajectory point index belongs is obtained, and the third grid corresponding to the target trajectory point index is determined in the first two-dimensional grid, that is, the grid row index of the third grid is the same as the index_x of the target trajectory point index, and the grid column index is the same as the index_y of the target trajectory point index.

[0128] After obtaining the third grid, determine whether the target lane number exists in the elements of the third grid. If the target lane number does not exist in the elements of the third grid, add the target lane number to the elements of the third grid, thereby achieving the addition of the lane number to the elements of the grid in the first two-dimensional grid.

[0129] In this embodiment, after obtaining the marked first two-dimensional grid, the association relationship between each lane line is determined based on the marked first two-dimensional grid. Specifically, a first grid with multiple lane numbers in each grid of the first two-dimensional grid can be obtained, and the association relationship between each lane line is determined according to the lane number in the first grid. In a feasible implementation, step S240 may include steps S241 to S244:

[0130] Step S241, establishing a second two-dimensional grid based on the number of lane numbers corresponding to the lane numbers;

[0131] Step S242, determining a first grid in which a grid element in the first two-dimensional grid has multiple lane numbers;

[0132] Step S243, based on the elements of the first grid, updating the elements of each grid in the second two-dimensional grid, wherein the elements of the grid in the updated second two-dimensional grid are the number of times the corresponding two lane numbers belong to the same grid in the first two-dimensional grid;

[0133] Step S244: determining the association relationship between lane lines based on the updated second two-dimensional grid.

[0134] In this embodiment, after obtaining the marked first two-dimensional grid, a second two-dimensional grid is established based on the number of numbers corresponding to the lane numbers; for example, the number of numbers corresponding to the lane numbers (the number of lanes in the global map) is L, and 1, 2, ...L are respectively used as indexes of L lanes to establish a second two-dimensional grid of L*L with L rows and L columns, and the initial value of the elements of each grid in the second two-dimensional grid is 0.

[0135] After the second two-dimensional grid is established, the first grid in which the elements of the grid in the first two-dimensional grid have multiple lane numbers is obtained. Specifically, the number of elements in each grid in the first two-dimensional grid is counted. If the number of elements corresponding to a certain grid is greater than 1, it is determined that the elements of the grid have multiple lane numbers, and the grid is the first grid. Figure 5 As shown, Figure 5 In the figure, the grid jointly occupied by lane 2 (lane2) and lane 3 (lane3), the grid jointly occupied by lane 1 (lane1) and lane 2 (lane2), the grid jointly occupied by lane 1, lane 2 and lane 3, and the two grids jointly occupied by lane 6 (lane6) and lane 5 (lane5) are all first grids.

[0136] After determining the first grid in the first two-dimensional grid, based on the elements of the first grid, update the elements of each grid in the second two-dimensional grid to obtain an updated second two-dimensional grid. Specifically, for each grid in the first grid, extract the elements of the grid, combine the lane numbers laneid in the extracted elements in pairs, use each combination as a position index of a second two-dimensional grid, and add 1 to the element of the grid corresponding to the position index in the second two-dimensional grid. For example, if the elements of a grid in the first grid are the list [2,7,9], then after pairwise combination, obtain the combinations [2,7], [2,9], [7,9], add 1 to the element of the grid with index [2,7] in the second two-dimensional grid with [2,7] as the position index of the second two-dimensional grid, add 1 to the element of the grid with index [2,9] in the second two-dimensional grid with [2,9] as the position index of the second two-dimensional grid, and add 1 to the element of the grid with index [7,9] in the second two-dimensional grid with [7,9] as the position index of the second two-dimensional grid.

[0137] like Figure 6 As shown, Figure 6 What is shown is the updated second two-dimensional grid. Since the relationship between two different lanes satisfies the commutative law, that is, the relationship between lane 1 (lane1) and lane 2 (lane2) is the same as the relationship between lane 2 and lane 1, that is, the updated second two-dimensional grid is symmetrical about the main diagonal line, so only the upper right corner of the second two-dimensional grid needs to be considered.

[0138] Then, based on the updated second two-dimensional grid, the association relationship between the lane lines is determined. In a feasible implementation, step S244 may include steps S2441 to S2443:

[0139] Step S2441, for the target lane number in each lane number, obtaining the first element of each second grid corresponding to the same row of each target lane number in the updated second two-dimensional grid;

[0140] Step S2442, determining a second element in the first element that is greater than a preset threshold;

[0141] Step S2443: Determine an association relationship list corresponding to the target lane number based on the lane number of the second grid corresponding to the second element.

[0142] In this embodiment, after obtaining the updated second two-dimensional grid, for the target lane number in each lane number, the first element of each second grid corresponding to the same row of each target lane number is obtained in the updated second two-dimensional grid, such as Figure 6As shown, for a lane line with an index (lane number) of 1, the first element may include an element of a grid with a row index of 1 and a column index of 2, 3, ..., L-1, L in the second two-dimensional grid.

[0143] After obtaining the first elements, each first element is compared with a preset threshold to determine a second element in the first elements that is greater than the preset threshold. The preset threshold can be reasonably set, for example, the preset threshold can be 5.

[0144] After obtaining the second element, based on the lane number of the second grid corresponding to the second element, determine the association relationship list corresponding to the target lane number. For example, for the lane line with index 1, establish a list lane_list_1 containing lane lines with index 1, extract lanes with indexes 2, 3, ..., L respectively, and if the number of corresponding elements in the updated second two-dimensional grid is greater than the preset threshold, add this lane to lane_list_1. In this way, a lane sequence related to lane line lane with index 1, that is, the association relationship list of lane line lane1, can be obtained, such as Figure 6 As shown, when the preset threshold is 5, lane_list_1 is [1, L], and lane_list_2 is [2, 3, L-1], thereby realizing the association relationship between each lane line through the association relationship list.

[0145] In a feasible implementation, after step S2443, the lane association method may further include steps S2444 to S2445:

[0146] Step S2444, determining whether there are multiple association relationship lists to be merged that have the same lane number in the association relationship lists corresponding to the lane numbers;

[0147] Step S2445: If there are association relationship lists to be merged, the association relationship lists to be merged with the same lane number are merged to obtain a target association relationship list.

[0148] In this embodiment, after obtaining the association relationship lists corresponding to each lane number, it is determined whether there are multiple association relationship lists to be merged with the same lane number in the association relationship lists corresponding to each lane number. For example, if association relationship list 1 is [2, 4, 6, 8] and association relationship list 2 is [4, 7, 9], then association relationship list 1 and association relationship list 2 are the association relationship lists to be merged.

[0149] If there are association lists to be merged, the association lists to be merged with the same lane number are merged to obtain the target association list. For example, association list 1 is [2, 4, 6, 8] and association list 2 is [4, 7, 9], then the merged target association list is [2, 4, 6, 7, 8, 9]. The final association list includes the lists in the association list except the association list to be merged and the target association list. By merging the association lists, the accuracy of the association lists can be further improved.

[0150] In this embodiment, after obtaining the association relationship corresponding to each lane line in a preset number of continuous image frames, the lane lines are merged based on the association relationship. For example, when the association relationship between each lane line is represented by an association relationship list, the trajectory points of each lane line in each association relationship list are merged to obtain the merged lane line. For example, for the association relationship list [1415, 1359, 1513], where 1415, 1359 and 1513 represent the lane numbers laneids of the lanes, where the lane trajectory point sequence with laneid 1415 is [point1, pont2, point3, point4], the lane trajectory point sequence with laneid 1359 is [point11, pont12, point13, point14, point15, point16], and the lane trajectory point sequence with laneid 1513 is [point21, pont22, point23]. The trajectory point sequence of the merged lane line is [point1, pont2, point3, point4, point11, pont12, point13, point14, point15, point16, point21, pont22, point23], and the lane trajectory point sequence can be represented by laneid 1415.

[0151] Afterwards, the merged lane lines and the lane lines that have no associated relationship (lane lines that have not been merged) are used as global lane lines.

[0152] Step S320, establishing a first global grid based on the global trajectory point coordinates corresponding to the global lane line, and marking the global lane number corresponding to the global lane line in each grid of the first global grid;

[0153] In this embodiment, after obtaining the global lane line, the global trajectory point coordinates corresponding to the global lane line are obtained, and a first global grid is established based on the global trajectory point coordinates. Specifically, the trajectory point coordinates of the global lane line are first obtained. If the global lane line is a merged lane line, the trajectory point coordinates of the global lane line include the trajectory point coordinates of all lane lines in the corresponding association relationship list. Then, the trajectory point coordinates of the global lane line are thinned to obtain the global trajectory point coordinates of each global lane line.

[0154] After obtaining the global track point coordinates, a first global grid is established based on the global track point coordinates. Specifically, the global horizontal coordinate span and the global vertical coordinate span can be determined based on the global track point coordinates. For example, the global horizontal coordinate span and the global vertical coordinate span are determined according to the maximum global horizontal coordinate, the minimum global horizontal coordinate, the maximum global vertical coordinate and the minimum global vertical coordinate in the global track point coordinates, and the first global grid is established based on the preset grid spacing, the global horizontal coordinate span and the global vertical coordinate span. For example, n1 is the global horizontal coordinate span, m1 is the global vertical coordinate span, the first global grid is a grid with m1 rows and n1 columns, and the length and width of each grid in the first global grid are both preset grid spacing. Among them, the elements of the grid in the first global grid can be set to the initial value, such as the first preset value, and the first preset value can be set to 0.

[0155] Next, the global lane number corresponding to the global lane line is marked in each grid of the first global grid. Specifically, each global trajectory point coordinate is rounded to obtain a fourth global trajectory point coordinate, and the global trajectory point index corresponding to each global trajectory point coordinate is determined based on the fourth global trajectory point coordinate; based on each global trajectory point index, the global lane number corresponding to the global lane line is marked in each grid of the first global grid.

[0156] Specifically, the formula for the global trajectory point index is:

[0157] index_x = int(x) - int(x_global_min);

[0158] index_y = int(y) - int(y_global_min);

[0159] or

[0160] index_x = round(x) - int(x_global_min);

[0161] index_y = round(y) - int(y_global_min);

[0162] Among them, round(x) means rounding x to the nearest integer, int(x) means rounding x downward, x_global_min means the minimum value of the horizontal coordinate in the global trajectory point coordinates, y_global_min means the minimum value of the vertical coordinate in the global trajectory point coordinates, (index_x, index_y) is the global trajectory point index corresponding to the global trajectory point coordinates (x, y).

[0163] After obtaining the global trajectory point index, the global lane number corresponding to the global lane line is marked in each grid of the first global grid based on each global trajectory point index. That is, for a grid where there is no global lane number corresponding to the current global trajectory point, the global lane code corresponding to the global trajectory point with the same global trajectory point index and global grid index (global grid row index and global grid column index) is marked in the grid.

[0164] Specifically, for each target global trajectory point index in the global trajectory point index, obtain the global lane number of the global lane line to which the global trajectory point corresponding to the target global trajectory point index belongs, and determine the grid corresponding to the target global trajectory point index in the first global grid; the row index of the grid corresponding to the target global trajectory point index is the same as the index_x of the target global trajectory point index, and the column index of the grid corresponding to the target global trajectory point index is the same as the index_y of the target global trajectory point index. If the global lane number corresponding to the target global trajectory point index does not exist in the element of the grid corresponding to the target global trajectory point index, then add the global lane number corresponding to the target global trajectory point index to the element of the grid corresponding to the target global trajectory point index.

[0165] It should be noted that if the global lane number corresponding to the target global trajectory point index exists in the element of the grid corresponding to the target global trajectory point index, the global lane number is not added to the grid corresponding to the target global trajectory point index to avoid duplication of the global lane number in the element.

[0166] Step S330, determining a target grid corresponding to each traffic vehicle in the first global grid based on the vehicle coordinates of the traffic vehicle in each image frame;

[0167] In this embodiment, after marking the global lane number in the first global grid, the target grid corresponding to each traffic vehicle is determined in the first global grid based on the vehicle coordinates of the traffic vehicle in each image frame, that is, the traffic vehicle is projected into the first global grid according to the vehicle coordinates of the traffic vehicle to obtain the target grid corresponding to each traffic vehicle. Specifically, since the global grid index of the first global grid is an integer, the vehicle coordinates of each traffic vehicle can be rounded, and the vehicle index (including row index and column index) can be determined according to the rounded vehicle coordinates. For each traffic vehicle, the grid whose global grid index is the vehicle index is queried in the first global grid as the target grid of the traffic vehicle.

[0168] Step S340, if there is a first target grid whose element is a non-global lane number in the target grid, a second target grid is determined in the first global grid based on a preset number of grids and the first target grid;

[0169] In this embodiment, after determining the target grid, elements of each target grid are obtained, and based on the elements of the target grid, it is determined whether there is a first target grid in the target grid whose elements are non-global lane numbers. For example, when establishing the first global grid, the elements of the grids in the first global grid are initialized to a first preset value of 0, then it is determined whether there is a first target grid in the target grid whose elements are the first preset value of 0.

[0170] If there is a first target grid whose elements are non-global lane numbers in the target grid, a second target grid is determined in the first global grid based on the preset number of grids and the first target grid. Specifically, a grid that is separated from the first target grid by the preset number of grids is first determined in the first global grid, and a grid in an area enclosed by the grids separated by the preset number of grids is used as the second target grid; Figure 7 As shown, the first target grid is the grid corresponding to the traffic vehicle agent, and the second target grid includes the first target grid and grids with a preset number of grids around the first target grid. If the preset number of grids is 1, the second target grid includes the first target grid and the grids in the 25-grid area formed by the surrounding 24 grids. If the preset number of grids is 0, the second target grid includes the first target grid and the grids in the 9-grid area formed by the surrounding 8 grids.

[0171] Step S350: determining a first target lane number of a first traffic vehicle corresponding to the first target grid based on the second target grid.

[0172] In this embodiment, after the second target grid is obtained, the first target lane number of the first traffic vehicle corresponding to the first target grid is determined based on the second target grid. Specifically, the target global lane number in the elements of each second target grid is obtained, and the first target lane number of the first traffic vehicle is determined according to the distance between the first traffic vehicle and the global lane line corresponding to each target global lane number.

[0173] The lane matching method proposed in this embodiment merges lanes with associated relationships to obtain independent global lane lines, establishes a first global grid according to the global trajectory point coordinates of the global lane lines, marks the global lane numbers of the global lane lines in the first global grid, obtains the target lane numbers corresponding to each traffic vehicle according to the vehicle coordinates and the first global grid, realizes the association between traffic vehicles and lanes through lane numbers, and establishes a binding relationship between traffic vehicles and lanes. It can greatly reduce the number of trajectory points of the original lane trajectory points, reduce the jitter problem between consecutive frames, ensure the reliability of lane trajectories, and improve the accuracy of the association between vehicles and lanes.

[0174] In a feasible implementation, step S350 may include steps S351 to S354:

[0175] Step S351, obtaining the target global lane number in the elements of each second target grid;

[0176] Step S352, determining multiple lane line segments of the global lane line corresponding to each target global lane number based on a preset sliding window;

[0177] Step S353, determining the distance between the first traffic vehicle and each lane segment based on the vehicle coordinates of the first traffic vehicle, and obtaining the minimum distance among the distances;

[0178] Step S354: If the minimum distance is less than a preset distance, the global lane number of the global lane line corresponding to the minimum distance is used as the first target lane number.

[0179] In this embodiment, after the second target grid is obtained, the target global lane number in the elements of each second target grid is obtained. Specifically, the elements of each second target grid are obtained, and the target global lane number is determined based on the global lane number in the lane number list corresponding to the obtained element.

[0180] After obtaining the target global lane number, multiple lane segments of the global lane line corresponding to each target global lane number are determined based on a preset sliding window. For example, taking the global lane line of the target global lane number lane1 as an example, lane1 is a trajectory point sequence composed of a number of global trajectory points including point1, point2, point3, ..., pointN. Each point on lane1 can be taken one by one using the sliding window. For the trajectory point point_i, the previous point point_i-1 is taken, and point_i and point_i-1 constitute a lane segment. Alternatively, the first two points point_i-1 and point_i-2 are taken, and point_i, point_i-1, and point_i-2 constitute a lane segment to obtain multiple lane segments of the global lane line lane1. The same processing is performed on the global lane line corresponding to each target global lane number, and finally multiple lane segments of the global lane line corresponding to each target global lane number are obtained.

[0181] After obtaining multiple lane segments corresponding to the global lane line of each target global lane number, the distance between the first traffic vehicle and each lane segment is calculated according to the vehicle coordinates and the global trajectory point coordinates contained in the lane segment, and all the obtained distances are compared to obtain the minimum distance among all distances.

[0182] In this embodiment, after the minimum distance is obtained, it is determined whether the minimum distance is less than the preset distance. If the minimum distance is less than the preset distance, the target global lane number corresponding to the minimum distance is used as the first target lane number corresponding to the first traffic vehicle. Specifically, the global lane line to which the lane line segment corresponding to the minimum distance belongs is obtained, and the target global lane number of the global lane line is used as the first target lane number, so as to associate the first traffic vehicle with the global lane line closest to it, establish a binding relationship between the first traffic vehicle and the lane, and improve the accuracy of the association between the vehicle and the lane.

[0183] Among them, the preset distance can be reasonably set. If the minimum distance is greater than or equal to the preset distance, it is considered that the first traffic vehicle has no lane, and the binding lane of the first traffic vehicle is determined to be a free lane.

[0184] In a feasible implementation manner, step S350 may further include steps S355-S356:

[0185] Step S355, obtaining a third target grid whose element in the target grid is a global lane number;

[0186] Step S356: determining a second target lane number of the third target grid corresponding to a second traffic vehicle based on the global lane number of the third target grid.

[0187] In this embodiment, after determining the target grid, the elements of each target grid are obtained, and based on the elements of the target grid, it is determined whether there is a third target grid in the target grid whose elements are global lane numbers. For example, when establishing the first global grid, the elements of the grid in the first global grid are initialized to a first preset value of 0. When the global lane number corresponding to the global lane line is marked in the grid, the elements of the grid are updated to the corresponding global lane number, and then it is determined whether there is a third target grid in the target grid whose elements are non-zero.

[0188] When there is a third target grid, the third target grid whose element in the target grid is the global lane number is obtained, and based on the global lane number of the third target grid, the second target lane number of the second traffic vehicle corresponding to the third target grid is determined.

[0189] Specifically, for each grid in the third target grid, if the element of the grid is a global lane number, the global lane number is used as the second target lane number corresponding to the second traffic vehicle of the grid; if the element of the grid is multiple global lane numbers, the first global lane number among the multiple global lane numbers can be used as the second target lane number corresponding to the second traffic vehicle, or any global lane number among the multiple global lane numbers can be used as the second target lane number corresponding to the second traffic vehicle.

[0190] The lane matching method proposed in this embodiment obtains the target global lane number in the elements of each second target grid; then determines multiple lane segments of the global lane line corresponding to each target global lane number based on a preset sliding window; then determines the distance between the first traffic vehicle and each lane segment based on the vehicle coordinates of the first traffic vehicle, and obtains the minimum distance among the distances; then if the minimum distance is less than the preset distance, the global lane number of the global lane line corresponding to the minimum distance is used as the first target lane number, and the first traffic vehicle is associated with the global lane line closest to it through the minimum distance, so as to establish a binding relationship between the first traffic vehicle and the lane, thereby improving the accuracy of the association between the vehicle and the lane.

[0191] In a feasible implementation, step S330 may include steps S331 to S333:

[0192] Step S331, rounding the vehicle coordinates of each traffic vehicle to obtain rounded vehicle coordinates;

[0193] Step S332, determining the vehicle index corresponding to each traffic vehicle based on the rounded vehicle coordinates;

[0194] Step S333: determining a target grid corresponding to each traffic vehicle in the first global grid based on the vehicle index.

[0195] In this embodiment, after marking the global lane number in the first global grid, the vehicle coordinates of the traffic vehicles contained in each frame of a preset number of continuous image frames are obtained, the vehicle coordinates of each traffic vehicle obtained are rounded to obtain the rounded vehicle coordinates, and the vehicle index corresponding to each traffic vehicle is determined based on the rounded vehicle coordinates, wherein the formula of the vehicle index is:

[0196] index_x = int(obj_x) - int(x_global_min);

[0197] index_y = int(obj_y) - int(y_global_min);

[0198] Among them, int(x) means rounding down x, x_global_min means the minimum value of the horizontal coordinate in the global trajectory point coordinates, y_global_min means the minimum value of the vertical coordinate in the global trajectory point coordinates, and (index_x, index_y) is the vehicle index corresponding to the vehicle coordinates (obj_x, obj_y).

[0199] After obtaining the vehicle index, the target grid corresponding to each traffic vehicle is determined in the first global grid based on the vehicle index. Specifically, for each traffic vehicle, the grid whose global grid index is the vehicle index is queried in the first global grid as the target grid of the traffic vehicle. The global row index of the target grid is index_x in the vehicle index, and the global column index of the target grid is index_y in the vehicle index.

[0200] The lane matching method proposed in this embodiment obtains rounded vehicle coordinates by rounding the vehicle coordinates of each traffic vehicle; then, based on the rounded vehicle coordinates, the vehicle index corresponding to each traffic vehicle is determined; and then, based on the vehicle index, the target grid corresponding to each traffic vehicle is determined in the first global grid. The target grid can be accurately determined based on the vehicle coordinates, further improving the accuracy of the association between the vehicle and the lane.

[0201] In a feasible implementation, step S320 may include steps S321 to S323:

[0202] Step S321, performing a thinning process on the trajectory point coordinates of the global lane line to obtain the global trajectory point coordinates of each global lane line;

[0203] Step S322, determining a global horizontal coordinate span and a global vertical coordinate span based on the global trajectory point coordinates;

[0204] Step S323: establishing a first global grid based on the preset grid spacing, the global horizontal coordinate span, and the global vertical coordinate span.

[0205] In this embodiment, after obtaining the global lane line, the global trajectory point coordinates corresponding to the global lane line are obtained. Specifically, the trajectory point coordinates of the global lane line are obtained first. If the global lane line is a merged lane line, the trajectory point coordinates of the global lane line include the trajectory point coordinates of all lane lines in the corresponding association relationship list. Then, the trajectory point coordinates of the global lane line are thinned to obtain the global trajectory point coordinates of each global lane line.

[0206] In a feasible implementation, step S321 may include steps S3211 to S3215:

[0207] Step S3211, based on the preset grid spacing and the coordinates of the trajectory points of the global lane lines, respectively establish a second global grid corresponding to each global lane line;

[0208] Step S3212, rounding down the trajectory point coordinates of the global lane line to obtain the first global trajectory point coordinates corresponding to each global lane line;

[0209] Step S3213, performing thinning processing on the first global trajectory point coordinates of each global lane line based on the second global grid to obtain the second global trajectory point coordinates corresponding to each global lane line;

[0210] Step S3214, rounding the second global trajectory point coordinates to obtain third global trajectory point coordinates corresponding to each global lane line;

[0211] Step S3215: reset the elements of each grid in the second global grid, and perform thinning processing on the third global trajectory point coordinates of each global lane line based on the second global grid to obtain the global trajectory point coordinates corresponding to each global lane line.

[0212] In this embodiment, after the trajectory point coordinates of the global lane line are obtained, a second global grid corresponding to each global lane line is established based on the preset grid spacing and the trajectory point coordinates of the global lane line. Specifically, in the trajectory point coordinates of each global lane line, the global horizontal coordinate maximum value, the global horizontal coordinate minimum value, the global vertical coordinate maximum value and the global vertical coordinate minimum value corresponding to each global lane line are obtained. That is, for each global lane line, in the trajectory point coordinates of the global lane line, horizontal coordinate comparison and vertical coordinate comparison are performed respectively to obtain the global horizontal coordinate maximum value, the global horizontal coordinate minimum value, the global vertical coordinate maximum value and the global vertical coordinate minimum value corresponding to the global lane line.

[0213] Next, the preset grid spacing is obtained, and based on the preset grid spacing, the global maximum value of the horizontal coordinate, the global minimum value of the horizontal coordinate, the global maximum value of the vertical coordinate and the global minimum value of the vertical coordinate, the second global grid corresponding to each global lane line is established respectively, wherein the preset grid spacing may be 1m*1m, and a basic unit of 1m*1m is a grid of the second global grid, and the elements of the grid are initialized to a first preset value, which may be 0, and the second preset value may be 1.

[0214] Specifically, for each global lane line, a second global grid corresponding to the lane line is established based on the global horizontal coordinate maximum value, global horizontal coordinate minimum value, global vertical coordinate maximum value, global vertical coordinate minimum value and preset grid spacing of the global lane line, wherein the horizontal spacing of the second global grid is the spacing between the global horizontal coordinate maximum value and the global horizontal coordinate minimum value, and the vertical spacing of the second global grid is the spacing between the global vertical coordinate maximum value and the global vertical coordinate minimum value, so that the grid row index and grid column index of each grid in the two-dimensional grid are both integers, so as to facilitate the thinning of trajectory points through the two-dimensional grid.

[0215] After establishing the second global grid, the trajectory point coordinates of the global lane line are rounded down to obtain the first global trajectory point coordinates corresponding to each global lane line; and based on the second global grid, the first global trajectory point coordinates of each global lane line are thinned out to obtain the second global trajectory point coordinates corresponding to each global lane line. In a feasible implementation, step S3213 may include steps c1 to c3:

[0216] Step c1, for each target global lane line in the global lane lines, traverse the first global trajectory point coordinates of the target global lane line in sequence to obtain the target coordinates;

[0217] Step c2, based on the second global grid, obtaining the target element of the grid corresponding to the target coordinates;

[0218] Step c3, if the target element is the first preset value, the trajectory point coordinates corresponding to the target coordinates in the trajectory point coordinates of the target global lane line are added to the second global trajectory point coordinates corresponding to the target global lane line until the traversal of each first global trajectory point coordinate is completed.

[0219] In this embodiment, after obtaining the first global trajectory point coordinates, for each target global lane line in the global lane line, the first global trajectory point coordinates of the target global lane line are traversed in sequence to obtain the target coordinates, specifically, traversing in sequence according to the order of the first global trajectory point coordinates in the target lane line.

[0220] Next, based on the second global grid, the target element of the grid corresponding to the target coordinates is obtained. Specifically, the grid corresponding to the target coordinates is determined in the second global grid, that is, the grid row and grid column indexes of the grid corresponding to the target coordinates are consistent with the two coordinate values ​​of the target coordinates, the target element of the grid corresponding to the target coordinates is obtained, and it is determined whether the target element is the first preset value.

[0221] If the target element is the second preset value, the target coordinates are discarded; if the target element is the first preset value, the trajectory point coordinates corresponding to the target coordinates in the trajectory point coordinates of the target global lane line are added to the second global trajectory point coordinates corresponding to the target global lane line, that is, the trajectory point coordinates before rounding down corresponding to the target coordinates are added to the corresponding second global trajectory point coordinates, and the target element is set to the second preset value; until the traversal of each first global trajectory point coordinate is completed.

[0222] In this embodiment, the second global trajectory point coordinates are rounded to obtain the third global trajectory point coordinates corresponding to each global lane line. Then, the elements of each grid in the second global grid are reset, and the third global trajectory point coordinates of each global lane line are thinned based on the second global grid to obtain the global trajectory point coordinates corresponding to each global lane line. Among them, the thinning process of the third global trajectory point coordinates is similar to that of the first global trajectory point coordinates, which will not be repeated here. For each global lane line, its global trajectory point coordinates are the second global trajectory point coordinates corresponding to the third global trajectory point coordinates after thinning, that is, the global trajectory point coordinates are the trajectory point coordinates before rounding.

[0223] After obtaining the global trajectory point coordinates of each global lane line, the global horizontal coordinate span and the global vertical coordinate span are determined based on the global trajectory point coordinates. In a feasible implementation, step S322 may include steps S3221 to S3226:

[0224] Step S3221, determining the maximum global horizontal coordinate, the minimum global horizontal coordinate, the maximum global vertical coordinate and the minimum global vertical coordinate in the global trajectory point coordinates;

[0225] Step S3222, respectively rounding down and rounding off the maximum global horizontal coordinate, and taking the maximum value of the rounding results as the target maximum global horizontal coordinate;

[0226] Step S3223, respectively rounding down and rounding the minimum global horizontal coordinate, and taking the minimum value of the rounding results as the target minimum global horizontal coordinate;

[0227] Step S3224, respectively rounding down and rounding the maximum global ordinate, and taking the maximum value of the rounding results as the target maximum global ordinate;

[0228] Step S3225, respectively rounding down and rounding the minimum global ordinate, and taking the minimum value of the rounding results as the target minimum global ordinate;

[0229] Step S3226: determining the global horizontal coordinate span based on the target maximum global horizontal coordinate and the target minimum global horizontal coordinate, and determining the global vertical coordinate span based on the target maximum global vertical coordinate and the target minimum global vertical coordinate.

[0230] In this embodiment, the global abscissa and the global ordinate of each global trajectory point in the global trajectory point coordinates are compared respectively to determine the maximum global abscissa, the minimum global abscissa, the maximum global ordinate and the minimum global ordinate.

[0231] Next, the maximum global horizontal coordinate is rounded down and rounded up to obtain two rounding results of the maximum global horizontal coordinate, and the maximum value of the rounding results is used as the target maximum global horizontal coordinate. If the two rounding results are equal, the target maximum global horizontal coordinate is any one of the two rounding results.

[0232] The minimum global horizontal coordinate is rounded down and rounded up respectively to obtain two rounding results of the minimum global horizontal coordinate, and the minimum value of the rounding results is used as the target minimum global horizontal coordinate. If the two rounding results are equal, the target minimum global horizontal coordinate is any one of the two rounding results.

[0233] The maximum global ordinate is rounded down and rounded to obtain two rounding results of the maximum global ordinate, and the maximum value of the rounding results is used as the target maximum global ordinate. If the two rounding results are equal, the target maximum global ordinate is any one of the two rounding results.

[0234] The minimum global ordinate is rounded down and rounded to obtain two rounding results of the minimum global ordinate, and the minimum value of the rounding results is used as the target minimum global ordinate. If the two rounding results are equal, the target minimum global ordinate is any one of the two rounding results.

[0235] Then, the global horizontal coordinate span is determined based on the target maximum global horizontal coordinate and the target minimum global horizontal coordinate, and the global vertical coordinate span is determined based on the target maximum global vertical coordinate and the target minimum global vertical coordinate. The formulas of the global horizontal coordinate span and the global vertical coordinate span are:

[0236] m=max(round(y_global_max),int(y_global_max))- min(round(y_global_min), int(y_global_min)) + 1;

[0237] n=max(round(x_global_max), int(x_global_max)) - min(round(x_global_min), int(x_global_min)) + 1;

[0238] Among them, n is the global horizontal coordinate span, m is the global vertical coordinate span, x_global_max is the maximum global horizontal coordinate in the global trajectory point coordinates, x_global_min is the minimum global horizontal coordinate in the global trajectory point coordinates, y_global_max is the maximum global vertical coordinate in the global trajectory point coordinates, y_global_min is the minimum global vertical coordinate in the global trajectory point coordinates, round(x) means rounding x to the nearest integer, int(x) means rounding x down, max(x, y) means taking the larger value of x and y, and min(x, y) means taking the smaller value of x and y.

[0239] After obtaining the global horizontal coordinate span and the global vertical coordinate span, a first global grid is established based on the preset grid spacing, the global horizontal coordinate span and the global vertical coordinate span, wherein the first global grid is a grid of m rows and n columns, and the length and width of each grid in the first global grid are both the preset grid spacing.

[0240] The lane matching method proposed in this embodiment obtains the global trajectory point coordinates of each global lane line by thinning the trajectory point coordinates of the global lane line; then determines the global horizontal coordinate span and the global vertical coordinate span based on the global trajectory point coordinates; and then establishes a first global grid based on the preset grid spacing, the global horizontal coordinate span and the global vertical coordinate span. By establishing the first global grid according to the global trajectory point coordinates, the global lane number of each global lane line can be accurately marked in the first global grid, thereby further improving the accuracy of the association between vehicles and lanes.

[0241] The lane matching device provided in the embodiment of the present application adopts the lane matching method in the above embodiment, which can solve the technical problem of how to improve the accuracy of the association between the vehicle and the lane. Compared with the prior art, the beneficial effects of the lane matching device provided in the embodiment of the present application are the same as the beneficial effects of the lane matching method provided in the above embodiment, and the other technical features in the lane matching device are the same as the features disclosed in the above embodiment method, which will not be repeated here.

[0242] The present application provides a lane matching device, which includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the lane matching method in the above-mentioned embodiment 1.

[0243] Reference below Figure 8 , which shows a schematic diagram of the structure of a lane matching device suitable for implementing the embodiment of the present application. The lane matching device in the embodiment of the present application may include but is not limited to mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (Portable Application Descriptions), PMPs (Portable Media Players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 8 The lane matching device shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.

[0244] like Figure 8 As shown, the lane matching device may include a processing device 1001 (e.g., a central processing unit, a graphics processor, etc.), which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM: Read Only Memory) 1002 or a program loaded from a storage device 1003 to a random access memory (RAM: Random Access Memory) 1004. In RAM1004, various programs and data required for the operation of the lane matching device are also stored. The processing device 1001, ROM1002, and RAM1004 are connected to each other through a bus 1005. An input / output (I / O) interface 1006 is also connected to the bus. Generally, the following systems can be connected to the I / O interface 1006: an input device 1007 including, for example, a touch screen, a touch pad, a keyboard, a mouse, an image sensor, a microphone, an accelerometer, a gyroscope, etc.; an output device 1008 including, for example, a liquid crystal display (LCD: Liquid Crystal Display), a speaker, a vibrator, etc.; a storage device 1003 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 1009. The communication device 1009 can allow the lane matching device to communicate with other devices wirelessly or by wire to exchange data. Although the figure shows a lane matching device with various systems, it should be understood that it is not required to implement or have all the systems shown. More or fewer systems can be implemented or have alternatively.

[0245] In particular, according to the embodiments disclosed in the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present application include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication device, or installed from a storage device 1003, or installed from a ROM 1002. When the computer program is executed by the processing device 1001, the above-mentioned functions defined in the method of the embodiment disclosed in the present application are executed.

[0246] The lane matching device provided by the present application adopts the lane matching method in the above embodiment, which can solve the technical problem of how to improve the accuracy of the association between the vehicle and the lane. Compared with the prior art, the beneficial effects of the lane matching device provided by the present application are the same as the beneficial effects of the lane matching method provided by the above embodiment, and the other technical features in the lane matching device are the same as the features disclosed in the method of the previous embodiment, which will not be repeated here.

[0247] It should be understood that the various parts disclosed in this application can be implemented by hardware, software, firmware or a combination thereof. In the description of the above embodiments, specific features, structures, materials or characteristics can be combined in any one or more embodiments or examples in a suitable manner.

[0248] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

[0249] The present application provides a computer-readable storage medium having computer-readable program instructions (ie, computer programs) stored thereon, and the computer-readable program instructions are used to execute the lane matching method in the above-mentioned embodiment.

[0250] The computer-readable storage medium provided in the present application may be, for example, a USB flash drive, but is not limited to electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, systems or devices, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM: Random Access Memory), a read-only memory (ROM: Read Only Memory), an erasable programmable read-only memory (EPROM: Erasable Programmable Read Only Memory or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM: CD-Read Only Memory), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this embodiment, the computer-readable storage medium may be any tangible medium containing or storing a program, which may be used by or in combination with an instruction execution system, system or device. The program code contained on the computer-readable storage medium may be transmitted using any appropriate medium, including but not limited to: wires, optical cables, RF (Radio Frequency: Radio Frequency), etc., or any suitable combination of the above.

[0251] The computer-readable storage medium may be included in the lane matching device; or may exist independently without being assembled into the lane matching device.

[0252] The computer-readable storage medium carries one or more programs. When the one or more programs are executed by the lane matching device, the lane matching device: based on the association relationship corresponding to each lane line in a preset number of continuous image frames, merges the lane lines to obtain global lane lines, wherein the global lane lines include merged lane lines and lane lines without an association relationship; based on the global trajectory point coordinates corresponding to the global lane lines, establishes a first global grid, and marks the global lane number corresponding to the global lane line in each grid of the first global grid; based on the vehicle coordinates of the traffic vehicle in each image frame, determines the target grid corresponding to each traffic vehicle in the first global grid; if there is a first target grid whose elements are non-global lane numbers in the target grid, determines a second target grid in the first global grid based on the preset number of grids and the first target grid; and determines the first target lane number of the first traffic vehicle corresponding to the first target grid based on the second target grid.

[0253] Computer program code for performing the operations of the present application may be written in one or more programming languages ​​or a combination thereof, including object-oriented programming languages ​​such as Java, Smalltalk, C++, and conventional procedural programming languages ​​such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0254] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present application. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0255] The modules involved in the embodiments described in this application may be implemented by software or hardware, wherein the name of the module does not constitute a limitation on the unit itself in some cases.

[0256] The readable storage medium provided in the present application is a computer-readable storage medium, which stores computer-readable program instructions (i.e., computer programs) for executing the lane matching method described above, and can solve the technical problem of how to improve the accuracy of the association between the vehicle and the lane. Compared with the prior art, the beneficial effects of the computer-readable storage medium provided in the present application are the same as the beneficial effects of the lane matching method provided in the above embodiment, and will not be elaborated here.

[0257] An embodiment of the present application provides a computer program product, including a computer program, which implements the steps of the lane matching method as described above when executed by a processor.

[0258] The computer program product provided in this application can solve the technical problem of how to improve the accuracy of the association between the vehicle and the lane. Compared with the prior art, the beneficial effects of the computer program product provided in the embodiment of this application are the same as the beneficial effects of the lane matching method provided in the above embodiment, which will not be repeated here.

[0259] The above are only preferred embodiments of the present application, and are not intended to limit the patent scope of the present application. Any equivalent structure or equivalent process transformation made using the contents of the present application specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present application.

Claims

1. A lane matching method, characterized in that: The lane matching method comprises the following steps: Based on the association relationship corresponding to each lane line in a preset number of continuous image frames, the lane lines are merged to obtain global lane lines, wherein the global lane lines include merged lane lines and lane lines without an association relationship; Based on the global trajectory point coordinates corresponding to the global lane line, a first global grid is established, and a global lane number corresponding to the global lane line is marked in each grid of the first global grid; Based on the vehicle coordinates of the traffic vehicles in each image frame, determining a target grid corresponding to each traffic vehicle in the first global grid; If there is a first target grid whose elements are non-global lane numbers in the target grid, a second target grid is determined in the first global grid based on the preset number of grids and the first target grid, wherein a grid separated from the first target grid by the preset number of grids is determined in the first global grid, and a grid within an area enclosed by the grids separated by the preset number of grids is used as the second target grid; A first target lane number of a first traffic vehicle corresponding to the first target grid is determined based on the second target grid.

2. The lane matching method according to claim 1, characterized in that: The determining, based on the second target grid, a first target lane number of a first traffic vehicle corresponding to the first target grid comprises: Obtaining the target global lane number in each element of the second target grid; Determine multiple lane line segments of the global lane line corresponding to each target global lane number based on a preset sliding window; Based on the vehicle coordinates of the first traffic vehicle, determining the distance between the first traffic vehicle and each lane line segment, and obtaining a minimum distance among the distances; If the minimum distance is less than a preset distance, the global lane number of the global lane line corresponding to the minimum distance is used as the first target lane number.

3. The lane matching method according to claim 2, characterized in that: After determining the target grid corresponding to each traffic vehicle in the first global grid based on the vehicle coordinates of the traffic vehicles in each image frame, the method further includes: Obtain a third target grid whose elements in the target grid are global lane numbers; Based on the global lane number of the third target grid, a second target lane number of the third target grid corresponding to the second traffic vehicle is determined.

4. The lane matching method according to claim 1, characterized in that: The step of determining a target grid corresponding to each traffic vehicle in the first global grid based on the vehicle coordinates of the traffic vehicles in each image frame includes: Rounding the vehicle coordinates of each traffic vehicle to obtain rounded vehicle coordinates; Based on the rounded vehicle coordinates, determine the vehicle index corresponding to each traffic vehicle; Based on the vehicle index, a target grid corresponding to each traffic vehicle is determined in the first global grid.

5. The lane matching method according to any one of claims 1 to 4, characterized in that: The step of establishing a first global grid based on the global trajectory point coordinates corresponding to the global lane line includes: The trajectory point coordinates of the global lane line are thinned to obtain the global trajectory point coordinates of each global lane line; Based on the global trajectory point coordinates, determine the global horizontal coordinate span and the global vertical coordinate span; A first global grid is established based on the preset grid spacing, the global abscissa span, and the global ordinate span.

6. The lane matching method according to claim 5, characterized in that: The thinning process of the trajectory point coordinates of the global lane line to obtain the global trajectory point coordinates of each global lane line includes: Based on the preset grid spacing and the coordinates of the trajectory points of the global lane lines, respectively establish a second global grid corresponding to each global lane line; Rounding down the trajectory point coordinates of the global lane line to obtain the first global trajectory point coordinates corresponding to each global lane line; Based on the second global grid, thinning processing is performed on the first global trajectory point coordinates of each global lane line to obtain the second global trajectory point coordinates corresponding to each global lane line; Rounding the second global trajectory point coordinates to obtain third global trajectory point coordinates corresponding to each global lane line; The elements of each grid in the second global grid are reset, and the third global trajectory point coordinates of each global lane line are thinned based on the second global grid to obtain the global trajectory point coordinates corresponding to each global lane line.

7. The lane matching method according to claim 6, characterized in that: The thinning process is performed on the first global trajectory point coordinates of each global lane line based on the second global grid to obtain the second global trajectory point coordinates corresponding to each global lane line, including: For each target global lane line in the global lane lines, traverse the coordinates of the first global trajectory point of the target global lane line in turn to obtain the target coordinates; Based on the second global grid, obtaining a target element of the grid corresponding to the target coordinates; If the target element is a first preset value, the trajectory point coordinates corresponding to the target coordinates in the trajectory point coordinates of the target global lane line are added to the second global trajectory point coordinates corresponding to the target global lane line until the traversal of each first global trajectory point coordinate is completed.

8. The lane matching method according to claim 5, characterized in that: The determining of the global horizontal coordinate span and the global vertical coordinate span based on the global trajectory point coordinates includes: In the global trajectory point coordinates, determine the maximum global abscissa, the minimum global abscissa, the maximum global ordinate, and the minimum global ordinate; The maximum global horizontal coordinate is rounded down and rounded up respectively, and the maximum value of the rounding results is used as the target maximum global horizontal coordinate; The minimum global horizontal coordinate is rounded down and rounded up respectively, and the minimum value of the rounding results is used as the target minimum global horizontal coordinate; The maximum global ordinate is rounded down and rounded up respectively, and the maximum value of the rounding results is used as the target maximum global ordinate; The minimum global ordinate is rounded down and rounded up respectively, and the minimum value of the rounding results is used as the target minimum global ordinate; The global abscissa span is determined based on the target maximum global abscissa and the target minimum global abscissa, and the global ordinate span is determined based on the target maximum global ordinate and the target minimum global ordinate.

9. A lane matching device, characterized in that: The lane matching device includes: a memory, a processor, and a lane matching program stored in the memory and executable on the processor. When the lane matching program is executed by the processor, the steps of the lane matching method according to any one of claims 1 to 8 are implemented.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a lane matching program, which, when executed by a processor, implements the steps of the lane matching method according to any one of claims 1 to 8.

Citation Information

Patent Citations

  • Method and system for supporting real-time fusion updating of high-precision map lane lines

    CN109059954A

  • Moving track simulation method, device and equipment and medium

    CN110887503A