Lane line fitting method and apparatus, and device and storage medium
Through segmented fitting and smoothing based on second-order derivatives, the accuracy and smoothness issues of lane line fitting in complex scenarios are solved, improving the accuracy of autonomous driving and user experience.
Patent Information
- Application Number
- PCT/CN2024/125248
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2024-03-21
- Filing Date
- 2024-10-16
- Publication Date
- 2025-09-25
AI Technical Summary
Existing technologies have difficulty ensuring the accuracy and smoothness of lane line fitting in complex scenarios, especially when the entire lane line cannot be fitted with a cubic curve, which affects the accuracy of autonomous driving and user experience.
By obtaining vehicle posture information, determining the lane line point set, and determining the segmentation points based on the second-order derivative, the curve between adjacent segmentation points is fitted. Combined with matrix decomposition and least squares optimization, the initial lane line is smoothed to obtain the final lane line.
The accuracy and smoothness of lane line fitting are improved, making the lane lines more in line with the actual environment, improving the accuracy of autonomous driving and user experience.
Smart Images

Figure CN2024125248_25092025_PF_FP_ABST
Abstract
Description
Lane line fitting method, device, equipment and storage medium Technical Field
[0001] The present invention relates to the field of autonomous driving technology, and in particular to a lane line fitting method, device, equipment and storage medium. Background Art
[0002] High-precision vector maps are standard products in high-level assisted driving, providing strong support for vehicle planning and control, positioning and navigation, and environmental perception.
[0003] Lane lines are important elements in high-precision vector maps. When using high-precision vector maps, the accuracy, continuity and smoothness of lane lines are very important.
[0004] A common method for fitting lane lines is to use cubic curves. However, in complex scenarios, it may not be possible to fit the entire lane line with a single cubic curve. Ensuring the accuracy and smoothness of fitted lane lines has attracted the attention of autonomous driving practitioners.
[0005] Summary of the Invention
[0006] The present invention provides a lane line fitting method, apparatus, device and storage medium to ensure the accuracy and smoothness of the fitted lane line.
[0007] According to one aspect of the present invention, a lane line fitting method is provided, comprising:
[0008] Based on the vehicle posture information, obtain the lane line point set in the vehicle body coordinate system;
[0009] determining a second-order derivative of each lane line type point according to an arrangement order of the lane line type points in the lane line type point set, and determining a segmentation point in the lane line type point set based on the second-order derivative;
[0010] Fit the curve between adjacent segment points as the initial lane line;
[0011] The initial lane line is smoothed to obtain a final lane line.
[0012] According to another aspect of the present invention, a lane line fitting device is provided, comprising:
[0013] The lane point set acquisition module is used to obtain the lane line point set in the vehicle body coordinate system based on the vehicle posture information;
[0014] a segmentation point determination module, configured to determine a second-order derivative of each lane line type point according to an arrangement order of the lane line type points in the lane line type point set, and determine a segmentation point in the lane line type point set based on the second-order derivative;
[0015] The initial lane line fitting module is used to fit the curve between adjacent segment points as the initial lane line;
[0016] The final lane line determination module is used to smooth the initial lane line to obtain the final lane line.
[0017] According to another aspect of the present invention, an electronic device is provided, comprising:
[0018] at least one processor; and
[0019] a memory communicatively connected to the at least one processor; wherein,
[0020] The memory stores a computer program that can be executed by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can perform the lane line fitting method described in any embodiment of the present invention.
[0021] According to another aspect of the present invention, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the lane line fitting method described in any embodiment of the present invention when executed.
[0022] The technical solution of the embodiment of the present invention determines segmentation points in the lane line point set based on the second-order derivative of the lane line point, and performs curve fitting between adjacent segmentation points to achieve segmented fitting of the lane line based on the slope change rate of the lane line. This can improve the accuracy of lane line fitting, and smooth the initial lane line after fitting, so that the lane line can be smooth and continuous, and more in line with the actual environment.
[0023] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present invention, nor is it intended to limit the scope of the present invention. Other features of the present invention will become readily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0024] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0025] FIG1 is a flow chart of a lane line fitting method provided according to a first embodiment of the present invention;
[0026] FIG2a is a flow chart of a lane line fitting method provided in a second embodiment of the present invention;
[0027] FIG2 b is a schematic diagram showing an erroneous point included in a lane line point set according to a second embodiment of the present invention;
[0028] FIG2c is a schematic diagram of removing erroneous points from a lane line point set according to the second embodiment of the present invention;
[0029] FIG2 d is a schematic diagram of lane segmentation according to the second embodiment of the present invention;
[0030] FIG3a is a flow chart of a lane line fitting method provided in Embodiment 3 of the present invention;
[0031] FIG3 b is a flowchart of lane line fitting according to Embodiment 3 of the present invention;
[0032] FIG3c is a schematic diagram of coordinate transformation according to Embodiment 3 of the present invention;
[0033] FIG4 is a schematic structural diagram of a lane line fitting device provided according to a fourth embodiment of the present invention;
[0034] FIG5 is a schematic diagram of the structure of an electronic device for implementing the lane line fitting method according to the fifth embodiment of the present invention. DETAILED DESCRIPTION
[0035] In order to enable those skilled in the art to better understand the solutions of the present invention, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the embodiments described are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts should fall within the scope of protection of the present invention.
[0036] It should be noted that the terms "first", "second", etc. in the description and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that the numbers used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0037] Example 1
[0038] Figure 1 is a flow chart of a lane line fitting method according to a first embodiment of the present invention. This embodiment is applicable to situations where lane lines are fitted in segments. The method can be performed by a lane line fitting device, which can be implemented in the form of hardware and / or software and can be configured in various general-purpose computing devices. As shown in Figure 1, the method includes:
[0039] S110 . Based on the vehicle posture information, obtain a lane line point set in the vehicle body coordinate system.
[0040] Vehicle position information is used to represent the position and attitude of the vehicle. Vehicle position information includes the vehicle's position information and attitude information. For example, the vehicle position information can be the longitude, latitude, and heading angle of the vehicle's location obtained by the positioning device in the vehicle.
[0041] In this embodiment of the present invention, an Electronic Horizon Provider (EHP) extracts multiple lane lineament points for the vehicle's lane from a map database based on the vehicle's position information. Specifically, the EHP extracts multiple lane lineament points within a set distance along the vehicle's direction of travel, starting from the vehicle's current position within the lane, to form a lane lineament point set.
[0042] The lane line points extracted by EHP from the map database are all in the geographic coordinate system. To facilitate subsequent data processing, the extracted lane line points need to be mapped from the geographic coordinate system to the vehicle body coordinate system. Specifically, the lane line points can be first mapped from the geographic coordinate system to the Gaussian coordinate system, and then mapped from the Gaussian coordinate system to the vehicle body coordinate system.
[0043] In a specific example, based on the vehicle's current position and posture, EHP is used to retrieve lane line points from a map database. Specifically, multiple lane line points within a certain distance (e.g., 1000 meters) along the vehicle's travel direction are obtained from the vehicle's current position to form a lane line point set. Furthermore, the lane line points in the geographic coordinate system are mapped to the vehicle body coordinate system to obtain a lane line point set in the vehicle body coordinate system, facilitating subsequent data fitting.
[0044] It's worth noting that the original lane line point data in the map database may contain outliers. To ensure lane line fitting accuracy, after obtaining the lane line point set in the vehicle body coordinate system, these outliers can be removed. For example, the Random Sample Consensus (RANSAC) algorithm can be used to remove outliers from the lane line point set.
[0045] S120. Determine a second-order derivative of each lane line type point according to an arrangement order of the lane line type points in the lane line type point set, and determine a segmentation point in the lane line type point set based on the second-order derivative.
[0046] When the lane lines are complex, it may be impossible to describe the entire lane line with a single cubic curve. In order to improve the accuracy of lane line fitting, the lane line is fitted in sections.
[0047] In an embodiment of the present invention, the second-order derivative of each lane line type point is determined based on the order of the lane line type points in the lane line type point set. Furthermore, based on the second-order derivatives, a number of segmentation points are determined in the lane line type point set to divide the lane line into multiple segments, with a lane line segment being fitted between every two adjacent segmentation points. Specifically, lane line type points are sequentially extracted as the current lane line type point, and the two adjacent lane line type points before and after the current lane line type point are obtained based on the order of the lane line type points in the lane line type point set. Furthermore, the slope of two adjacent lane line type points among the three lane line type points is calculated, and the rate of change of the slope is then calculated as the second-order derivative of the current lane line type point.
[0048] Furthermore, the second-order derivative of the current lane line point is compared with a set threshold. If the second-order derivative is greater than the threshold, it indicates that the curvature of the lane line at the current lane line point has significantly changed. To ensure the accuracy of lane line fitting, the current lane line point is used as a segmentation point. Based on these segmentation points, the lane line is divided into multiple segments. Segmenting based on the second-order derivative of the lane line point allows for fewer segments on straight sections and more segments on curved sections, ensuring curve fitting efficiency while improving the accuracy of curve fitting on curved sections.
[0049] In a specific example, the lane line point set includes three lane line points, A, B, and C. When point B is the current lane line point, the slopes of the AB segment and the BC segment are calculated, and the rate of change between the two slopes is calculated as the second-order derivative of point B. The second-order derivative is then compared with a set threshold. If the value is greater than the threshold, point B is selected as a segmentation point.
[0050] S130: Fit a curve between adjacent segment points as an initial lane line.
[0051] In an embodiment of the present invention, a curve between adjacent segmentation points is fitted based on the lane line points between adjacent segmentation points and two adjacent segmentation points to serve as the initial lane line. Specifically, matrix decomposition can be used to perform curve fitting to obtain the initial lane line. Curves fitted using matrix decomposition may have large errors. Therefore, the least squares method can also be used to perform curve fitting to obtain the initial lane line. Directly using the least squares method for curve fitting is computationally intensive and prone to falling into local optimality. Therefore, it is also possible to first perform curve fitting using matrix decomposition to obtain preliminary curve coefficients, and then use the least squares method to adjust the preliminary curve coefficients of the fitted curve to obtain the initial lane line. This improves computational efficiency while avoiding falling into local optimality.
[0052] S140: Smoothing the initial lane line to obtain the final lane line.
[0053] In S130, each lane segment is fitted separately. During this segment-by-segment fitting process, only the lane accuracy within each segment is considered, without considering the continuity and smoothness of the entire lane. If the transition between segments is not smooth, it will affect the user experience.
[0054] In the embodiment of the present invention, after fitting each segmented lane line to obtain multiple segments of initial lane lines, the initial lane lines are further optimized based on the idea of global optimization to achieve a smooth transition between segments.
[0055] Specifically, the first-order derivative and second-order derivative of each initial lane line at the segmentation point can be calculated. For the difference between the first-order derivative and the second-order derivative of the same segmentation point in two different initial lane lines, the least squares method is used to optimize the curve coefficient of the initial lane line to obtain the optimized final lane line.
[0056] Alternatively, the second-order derivatives of the segmentation point at each of the two lane lines with the current segmentation point as its endpoint are calculated and the average of the second-order derivatives is calculated. If the average second-order derivative is less than or equal to K1, the slope change rate at that point is considered small, and the probability of fitting errors is low. In this case, to reduce the computational complexity, the first-order derivative of the current segmentation point in the two connected initial lane lines is used as the optimization index parameter. If the average second-order derivative is greater than K1 and less than K2 (K2>K1), the slope change rate at that point is considered large, and the probability of fitting errors is high. In this case, the first-order and second-order derivatives of the current segmentation point in the two connected initial lane lines are used as the optimization index parameters. If the average second-order derivative is equal to or greater than K2, the slope change rate at that point is considered large, and the probability of an uneven transition between the two initial lane lines is high. In this case, the second-order derivative of the two connected initial lane lines is used as the optimization index parameter. Finally, based on the optimization index parameters of each segmentation point, the least squares method is used for optimization to obtain the optimized final lane line.
[0057] The technical solution of the embodiment of the present invention determines segmentation points in the lane line point set based on the second-order derivative of the lane line point, and performs curve fitting between adjacent segmentation points to achieve segmented fitting of the lane line based on the slope change rate of the lane line. This can improve the accuracy of lane line fitting, and smooth the initial lane line after fitting, so that the lane line can be smooth and continuous, and more in line with the actual environment.
[0058] Example 2
[0059] Figure 2a is a flow chart of a lane line fitting method provided in Example 2 of the present invention. This embodiment further refines the above-mentioned embodiment and provides specific steps for determining segmentation points in a lane line point set based on second-order derivatives, and fitting curves between adjacent segmentation points as initial lane lines. As shown in Figure 2a, the method includes:
[0060] S210: Based on the vehicle posture information, obtain a lane line point set in the vehicle body coordinate system.
[0061] S220: Using the random sample consensus RANSAC algorithm, remove erroneous points from the lane line point set.
[0062] In this embodiment of the present invention, as shown in Figure 2b , the lane line point set obtained in S210 may contain erroneous points that affect lane line fitting accuracy. To ensure lane line fitting accuracy, the Random Sample Consensus (RANSAC) algorithm is used before lane line fitting to remove erroneous points from the lane line point set, resulting in the lane line point set shown in Figure 2c .
[0063] S230. Determine the second-order derivative of each lane line type point according to the arrangement order of the lane line type points in the lane line type point set.
[0064] S240 , sequentially extracting lane line-type points from the lane line-type point set as current lane line-type points, and comparing the second-order derivative of the current lane line-type point with a set threshold.
[0065] In an embodiment of the present invention, lane line type points in the lane line type point set are extracted in sequence as the current lane line type point, and then the second-order derivative of the current lane line type point is compared with a set threshold to determine the slope change rate of the lane line at the current lane line type point, thereby adaptively adjusting the segmentation method of the lane line according to the slope change rate.
[0066] S250: When the second-order derivative of the current lane line point is greater than a set threshold, determine the current lane line point as a segmentation point.
[0067] In this embodiment of the present invention, if the second-order derivative of the current lane line point exceeds a set threshold, it indicates that the rate of change of the lane line slope at the current lane line point is large, making fitting errors more likely. To reduce fitting errors, the lane line is segmented using the current lane line point as a segmentation point. Segmenting at lane line points where the second-order derivative exceeds the threshold can achieve the effect of fewer segments for straight sections and more segments for curved sections, thereby improving fitting efficiency for straight sections and improving fitting accuracy for curved sections.
[0068] S260. Fitting a curve between adjacent segment points by matrix decomposition to obtain an initial curve.
[0069] In an embodiment of the present invention, after the lane lines are segmented, a curve between adjacent lane lines is fitted based on adjacent segmentation points and other lane line points between the adjacent segmentation points by means of matrix decomposition to obtain an initial curve.
[0070] S270: Use the least squares method to adjust the initial curve to obtain an initial lane line.
[0071] In this embodiment of the present invention, based on the initial curve obtained in S260, the least squares method is further used to adjust the initial curve to obtain initial lane lines to improve fitting accuracy. Specifically, the least squares method is used to optimize the curve coefficients in the initial curve to minimize the sum of squared errors between the actual and calculated values of the lane line points in the lane line point set. This quadratic adjustment using the least squares method improves the fitting accuracy of each initial lane line segment.
[0072] As shown in Figure 2d, in the lane line point set, if the second-order derivatives of point M and point N are greater than the set threshold, they are used as segmentation points, and the lane line is divided into PM segment, MN segment and NQ segment, and fitted separately to obtain the initial lane line.
[0073] S280: Smooth the initial lane line to obtain the final lane line.
[0074] The technical solution of the embodiment of the present invention is to use the RANSAC algorithm to eliminate erroneous points in the lane line point set after obtaining the lane line point set in the vehicle body coordinate system, thereby avoiding the influence of erroneous points on lane line fitting, and using lane line points whose second-order derivatives are greater than a set threshold as segmentation points to achieve fewer segments for straight sections and more segments for curved sections, thereby improving the fitting accuracy of curved sections while reducing the amount of calculation, and for each lane line segment, after fitting by using the matrix decomposition method, continuing to adjust it using the least squares method, thereby reducing the amount of fitting calculation, thereby avoiding the fitted curve coefficient from falling into the local optimum, thereby further improving the accuracy of the fitted lane line.
[0075] Example 3
[0076] Figure 3a is a flow chart of a lane line fitting method provided by the third embodiment of the present invention. This embodiment further refines the above embodiment and provides specific steps for obtaining a lane line point set in the vehicle body coordinate system based on vehicle posture information, as well as specific steps for smoothing the initial lane line to obtain the final lane line. As shown in Figure 3a, the method includes:
[0077] S310 . Within the lane where the vehicle is located, taking the current position of the vehicle as a starting point, obtain lane line points in the geographic coordinate system within a set distance along the direction of vehicle travel.
[0078] In this embodiment of the present invention, the lane fitting process is shown in Figure 3b. Within the vehicle's lane, EHP uses the vehicle's current position as the starting point to retrieve lane line points in the geographic coordinate system within a set distance along the vehicle's travel direction from the map database. For example, within the vehicle's lane, multiple lane line points within 1000 meters ahead of the vehicle along the vehicle's travel direction are retrieved for lane fitting.
[0079] S320: Determine the target map grid to which the lane line point in the geographic coordinate system belongs, and map the lane line point in the geographic coordinate system to the Gaussian coordinate system based on the coordinate conversion value associated with the target map grid.
[0080] The coordinate conversion value is obtained by dividing the earth's latitude into multiple map grids and calculating based on the longitude and latitude coordinates of the map grids.
[0081] In summary, in the embodiments of the present invention, after the lane line points in the geographic coordinate system are extracted, in order to facilitate subsequent calculations, it is necessary to map the lane line points in the geographic coordinate system to the vehicle body coordinate system. However, since the frequency of sending and calculating map data is high, and the number of lane line points is large, in order to improve the calculation efficiency, it is necessary to speed up the rate of coordinate conversion. Since the coordinate conversion matrix under the latitude and longitude coordinates (the coordinate conversion matrix of the latitude and longitude coordinates converted to Gaussian coordinates) is only related to the latitude, in order to speed up the coordinate conversion, the earth is gridded in advance. For example, for the northern hemisphere, the latitude from 0 degrees to 90 degrees is divided into 256 equal parts, and the coordinate conversion value of each coordinate point is pre-calculated (that is, the coordinate value of the point in the Gaussian coordinate system).
[0082] Specifically, as shown in Figure 3c, when calculating the coordinate conversion value of point X between points A and B, the coordinate value of point X is calculated based on the ratio of the distances from point X to points A and B, i.e., (XA) / a = (BA) / (a+b), where A represents the coordinate value of point A in the Gaussian coordinate system, B represents the coordinate value of point B in the Gaussian coordinate system, a represents the distance from point X to point A, and b represents the distance from point X to point B. This yields the coordinate value of point X in the Gaussian coordinate system. Using this dictionary lookup method improves coordinate conversion efficiency, thereby improving lane line fitting efficiency.
[0083] S330 : Based on the vehicle posture information, map the lane line points in the Gaussian coordinate system to the vehicle body coordinate system to obtain a lane line point set in the vehicle body coordinate system.
[0084] In an embodiment of the present invention, a vehicle body coordinate system is established based on the vehicle posture information, and the coordinate values in the Gaussian coordinate system are mapped to the vehicle body coordinate system to obtain a set of lane line points in the vehicle body coordinate system. This greatly improves the computational efficiency of converting a large number of lane line points to the vehicle body coordinate system.
[0085] S340: Use the random sample consensus RANSAC algorithm to remove erroneous points in the lane line point set.
[0086] S350. Determine the second-order derivative of each lane line-type point according to the arrangement order of the lane line-type points in the lane line-type point set, extract lane line-type points from the lane line-type point set in turn as the current lane line-type point, and compare the second-order derivative of the current lane line-type point with a set threshold.
[0087] S360: When the second-order derivative of the lane line point is greater than a set threshold, determine that the current lane line point is a segmentation point.
[0088] S370. Fitting a curve between adjacent segment points by matrix decomposition to obtain an initial curve.
[0089] S380: Use the least squares method to adjust the initial curve to obtain an initial lane line.
[0090] S390: traverse the segmentation points in the lane line point set, and calculate the first-order derivative and the second-order derivative of the current segmentation point in the two initial lane lines connected by the current segmentation point.
[0091] Because the above process performs segmented lane line fitting, only the accuracy and smoothness of the lane lines within a segment are considered during the fitting process, without considering the smooth connection between segments. Therefore, the resulting initial lane lines may have uneven transitions between segments, affecting the user experience. In this embodiment of the present invention, the initial lane lines are globally optimized to ensure smoothness between segments, ensuring a continuous and smooth lane line throughout.
[0092] Specifically, the system first traverses the segmentation points in the lane line point set and extracts one segmentation point at a time as the current segmentation point. It then determines two initial lane lines with the current segmentation point as their endpoints. The first and second derivatives of the two initial lane lines at the current segmentation point are calculated and used as optimization parameters to adjust the initial lane lines.
[0093] S391. Based on the first-order derivative and second-order derivative of each segment point in the two connected initial lane lines, use the least squares method to smooth the initial lane line to obtain the final lane line.
[0094] In this embodiment of the present invention, the initial lane line is smoothed using the least squares method based on the first-order and second-order derivatives of each segmentation point in the two connected initial lane lines to obtain the final lane line. Specifically, the difference between the first-order and second-order derivatives of each segmentation point in the two connected lane lines is calculated, and the sum of the squares of the first-order and second-order derivative differences at all segmentation points is minimized to obtain the final lane line.
[0095] Specifically, the mean of the second-order derivatives of the segmentation point in the two connected initial lane lines can be calculated to determine the slope change rate at the segmentation point. When the mean of the second-order derivatives of the current segmentation point is greater than the threshold, it indicates that the slope change rate at the current segmentation point is large, and the smoothness at this point needs to be optimized. Therefore, the difference between the second-order derivatives of the current segmentation point in the two connected initial lane lines is used as the error value. When the mean of the second-order derivatives of the current segmentation point is less than the threshold, it indicates that the slope change rate at the current segmentation point is small, and the fitting accuracy rather than the smoothness needs to be focused on. Therefore, the difference between the first-order derivatives of the current segmentation point in the two connected initial lane lines is used as the error value. Finally, the least squares method is used to minimize the sum of the squares of the error values at each segmentation point to obtain the final lane line.
[0096] Optionally, based on the first-order derivative and second-order derivative of each segment point in the two connected initial lane lines, the initial lane line is smoothed using the least squares method to obtain the final lane line, including:
[0097] Traverse the segmentation points in the lane line point set and calculate the average of the second-order derivatives of the current segmentation point in the two connected initial lane lines as the average second-order derivative of the current segmentation point;
[0098] When the average second-order derivative of the current segmentation point is less than or equal to the first value, the first-order derivative of the segmentation point in the two connected initial lane lines is used as the optimization index parameter of the current segmentation point;
[0099] When the average second-order derivative of the current segmentation point is greater than a first value and less than a second value, the first-order derivative and the second-order derivative of the current segmentation point in the two connected initial lane lines are used as optimization index parameters of the current segmentation point; the first value is less than the second value;
[0100] When the average second-order derivative of the current segmentation point is equal to or greater than the second data value, the second-order derivative of the current segmentation point in the two connected initial lane lines is used as the optimization index parameter of the current segmentation point;
[0101] Based on the optimized index parameters of each segmentation point, the initial lane line is smoothed using the least squares method to obtain the final lane line.
[0102] In this optional embodiment, a specific method is provided for smoothing the initial lane line using the least squares method based on the first-order derivative and second-order derivative of each segmentation point in the two connected initial lane lines to obtain the final lane line: first, traverse the segmentation points in the lane line point set, take the extracted segmentation points as the current segmentation point in turn, and calculate the average of the second-order derivatives of the current segmentation point in the two connected initial lane lines as the average second-order derivative of the current segmentation point. Furthermore, when the average second-order derivative of the current segmentation point is less than or equal to the first value, it is considered that the slope change rate of the current segmentation point is small, and the possibility of non-smoothness between the two segments is small. Therefore, using the first-order derivative of the segmentation point in the two connected initial lane lines as the optimization index parameter of the current segmentation point can improve the computational efficiency of the optimization process; when the average second-order derivative of the current segmentation point is greater than the first value and less than the second value, it is considered that the slope change rate of the current segmentation point is large, and it is necessary to consider both the fitting accuracy and smoothness at this point. Therefore, The first-order and second-order derivatives of the previous segmentation point in the two connected initial lane lines are used as optimization index parameters for the current segmentation point to ensure the accuracy and smoothness of the optimized lane line. The first value is less than the second value. If the average second-order derivative of the current segmentation point is equal to or greater than the second data value, it is considered that the slope change rate of the current segmentation point is large, and the smoothness of the current segmentation point requires special attention. Therefore, using the second-order derivative of the current segmentation point in the two connected initial lane lines as the optimization index parameter for the current segmentation point can improve the smoothness of the current segmentation point. Finally, based on the optimized index parameters of each segmentation point, the initial lane line is smoothed using the least squares method to obtain the final lane line. Specifically, the difference between the optimized index parameters of each segmentation point in the two connected initial lane lines is calculated, and the sum of the squares of these differences is calculated. The least squares method is used to minimize the sum of squares to obtain the final lane line.
[0103] In a specific example, a lane line includes segmentation points A, B, and C. The average second-order derivative of each segmentation point in the two connected initial lane line segments is calculated. The average second-order derivative of segmentation point A is less than a first value, the average second-order derivative of segmentation point B is greater than the first value and less than a second value, and the average second-order derivative of segmentation point C is greater than the second value. Furthermore, the first-order derivative of segmentation point A in the two connected initial lane line segments is calculated, and the difference between the first-order derivatives in the two segments is calculated; the first-order and second-order derivatives of segmentation point B in the two connected initial lane line segments are calculated, and the difference between the first-order derivatives and the second-order derivatives in the two lane line segments is calculated; the second-order derivative of segmentation point C in the two connected initial lane line segments is calculated, and the difference between the second-order derivatives in the two segments is calculated. Finally, the least squares method is used to minimize the sum of the squares of all the above differences to obtain the optimized final lane line.
[0104] This global optimization method, which uses the average second-order derivative to determine the optimization parameters to be considered, allows for flexible adjustment of the optimization parameters based on the slope change rate at different segmentation points. This improves computational efficiency while ensuring the accuracy and smoothness of the final lane line fitting after optimization.
[0105] The technical solution of the embodiment of the present invention maps the coordinates of lane line points to a Gaussian coordinate system using a map grid obtained by pre-gridding the earth, thereby improving the efficiency of coordinate transformation. In addition, based on the first-order and second-order derivatives of each segment point in the lane line point set in the two connected initial lane lines, the initial lane lines are smoothed to obtain the final lane lines, making the junctions between the segmented lane lines smoother and more continuous, thereby improving the user experience.
[0106] Example 4
[0107] FIG4 is a schematic diagram of the structure of a lane line fitting device provided by the fourth embodiment of the present invention. As shown in FIG4 , the device includes:
[0108] A lane point set acquisition module 410 is used to acquire a lane line point set in a vehicle body coordinate system based on the vehicle posture information;
[0109] a segmentation point determination module 420 for determining a second-order derivative of each lane line type point according to an arrangement order of the lane line type points in the lane line type point set, and determining a segmentation point in the lane line type point set based on the second-order derivative;
[0110] An initial lane line fitting module 430 is used to fit a curve between adjacent segment points as an initial lane line;
[0111] The final lane line determination module 440 is configured to smooth the initial lane line to obtain a final lane line.
[0112] The technical solution of the embodiment of the present invention determines segmentation points in the lane line point set based on the second-order derivative of the lane line point, and performs curve fitting between adjacent segmentation points to achieve segmented fitting of the lane line based on the slope change rate of the lane line. This can improve the accuracy of lane line fitting, and smooth the initial lane line after fitting, so that the lane line can be smooth and continuous, and more in line with the actual environment.
[0113] Optionally, the type point set acquisition module 410 is specifically configured to:
[0114] In the lane where the vehicle is located, starting from the vehicle's current position, obtain the lane line points in the geographic coordinate system within a set distance along the vehicle's travel direction;
[0115] Determining a target map grid to which the lane line point belongs in the geographic coordinate system, and mapping the lane line point in the geographic coordinate system to a Gaussian coordinate system based on a coordinate conversion value associated with the target map grid;
[0116] The coordinate conversion value is obtained by dividing the earth's latitude into a plurality of map grids and calculating based on the longitude and latitude coordinates of the map grids;
[0117] Based on the vehicle posture information, the lane line points in the Gaussian coordinate system are mapped to the vehicle body coordinate system to obtain the lane line point set in the vehicle body coordinate system.
[0118] Optionally, the segmentation point determination module 420 is specifically configured to:
[0119] Sequentially extract lane line points from the lane line point set as the current lane line point, and compare the second-order derivative of the current lane line point with the set threshold;
[0120] When the second-order derivative of the current lane line point is greater than a set threshold, the current lane line point is determined to be a segmentation point.
[0121] Optionally, the initial lane line fitting module 430 is specifically configured to:
[0122] Fit the curve between adjacent segment points by matrix decomposition to obtain the initial curve;
[0123] The initial curve is adjusted using the least squares method to obtain the initial lane line.
[0124] Optionally, the final lane line determination module 440 includes:
[0125] A derivative calculation unit is used to traverse the segmentation points in the lane line point set and calculate the first-order derivative and the second-order derivative of the current segmentation point in the two initial lane lines connected by the current segmentation point;
[0126] The final lane line determination unit is used to smooth the initial lane line using the least squares method based on the first-order derivative and second-order derivative of each segment point in the two connected initial lane lines to obtain the final lane line.
[0127] Optionally, the final lane line determination unit is specifically used to:
[0128] Traverse the segmentation points in the lane line point set and calculate the average of the second-order derivatives of the current segmentation point in the two connected initial lane lines as the average second-order derivative of the current segmentation point;
[0129] When the average second-order derivative of the current segmentation point is less than or equal to the first value, the first-order derivative of the segmentation point in the two connected initial lane lines is used as the optimization index parameter of the current segmentation point;
[0130] When the average second-order derivative of the current segmentation point is greater than a first value and less than a second value, the first-order derivative and the second-order derivative of the current segmentation point in the two connected initial lane lines are used as optimization index parameters of the current segmentation point; the first value is less than the second value;
[0131] When the average second-order derivative of the current segmentation point is equal to or greater than the second data value, the second-order derivative of the current segmentation point in the two connected initial lane lines is used as the optimization index parameter of the current segmentation point;
[0132] Based on the optimized index parameters of each segmentation point, the initial lane line is smoothed using the least squares method to obtain the final lane line.
[0133] Optionally, the lane line fitting device further includes:
[0134] an error point removal module for removing error points from the lane line type point set by using a random sample consensus RANSAC algorithm before determining the second-order derivative of each lane line type point according to the arrangement order of the lane line type points in the lane line type point set;
[0135] The lane line fitting device provided in the embodiment of the present invention can execute the lane line fitting method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.
[0136] Example 5
[0137] FIG5 shows a block diagram of an electronic device 10 that can be used to implement an embodiment of the present invention. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.) and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present invention described and / or required herein.
[0138] As shown in FIG5 , the electronic device 10 includes at least one processor 11 and a memory, such as a read-only memory (ROM) 12 and a random access memory (RAM) 13, that is communicatively connected to the at least one processor 11. The memory stores a computer program that can be executed by the at least one processor, and the processor 11 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 12 or the computer program loaded from the storage unit 18 into the random access memory (RAM) 13. Various programs and data required for the operation of the electronic device 10 can also be stored in the RAM 13. The processor 11, ROM 12, and RAM 13 are connected to each other via a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.
[0139] Multiple components in the electronic device 10 are connected to the I / O interface 15, including an input unit 16, such as a keyboard, a mouse, etc.; an output unit 17, such as various types of displays, speakers, etc.; a storage unit 18, such as a magnetic disk, an optical disk, etc.; and a communication unit 19, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information / data with other devices via a computer network such as the Internet and / or various telecommunication networks.
[0140] The processor 11 can be any general-purpose and / or specialized processing component with processing and computing capabilities. Some examples of the processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various specialized artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any other suitable processor, controller, microcontroller, etc. The processor 11 executes the various methods and processes described above, such as the lane fitting method.
[0141] In some embodiments, the lane fitting method can be implemented as a computer program tangibly embodied in a computer-readable storage medium, such as storage unit 18. In some embodiments, part or all of the computer program can be loaded and / or installed on electronic device 10 via ROM 12 and / or communication unit 19. When the computer program is loaded into RAM 13 and executed by processor 11, one or more steps of the lane fitting method described above can be performed. Alternatively, in other embodiments, processor 11 can be configured to perform the lane fitting method in any other appropriate manner (e.g., via firmware).
[0142] Various embodiments of the systems and techniques described above can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), system-on-chip systems (SOCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments can include being implemented in one or more computer programs that are executable and / or interpreted on a programmable system that includes at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0143] Computer programs for implementing the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, such that when the computer program is executed by the processor, the functions / operations specified in the flowcharts and / or block diagrams are implemented. The computer program may be executed entirely on the machine, partially on the machine, as a stand-alone software package, partially on the machine and partially on a remote machine, or entirely on a remote machine or server.
[0144] In the context of the present invention, computer-readable storage media can be tangible media that can contain or store a computer program for use with an instruction execution system, device or equipment or used in combination with an instruction execution system, device or equipment. Computer-readable storage media can include but are not limited to electronic, magnetic, optical, electromagnetic, infrared or semiconductor systems, devices or equipment, or any suitable combination of the foregoing. Alternatively, computer-readable storage media can be machine-readable signal media. More specific examples of machine-readable storage media can include electrical connections based on one or more lines, portable computer disks, hard disks, random access memories (RAM), read-only memories (ROM), erasable programmable read-only memories (EPROM or flash memory), optical fibers, portable compact disk read-only memories (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.
[0145] To provide interaction with a user, the systems and techniques described herein can be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the electronic device. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).
[0146] The systems and techniques described herein can be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., a user computer with a graphical user interface or web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such back-end components, middleware components, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.
[0147] A computing system may include clients and servers. The clients and servers are typically remote from each other and typically interact via a communication network. This client-server relationship arises through computer programs running on the respective computers, creating a client-server relationship. The server may be a cloud server, also known as a cloud computing server or cloud host. This server is a hosting product within the cloud computing service ecosystem that addresses the management difficulties and limited scalability of traditional physical hosting and VPS services.
[0148] It should be understood that the various forms of the processes shown above can be used to reorder, add, or delete steps. For example, the steps described in the present invention can be performed in parallel, sequentially, or in a different order, as long as the desired results of the technical solution of the present invention can be achieved. This is not limited herein.
[0149] The above specific embodiments do not limit the scope of protection of the present invention. Those skilled in the art will appreciate that various modifications, combinations, sub-combinations, and substitutions may be made based on design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of the present invention are intended to be included within the scope of protection of the present invention.
Claims
1. A lane line fitting method, characterized in that: include: Based on the vehicle posture information, obtain the lane line point set in the vehicle body coordinate system; determining a second-order derivative of each lane line type point according to an arrangement order of the lane line type points in the lane line type point set, and determining a segmentation point in the lane line type point set based on the second-order derivative; Fit the curve between adjacent segment points as the initial lane line; The initial lane line is smoothed to obtain a final lane line.
2. The method according to claim 1, characterized in that The method of obtaining a lane line point set in a vehicle body coordinate system based on the vehicle posture information includes: In the lane where the vehicle is located, starting from the vehicle's current position, obtain the lane line points in the geographic coordinate system within a set distance along the vehicle's travel direction; Determining a target map grid to which the lane line point belongs in the geographic coordinate system, and mapping the lane line point in the geographic coordinate system to a Gaussian coordinate system based on a coordinate conversion value associated with the target map grid; The coordinate conversion value is obtained by dividing the earth's latitude into a plurality of map grids and calculating based on the longitude and latitude coordinates of the map grids; Based on the vehicle posture information, the lane line points in the Gaussian coordinate system are mapped to the vehicle body coordinate system to obtain the lane line point set in the vehicle body coordinate system.
3. The method according to claim 1, characterized in that The determining of segmentation points in the lane line point set based on the second-order derivative includes: Sequentially extract lane line points from the lane line point set as the current lane line point, and compare the second-order derivative of the current lane line point with the set threshold; When the second-order derivative of the current lane line point is greater than a set threshold, the current lane line point is determined to be a segmentation point.
4. The method according to claim 1, wherein The step of fitting a curve between adjacent segment points as an initial lane line includes: Fit the curve between adjacent segment points by matrix decomposition to obtain the initial curve; The initial curve is adjusted using the least squares method to obtain the initial lane line.
5. The method according to claim 1, wherein The smoothing of the initial lane line to obtain the final lane line includes: Traverse the segmentation points in the lane line point set, and calculate the first-order derivative and second-order derivative of the current segmentation point in the two initial lane lines connected by the current segmentation point; Based on the first-order derivative and second-order derivative of each segment point in the two connected initial lane lines, the initial lane lines are smoothed using the least squares method to obtain the final lane lines.
6. The method according to claim 5, characterized in that The method of smoothing the initial lane line using the least squares method based on the first-order derivative and the second-order derivative of each segment point in the two connected initial lane lines to obtain the final lane line includes: Traverse the segmentation points in the lane line point set and calculate the average of the second-order derivatives of the current segmentation point in the two connected initial lane lines as the average second-order derivative of the current segmentation point; When the average second-order derivative of the current segmentation point is less than or equal to the first value, the first-order derivative of the segmentation point in the two connected initial lane lines is used as the optimization index parameter of the current segmentation point; When the average second-order derivative of the current segmentation point is greater than a first value and less than a second value, the first-order derivative and the second-order derivative of the current segmentation point in the two connected initial lane lines are used as optimization index parameters of the current segmentation point; the first value is less than the second value; When the average second-order derivative of the current segmentation point is equal to or greater than the second data value, the second-order derivative of the current segmentation point in the two connected initial lane lines is used as the optimization index parameter of the current segmentation point; Based on the optimized index parameters of each segmentation point, the initial lane line is smoothed using the least squares method to obtain the final lane line.
7. The method according to any one of claims 1 to 6, characterized in that: Before determining the second-order derivative of each lane line-type point according to the arrangement order of the lane line-type points in the lane line-type point set, the method further includes: The random sample consensus RANSAC algorithm is used to remove erroneous points in the lane line point set.
8. A lane line fitting device, characterized in that: include: The lane point set acquisition module is used to obtain the lane line point set in the vehicle body coordinate system based on the vehicle posture information; a segmentation point determination module, configured to determine a second-order derivative of each lane line type point according to an arrangement order of the lane line type points in the lane line type point set, and determine a segmentation point in the lane line type point set based on the second-order derivative; The initial lane line fitting module is used to fit the curve between adjacent segment points as the initial lane line; The final lane line determination module is used to smooth the initial lane line to obtain the final lane line.
9. An electronic device, characterized in that: The electronic device comprises: at least one processor; and a memory communicatively connected to the at least one processor; wherein, The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can perform the lane fitting method according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the lane line fitting method according to any one of claims 1 to 7 when executed.
Citation Information
Patent Citations
Lane line processing method and device, electronic equipment and storage medium
CN112560680A
Cognitive map construction method and device, equipment and medium
CN113836251A
Lane line data processing method and device, electronic equipment and storage medium
CN115422316A
Lane line fitting method, electronic equipment and storage medium
CN116152764A
Lane line fitting method, device and equipment and storage medium
CN118172440A