Lane matching method, device and computer readable storage medium
By diluting the lane line trajectory points and two-dimensional grid marking, the problem of low accuracy of lane line association relationship between different frames is solved, and the accuracy and stability of lane line detection is improved.
Patent Information
- Application Number
- CN202411680463.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-22
- Publication Date
- 2025-04-04
- Estimated Expiration
- 2044-11-22
AI Technical Summary
In lane line detection and local semantic map construction, the lane line association relationship between different frames is low, resulting in the impact of the accuracy and stability of lane line detection.
By obtaining the coordinates of lane line track points in continuous image frames, dilute processing is performed, a two-dimensional grid is established to mark lane numbers, and the grid elements are updated to determine the correlation between lane lines.
It effectively reduces the number of lane track points, reduces the jitter problem between different frames, and improves the reliability of lane lines and the accuracy of correlation relationships between different frames.
Smart Images

Figure CN119169569B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data processing 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 limited vehicle perception, the length L of the lane that can be identified is short (usually 20 to 60 meters), and the perception accuracy will decrease as the distance from the ego increases. There may be occlusions from other vehicles during vehicle driving, making it difficult to identify a larger range of map information in a single-frame scenario. When perceiving map information through consecutive frames, due to the jitter problem between consecutive 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 and low accuracy of lane line association in different frames.
[0004] Therefore, how to improve the accuracy of the correlation between lane lines in different frames is a problem that needs to be solved urgently. Summary of the invention
[0005] The main purpose of the present 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 relationship between lane lines in different frames.
[0006] To achieve the above object, the present application provides a lane matching method, which includes the following steps:
[0007] Acquire the trajectory point coordinates of the trajectory points corresponding to each lane line in a preset number of continuous image frames, and perform thinning processing on the trajectory point coordinates to obtain the first trajectory point coordinates corresponding to each lane line;
[0008] Based on the coordinates of the first trajectory point, determine a horizontal coordinate span and a vertical coordinate span, and establish a first two-dimensional grid based on the horizontal coordinate span and the vertical coordinate span;
[0009] Based on the first trajectory point coordinates, marking lane numbers of lane lines in each grid of the first two-dimensional grid;
[0010] Based on the marked first two-dimensional grid, the association relationship between each lane line is determined.
[0011] Furthermore, determining the association relationship between lane lines based on the marked first two-dimensional grid includes:
[0012] Establishing a second two-dimensional grid based on the number of numbers corresponding to the lane numbers;
[0013] Determine a first grid in which a plurality of lane numbers exist for elements of the grid in the first two-dimensional grid;
[0014] 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;
[0015] Based on the updated second two-dimensional grid, the association relationship between the lane lines is determined.
[0016] Furthermore, determining the association relationship between lane lines based on the updated second two-dimensional grid includes:
[0017] 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;
[0018] Determine a second element in the first element that is greater than a preset threshold;
[0019] Based on the lane number of the second grid corresponding to the second element, an association relationship list corresponding to the target lane number is determined.
[0020] Furthermore, after determining the association relationship list corresponding to the target lane number based on the lane number of the second grid corresponding to the second element, the lane matching method further includes:
[0021] Determine whether there are multiple association relationship lists to be merged that have the same lane number in the association relationship lists corresponding to each lane number;
[0022] If there is a list of association relationships to be merged, the list of association relationships to be merged is merged to obtain a target list of association relationships.
[0023] Furthermore, the marking of lane numbers of lane lines in each grid of the first two-dimensional grid based on the coordinates of the first trajectory point includes:
[0024] Rounding the coordinates of each first track point to obtain the coordinates of the second track point;
[0025] Based on the second trajectory point coordinates, determining the trajectory point index of each trajectory point corresponding to the first trajectory point coordinates;
[0026] Based on each trajectory point index, a lane number of each lane line is marked on each grid of the first two-dimensional grid.
[0027] Furthermore, marking lane numbers of lane lines on each grid of the first two-dimensional grid based on each trajectory point index includes:
[0028] For each target track point index in the track point index, obtain the target lane number of the lane line to which the track point corresponding to the target track point index belongs;
[0029] Determine a third grid corresponding to the target trajectory point index in the first two-dimensional grid;
[0030] If the target lane number does not exist in the elements of the third grid, the target lane number is added to the elements of the third grid.
[0031] Further, the determining of 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 includes:
[0032] In the coordinates of the first track points corresponding to each lane line, determine the maximum horizontal coordinate, the minimum horizontal coordinate, the maximum vertical coordinate and the minimum vertical coordinate;
[0033] Determine the abscissa span based on the maximum abscissa and the minimum abscissa, and determine the ordinate span based on the maximum ordinate and the minimum ordinate;
[0034] A first two-dimensional grid is established based on a preset grid spacing, the abscissa span, and the ordinate span.
[0035] Further, the determining the abscissa span based on the maximum abscissa and the minimum abscissa, and determining the ordinate span based on the maximum ordinate and the minimum ordinate, comprises:
[0036] The maximum horizontal coordinate is rounded down and rounded up respectively, and the maximum value of the rounding results is used as the target maximum horizontal coordinate;
[0037] The minimum horizontal coordinate is rounded down and rounded up respectively, and the minimum value of the rounding results is used as the target minimum horizontal coordinate;
[0038] The maximum vertical coordinate is rounded down and rounded up respectively, and the maximum value of the rounding results is used as the target maximum vertical coordinate;
[0039] The minimum ordinate is rounded down and rounded up respectively, and the minimum value of the rounding results is used as the target minimum ordinate;
[0040] The abscissa span is determined based on the target maximum abscissa and the target minimum abscissa, and the ordinate span is determined based on the target maximum ordinate and the target minimum ordinate.
[0041] 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 on 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.
[0042] 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.
[0043] The present application obtains the trajectory point coordinates of the trajectory points corresponding to each lane line in a preset number of continuous image frames, and performs a thinning process on the trajectory point coordinates to obtain the first trajectory point coordinates corresponding to each lane line; then, based on the first trajectory point coordinates, determines the horizontal coordinate span and the vertical coordinate span, and establishes a first two-dimensional grid based on the horizontal coordinate span and the vertical coordinate span; then, based on the first trajectory point coordinates, marks the lane number of the lane line in each grid of the first two-dimensional grid; then, based on the marked first two-dimensional grid, determines the association relationship between each lane line, performs a thinning process on the trajectory point coordinates of the trajectory points on the lane line in a preset number of continuous image frames, and establishes a first two-dimensional grid according to the first trajectory point coordinates, and establishes the association relationship between each lane line according to the first trajectory point coordinates through the first two-dimensional grid, so that the number of trajectory points of the original lane trajectory points can be greatly reduced, the jitter problem between consecutive frames is reduced, the reliability of the lane trajectory is ensured, and the accuracy of the association relationship between lane lines in different frames is improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] 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.
[0045] 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.
[0046] Figure 1 A schematic diagram of a process flow provided for the first embodiment of the lane matching method of the present application;
[0047] Figure 2 This is a schematic diagram of a scene in an embodiment of a lane matching method of the present application;
[0048] 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;
[0049] Figure 4 This is a schematic diagram of a lane line scene in an embodiment of a lane matching method of the present application;
[0050] Figure 5 A schematic diagram of a first two-dimensional grid in an embodiment of a lane matching method of the present application;
[0051] Figure 6 A schematic diagram of a second two-dimensional grid in an embodiment of the lane matching method of the present application;
[0052] Figure 7 This is a schematic diagram of the module structure of the lane matching device according to an embodiment of the present application.
[0053] 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
[0054] 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.
[0055] 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.
[0056] The main solution of the present application is: obtaining the trajectory point coordinates of the trajectory points corresponding to each lane line in a preset number of continuous image frames, and performing thinning processing on the trajectory point coordinates to obtain the first trajectory point coordinates corresponding to each lane line; based on the first trajectory point coordinates, determining the horizontal coordinate span and the vertical coordinate span, and establishing a first two-dimensional grid based on the horizontal coordinate span and the vertical coordinate span; based on the first trajectory point coordinates, marking the lane number of the lane line in each grid of the first two-dimensional grid; based on the marked first two-dimensional grid, determining the association relationship between each lane line.
[0057] For smart vehicles, accurately obtaining road information of the current environment is a key and basic function that determines whether the vehicle can complete the corresponding tasks as expected and ensure that it reaches the destination safely, comfortably and quickly.
[0058] 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.
[0059] In the LCC (Lane Centering Control) scenario of pure perception maps, due to limited vehicle perception, the length of the lane L that can be recognized is short (usually 20 to 60 meters), and the perception accuracy will decrease as the distance from the ego increases. There may be occlusions from other vehicles during vehicle 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, resulting in low accuracy of lane line association in different frames. Therefore, how to improve the accuracy of the association between lane lines in different frames is a problem that needs to be solved urgently.
[0060] The present application performs thinning processing on the trajectory point coordinates of the trajectory points on the lane lines in a preset number of consecutive image frames, establishes a first two-dimensional grid based on the first trajectory point coordinates, and establishes the association relationship between each lane line based on the first trajectory point coordinates through the first two-dimensional grid. This can greatly reduce the number of trajectory points of the original lane trajectory points, reduce the jitter problem between consecutive different frames, ensure the reliability of the lane trajectory, and improve the accuracy of the association relationship between lane lines in different frames.
[0061] 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 lane association 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 to illustrate this embodiment and the following embodiments.
[0062] 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 S210 to S240:
[0063] 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;
[0064] 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.
[0065] After acquiring a preset number of continuous image frames, the trajectory point coordinates of the trajectory points corresponding to each lane line in the preset number of continuous image frames are acquired, 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:
[0066] 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;
[0067] Step S120, determining the coordinates of the third track points corresponding to the lane lines of each lane number based on the dictionary;
[0068] 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;
[0069] 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.
[0070] 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.
[0071] 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.
[0072] 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.
[0073] 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 3 As 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.
[0074] 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.
[0075] 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.
[0076] 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.
[0077] In a feasible implementation, step S130 may include steps S131-S132:
[0078] 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;
[0079] 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.
[0080] 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.
[0081] 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.
[0082] 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.
[0083] 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.
[0084] In a feasible implementation, step S140 may include steps S141 to S143:
[0085] 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;
[0086] 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;
[0087] 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.
[0088] 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.
[0089] 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.
[0090] 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.
[0091] In a feasible implementation, step S143 may include steps S1431 to S1434:
[0092] 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;
[0093] 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;
[0094] Step S1433, rounding the coordinates of the sixth track point to obtain the coordinates of the seventh track point corresponding to each lane line;
[0095] 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.
[0096] 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.
[0097] 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:
[0098] 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;
[0099] 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;
[0100] 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.
[0101] 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.
[0102] 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.
[0103] 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.
[0104] 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:
[0105] Step b1, setting the elements of each grid in the two-dimensional grid to a first preset value;
[0106] 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;
[0107] 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;
[0108] 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.
[0109] 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.
[0110] 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.
[0111] 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.
[0112] 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.
[0113] 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;
[0114] 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.
[0115] 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.
[0116] 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.
[0117] 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;
[0118] 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 shown.
[0119] Step S240: determining the association relationship between lane lines based on the marked first two-dimensional grid.
[0120] 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 in which multiple lane numbers exist 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 numbers in the first grid.
[0121] The lane matching method proposed in this embodiment obtains the trajectory point coordinates of the trajectory points corresponding to each lane line in a preset number of continuous image frames, and performs thinning processing on the trajectory point coordinates to obtain the first trajectory point coordinates corresponding to each lane line; then, based on the first trajectory point coordinates, determines the horizontal coordinate span and the vertical coordinate span, and establishes a first two-dimensional grid based on the horizontal coordinate span and the vertical coordinate span; then, based on the first trajectory point coordinates, marks the lane number of the lane line in each grid of the first two-dimensional grid; then, based on the marked first two-dimensional grid, determines the association relationship between each lane line, performs thinning processing on the trajectory point coordinates of the trajectory points on the lane line in a preset number of continuous image frames, and establishes the first two-dimensional grid according to the first trajectory point coordinates, and establishes the association relationship between each lane line according to the first trajectory point coordinates through the first two-dimensional grid, so that the number of trajectory points of the original lane trajectory points can be greatly reduced, the jitter problem between consecutive frames is reduced, the reliability of the lane trajectory is guaranteed, and the accuracy of the association relationship between lane lines in different frames is improved.
[0122] In a feasible implementation, step S240 may include steps S241 to S244:
[0123] Step S241, establishing a second two-dimensional grid based on the number of lane numbers corresponding to the lane numbers;
[0124] Step S242, determining a first grid in which a grid element in the first two-dimensional grid has multiple lane numbers;
[0125] 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;
[0126] Step S244: determining the association relationship between lane lines based on the updated second two-dimensional grid.
[0127] 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.
[0128] 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.
[0129] 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.
[0130] 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.
[0131] 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:
[0132] 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;
[0133] Step S2442, determining a second element in the first element that is greater than a preset threshold;
[0134] 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.
[0135] 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 6 As 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.
[0136] 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.
[0137] 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].
[0138] In a feasible implementation, after step S2443, the lane matching method may further include steps S2444 to S2445:
[0139] 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;
[0140] 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.
[0141] 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.
[0142] 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.
[0143] The lane matching method proposed in this embodiment establishes a second two-dimensional grid based on the number of numbers corresponding to the lane numbers; then determines a first grid with multiple lane numbers in each grid of the first two-dimensional grid; then updates elements of each grid in the second two-dimensional grid based on the lane numbers in the first 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; then determines the association relationship between each lane line based on the updated second two-dimensional grid, and establishes the association relationship between each lane line through the second two-dimensional grid, thereby improving the accuracy of the association relationship between lane lines in different frames.
[0144] In a feasible implementation, step S230 may include steps S231~S231:
[0145] Step S231, performing rounding processing on the coordinates of each first trajectory point to obtain the coordinates of the second trajectory point;
[0146] 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;
[0147] 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.
[0148] 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:
[0149] index_x = int(x) - int(x_global_min);
[0150] index_y = int(y) - int(y_global_min);
[0151] or
[0152] index_x = round(x) - int(x_global_min);
[0153] index_y = round(y) - int(y_global_min);
[0154] 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).
[0155] 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:
[0156] 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;
[0157] Step S2332, determining a third grid corresponding to the target trajectory point index in the first two-dimensional grid;
[0158] 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.
[0159] 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 a 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.
[0160] 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 first two-dimensional grid.
[0161] The lane matching method proposed in this embodiment obtains the second trajectory point coordinates by rounding the coordinates of each first trajectory point; then, based on the second trajectory point coordinates, the trajectory point index of each trajectory point corresponding to the first trajectory point coordinates is determined; and then, based on each trajectory point index, the lane number of each lane line is marked in each grid of the first two-dimensional grid. The lane number of each lane line can be accurately marked in the first two-dimensional grid by the trajectory point index corresponding to the trajectory point coordinates, thereby further improving the accuracy of the association relationship between lane lines in different frames.
[0162] In a feasible implementation, step S220 may include steps S221 to S223:
[0163] 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;
[0164] 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;
[0165] Step S223: establishing a first two-dimensional grid based on the preset grid spacing, the horizontal coordinate span, and the vertical coordinate span.
[0166] 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.
[0167] 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:
[0168] 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;
[0169] 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;
[0170] 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;
[0171] 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;
[0172] 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.
[0173] 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.
[0174] 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.
[0175] 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.
[0176] 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.
[0177] 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:
[0178] m=max(round(y_global_max),int(y_global_max))- min(round(y_global_min), int(y_global_min)) + 1;
[0179] n=max(round(x_global_max), int(x_global_max)) - min(round(x_global_min), int(x_global_min)) + 1;
[0180] 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.
[0181] 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.
[0182] The lane matching method proposed in this embodiment determines the maximum horizontal coordinate, the minimum horizontal coordinate, the maximum vertical coordinate and the minimum vertical coordinate in the first trajectory point coordinates corresponding to each lane line; then determines the horizontal coordinate span based on the maximum horizontal coordinate and the minimum horizontal coordinate, and determines the vertical coordinate span based on the maximum vertical coordinate and the minimum vertical coordinate; then establishes a first two-dimensional grid based on a preset grid spacing, the horizontal coordinate span and the vertical coordinate span. By establishing the first two-dimensional grid according to the first trajectory point coordinates, the lane number of each lane line can be accurately marked in the first two-dimensional grid, thereby further improving the accuracy of the association relationship between lane lines in different frames.
[0183] 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 relationship between lane lines in different frames. 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 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.
[0184] 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.
[0185] Reference below Figure 7 , 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 7 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.
[0186] like Figure 7As 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.
[0187] 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.
[0188] 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 relationship between lane lines in different frames. 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 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.
[0189] 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.
[0190] 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.
[0191] 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.
[0192] 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.
[0193] 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.
[0194] The above-mentioned computer-readable storage medium carries one or more programs. When the above-mentioned one or more programs are executed by the lane matching device, the lane matching device: obtains the trajectory point coordinates of the trajectory points corresponding to each lane line in a preset number of continuous image frames, and performs thinning processing on the trajectory point coordinates to obtain the first trajectory point coordinates corresponding to each lane line; based on the first trajectory point coordinates, determines the horizontal coordinate span and the vertical coordinate span, and establishes a first two-dimensional grid based on the horizontal coordinate span and the vertical coordinate span; based on the first trajectory point coordinates, marks the lane number of the lane line in each grid of the first two-dimensional grid; based on the marked first two-dimensional grid, determines the association relationship between each lane line.
[0195] 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).
[0196] 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.
[0197] 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.
[0198] 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 above lane matching method, and can solve the technical problem of how to improve the accuracy of the association relationship between lane lines in different frames. 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 repeated here.
[0199] 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.
[0200] The computer program product provided by the present application can solve the technical problem of how to improve the accuracy of the association relationship between lane lines in different frames. Compared with the prior art, the beneficial effects of the computer program product provided by the embodiment of the present application are the same as the beneficial effects of the lane matching method provided by the above embodiment, which will not be repeated here.
[0201] 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: Acquire the trajectory point coordinates of the trajectory points corresponding to each lane line in a preset number of continuous image frames, and perform thinning processing on the trajectory point coordinates to obtain the first trajectory point coordinates corresponding to each lane line; Based on the coordinates of the first trajectory point, determine a horizontal coordinate span and a vertical coordinate span, and establish a first two-dimensional grid based on the horizontal coordinate span and the vertical coordinate span; Based on the first trajectory point coordinates, marking lane numbers of lane lines in each grid of the first two-dimensional grid; Based on the elements of the marked first two-dimensional grid, the association relationship between the lane lines is determined.
2. The lane matching method according to claim 1, characterized in that: The determining the association relationship between lane lines based on the elements of the marked first two-dimensional grid includes: Establishing a second two-dimensional grid based on the number of numbers corresponding to the lane numbers; Determine a first grid in which a plurality of lane numbers exist for elements of the grid in the first two-dimensional grid; 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; Based on the updated second two-dimensional grid, the association relationship between the lane lines is determined.
3. The lane matching method according to claim 2, characterized in that: The determining the association relationship between lane lines based on the updated second two-dimensional grid includes: 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; Determine a second element in the first element that is greater than a preset threshold; Based on the lane number of the second grid corresponding to the second element, an association relationship list corresponding to the target lane number is determined.
4. The lane matching method according to claim 3, characterized in that: After determining the association relationship list corresponding to the target lane number based on the lane number of the second grid corresponding to the second element, the lane matching method further includes: Determine whether there are multiple association relationship lists to be merged that have the same lane number in the association relationship lists corresponding to each lane number; If there is a list of association relationships to be merged, the list of association relationships to be merged is merged to obtain a target list of association relationships.
5. The lane matching method according to claim 1, characterized in that: The method of 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 includes: Rounding the coordinates of each first track point to obtain the coordinates of the second track point; Based on the second trajectory point coordinates, determining the trajectory point index of each trajectory point corresponding to the first trajectory point coordinates; Based on each trajectory point index, a lane number of each lane line is marked on each grid of the first two-dimensional grid.
6. The lane matching method according to claim 5, characterized in that: The method of marking lane numbers of lane lines in each grid of the first two-dimensional grid based on each trajectory point index includes: For each target track point index in the track point index, obtain the target lane number of the lane line to which the track point corresponding to the target track point index belongs; Determine a third grid corresponding to the target trajectory point index in the first two-dimensional grid; If the target lane number does not exist in the elements of the third grid, the target lane number is added to the elements of the third grid.
7. The lane matching method according to any one of claims 1 to 6, characterized in that: The step of 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 includes: In the coordinates of the first track points corresponding to each lane line, determine the maximum horizontal coordinate, the minimum horizontal coordinate, the maximum vertical coordinate and the minimum vertical coordinate; Determine the abscissa span based on the maximum abscissa and the minimum abscissa, and determine the ordinate span based on the maximum ordinate and the minimum ordinate; A first two-dimensional grid is established based on a preset grid spacing, the abscissa span, and the ordinate span.
8. The lane matching method according to claim 7, characterized in that: The 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, comprises: The maximum horizontal coordinate is rounded down and rounded up respectively, and the maximum value of the rounding results is used as the target maximum horizontal coordinate; The minimum horizontal coordinate is rounded down and rounded up respectively, and the minimum value of the rounding results is used as the target minimum horizontal coordinate; The maximum vertical coordinate is rounded down and rounded up respectively, and the maximum value of the rounding results is used as the target maximum vertical coordinate; The minimum ordinate is rounded down and rounded up respectively, and the minimum value of the rounding results is used as the target minimum ordinate; The abscissa span is determined based on the target maximum abscissa and the target minimum abscissa, and the ordinate span is determined based on the target maximum ordinate and the target minimum 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
Multi-sensor fusion road extraction and indexing method based on global and local grid maps
CN111273305A
Lane level fusion positioning method and system
CN114705199A