Lane line generation method and device, computer device and storage medium
By sampling and interpolating the lane line fitting curve, and combining distance, smoothness, and consistency constraints for nonlinear optimization, the target lane line is generated, solving the problems of inaccurate and unsmooth lane line generation, and achieving high-precision and smooth lane line generation.
Patent Information
- Application Number
- CN202211041051.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-08-29
- Publication Date
- 2026-02-06
- Estimated Expiration
- 2042-08-29
AI Technical Summary
In existing technologies, lane line generation suffers from inaccuracy and unevenness, especially when vehicles or obstacles obstruct the view, leading to inaccurate and uneven lane line generation.
By obtaining the fitted curve of the initial lane line, sampling is performed to obtain the fitted sampling point sequence, and interpolation is performed to obtain the second sampling point sequence. Distance constraints related to physical distance, smoothness constraints related to smoothness, and consistency constraints are set, an error loss function is constructed, nonlinear optimization is performed, the target sampling point sequence is generated, and finally the target lane line is generated.
It improves the accuracy and smoothness of lane lines, ensuring that the generated lane lines maintain high precision and smoothness in complex environments.
Smart Images

Figure CN115376087B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of artificial intelligence, and in particular to a lane line generation method and device, computer equipment and a storage medium. BACKGROUND
[0002] With the development of artificial intelligence, automatic driving technology is becoming mature, and automatic driving highly depends on semantic maps. The semantic maps have traffic element information such as roads, traffic signs, lane lines, and obstacles, which are used to control the steering, speed, and path planning of vehicles.
[0003] In the traditional technology, lane lines are obtained by processing road information collected by vehicle-mounted sensors and other devices. Due to the obstruction of vehicles or obstacles, the generated lane lines are not accurate and smooth. SUMMARY
[0004] Therefore, it is necessary to provide a lane line generation method, device, computer equipment and computer readable storage medium capable of improving the accuracy and smoothness of lane lines to solve the above technical problems.
[0005] In a first aspect, the present application provides a lane line generation method. The method comprises:
[0006] obtaining an initial fitting curve corresponding to an initial lane line, and sampling the initial fitting curve to obtain a fitting sample point sequence;
[0007] interpolating the fitting sample point sequence to obtain a second sample point sequence;
[0008] setting a distance constraint related to a physical distance, a smoothness constraint related to smoothness, and a consistency constraint, and obtaining an error loss function based on the distance constraint, the smoothness constraint, and the consistency constraint;
[0009] nonlinearly optimizing the second sample point sequence based on the error loss function to obtain a target sample point sequence;
[0010] generating a target lane line based on the target sample point sequence.
[0011] In one embodiment, the setting of the distance constraint related to the physical distance, the smoothness constraint related to the smoothness, and the consistency constraint comprises:
[0012] setting a plurality of second sample points in the second sample point sequence as an initial sample point sequence, setting a corresponding variable sample point for each initial sample point in the initial sample point sequence, and a plurality of the variable sample points forming a variable sample point sequence;
[0013] performing distance calculation on the initial sampling point in the initial sampling point sequence and the variable sampling point corresponding to the initial sampling point to obtain a physical distance, and performing distance constraint based on the physical distance;
[0014] performing smoothing calculation on the variable sampling point to obtain a smoothing degree, and performing smoothing constraint and consistency constraint based on the smoothing degree.
[0015] In one embodiment, the smoothing calculation on the variable sampling point to obtain the smoothing degree comprises:
[0016] obtaining a current variable sampling point, a first variable sampling point and a second variable sampling point, the first variable sampling point being a previous adjacent variable sampling point of the current variable sampling point, and the second variable sampling point being a next adjacent variable sampling point of the current variable sampling point;
[0017] calculating a difference value between the first variable sampling point and the current variable sampling point to obtain a first vector;
[0018] calculating a difference value between the second variable sampling point and the current variable sampling point to obtain a second vector;
[0019] obtaining the smoothing degree corresponding to the current variable sampling point based on the first vector and the second vector.
[0020] In one embodiment, the obtaining the smoothing degree corresponding to the current variable sampling point based on the first vector and the second vector comprises:
[0021] fusing the first vector and the second vector to obtain a fusion result;
[0022] respectively performing length calculation on the first vector and the second vector to obtain a first length and a second length;
[0023] obtaining the smoothing degree corresponding to the current variable sampling point based on the fusion result, the first length and the second length.
[0024] In one embodiment, the obtaining the smoothing constraint and the consistency constraint based on the smoothing degree comprises:
[0025] performing statistics on the smoothing degree corresponding to each current variable sampling point to obtain the smoothing constraint;
[0026] performing addition on the smoothing degrees corresponding to two adjacent current variable sampling points to obtain an accumulated smoothing degree;
[0027] performing statistics on each accumulated smoothing degree to obtain the consistency constraint.
[0028] In one embodiment, the obtaining an initial fitting curve corresponding to the initial lane line, and sampling the initial fitting curve to obtain a fitting sample point sequence comprises:
[0029] obtaining an initial fitting curve corresponding to the initial lane line, and start point information and end point information of the initial lane line;
[0030] solving a curvature corresponding to the initial fitting curve, and determining a target number of sampling based on the curvature;
[0031] calculating a sampling interval based on the target number, the start point information, and the end point information;
[0032] sampling the initial fitting curve based on the sampling interval to obtain a fitting sample point sequence.
[0033] In one embodiment, the interpolating the fitting sample point sequence to obtain a second sample point sequence comprises:
[0034] inserting an external interpolation point in a direction in which a second fitting sample point in the fitting sample point sequence points to a first fitting sample point, and inserting an external interpolation point in a direction in which a second end fitting sample point in the fitting sample point sequence points to a first end fitting sample point;
[0035] based on an interpolation distance between any two adjacent fitting sample points in the fitting sample point sequence, performing Bezier curve interpolation between the any two adjacent fitting sample points to obtain an internal interpolation point;
[0036] obtaining a second sample point sequence based on the fitting sample point sequence, the external interpolation point, and the internal interpolation point.
[0037] In one embodiment, the performing Bezier curve interpolation between the any two adjacent fitting sample points in the fitting sample point sequence to obtain an internal interpolation point comprises:
[0038] calculating an interpolation distance between the any two adjacent fitting sample points in the fitting sample point sequence;
[0039] determining a corresponding interpolation number according to a relationship between the interpolation distance and a distance threshold;
[0040] performing interpolation using a Bezier curve based on the interpolation number to obtain an internal interpolation point.
[0041] In a second aspect, the present application also provides a lane line generation device. The device comprises:
[0042] sampling a sequence of fitting sampling points by sampling the initial fitting curve;
[0043] interpolating a sequence of second sampling points by interpolating the sequence of fitting sampling points;
[0044] setting a distance constraint related to a physical distance, a smoothness constraint related to a smoothness, and a consistency constraint, and obtaining an error loss function based on the distance constraint, the smoothness constraint, and the consistency constraint;
[0045] nonlinearly optimizing the sequence of second sampling points based on the error loss function to obtain a sequence of target sampling points;
[0046] generating a target lane based on the sequence of target sampling points.
[0047] In a third aspect, a computer device is provided. The computer device includes a memory and a processor. The memory stores a computer program. The processor implements the following steps when executing the computer program:
[0048] obtaining an initial fitting curve corresponding to an initial lane, and sampling a sequence of fitting sampling points by sampling the initial fitting curve;
[0049] interpolating a sequence of second sampling points by interpolating the sequence of fitting sampling points;
[0050] setting a distance constraint related to a physical distance, a smoothness constraint related to a smoothness, and a consistency constraint, and obtaining an error loss function based on the distance constraint, the smoothness constraint, and the consistency constraint;
[0051] nonlinearly optimizing the sequence of second sampling points based on the error loss function to obtain a sequence of target sampling points;
[0052] generating a target lane based on the sequence of target sampling points.
[0053] In a fourth aspect, a computer readable storage medium is provided. The computer readable storage medium stores a computer program. The computer program is executed by a processor to implement the following steps:
[0054] obtaining an initial fitting curve corresponding to an initial lane, and sampling a sequence of fitting sampling points by sampling the initial fitting curve;
[0055] interpolating a sequence of second sampling points by interpolating the sequence of fitting sampling points;
[0056] set a distance constraint related to a physical distance, a smoothing constraint related to a smoothness, and a consistency constraint, obtain an error loss function based on the distance constraint, the smoothing constraint, and the consistency constraint;
[0057] perform nonlinear optimization on the second sampling point sequence based on the error loss function to obtain a target sampling point sequence;
[0058] generate a target lane based on the target sampling point sequence.
[0059] The lane generation method, device, computer device, and storage medium described above obtain an initial fitting curve corresponding to an initial lane, sample the initial fitting curve to obtain a fitting sampling point sequence, interpolate the fitting sampling point sequence to obtain a second sampling point sequence, set a distance constraint related to a physical distance, a smoothing constraint related to a smoothness, and a consistency constraint according to the second sampling point sequence, combine the distance constraint, the smoothing constraint, and the consistency constraint to form an error loss function, perform nonlinear optimization on the second sampling point sequence using the error loss function to obtain a target sampling point sequence, and generate a target lane based on the target sampling point sequence. By interpolating the fitting sampling point sequence, the number of sampling points is increased, providing sufficient sampling points for subsequent nonlinear optimization. The distance constraint can constrain the deviation between the optimized sampling points and the sampling points before optimization, the smoothing constraint can constrain the smoothness between the optimized sampling points, and the consistency constraint can constrain the direction of sampling point optimization during optimization. The error loss function obtained based on the distance constraint, the smoothing constraint, and the consistency constraint has the three constraint capabilities described above. Nonlinear optimization of the second sampling point sequence using the error loss function improves the accuracy and smoothness between the target sampling points in the target sampling point sequence. Generating a target lane based on the target sampling point sequence improves the accuracy and smoothness of the target lane. BRIEF DESCRIPTION OF DRAWINGS
[0060] Figure 1 An application environment diagram of the lane generation method in one embodiment;
[0061] Figure 2 A flowchart of the lane generation method in one embodiment;
[0062] Figure 3 A flowchart of the smoothness calculation step in one embodiment;
[0063] Figure 4 A flowchart of the fitting sampling point sequence generation step in one embodiment;
[0064] Figure 5 A flowchart of the second sampling point sequence generation step in one embodiment;
[0065] Figure 6 This is a flowchart illustrating a lane line generation method in one embodiment;
[0066] Figure 7 This is a schematic diagram of the initial lane lines in one embodiment;
[0067] Figure 8 This is a schematic diagram of the target lane lines in one embodiment;
[0068] Figure 9 This is a structural block diagram of a lane line generation device in one embodiment;
[0069] Figure 10 This is an internal structural diagram of a computer device in one embodiment. Detailed Implementation
[0070] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0071] The lane line generation method provided in this application embodiment can be applied to, for example, Figure 1 In the application environment shown, terminal 102 communicates with server 104 via a network. A data storage system can store the data that server 104 needs to process. The data storage system can be integrated onto server 104 or placed on a cloud or other network server. Terminal 102 sends a lane line generation request to server 104. Server 104 receives the lane line generation request, obtains the initial fitted curve corresponding to the initial lane line, samples the initial fitted curve to obtain a fitted sampling point sequence, interpolates the fitted sampling point sequence to obtain a second sampling point sequence, sets distance constraints related to physical distance, smoothness constraints related to smoothness, and consistency constraints based on the second sampling point sequence, combines the distance constraints, smoothness constraints, and consistency constraints into an error loss function, uses the error loss function to perform nonlinear optimization on the second sampling point sequence to obtain a target sampling point sequence, and generates a target lane line based on the target sampling point sequence. Terminal 102 can be, but is not limited to, at least one of various personal computers, laptops, smartphones, tablets, and computing devices deployed in vehicles. Server 104 can be implemented using a standalone server or a server cluster composed of multiple servers.
[0072] In one embodiment, such as Figure 2As shown, a lane line generation method is provided, which can be applied to a computer device, which can be a terminal or a server, and can be implemented by the terminal or the server itself alone or through interaction between the terminal and the server. The embodiment takes the method applied to a computer device as an example for illustration, including steps 202 to 210.
[0073] In step 202, an initial fitting curve corresponding to an initial lane line is obtained, and the initial fitting curve is sampled to obtain a fitting sample point sequence.
[0074] The lane line refers to a line segment in the road that plays a role of constraint and guarantee for the driving of a vehicle. The lane line is an important traffic sign in road traffic. The lane line includes but is not limited to a white dashed line, a white solid line, a yellow dashed line, and a yellow solid line. For example, a pedestrian crossing line that allows pedestrians to cross the lane, a lane boundary line that separates vehicles traveling in the same direction, and the like. The fitting curve refers to a curve drawn according to discrete data points. The fitting curve includes but is not limited to an exponential function fitting curve, a power function fitting curve, and a hyperbolic fitting curve. Sampling refers to a process of extracting individuals from a population. Sampling includes random sampling and non-random sampling. Random sampling refers to extracting individuals from a population according to a randomization principle. Non-random sampling refers to extracting individuals from a population according to a set rule.
[0075] Specifically, the computer device obtains an initial fitting curve representing an initial lane line, samples on the initial fitting curve to obtain a plurality of fitting sample points, and groups the plurality of fitting sample points into a fitting sample point sequence.
[0076] In step 204, the fitting sample point sequence is interpolated to obtain a second sample point sequence.
[0077] The interpolation refers to a process of inserting points in discrete points. For example, linear interpolation, cubic spline interpolation, and the like.
[0078] Specifically, the computer device interpolates between the fitting sample points to obtain a plurality of interpolation points, and groups the fitting sample points and the interpolation points into a second sample point sequence.
[0079] In step 206, a distance constraint related to a physical distance, a smoothness constraint related to smoothness, and a consistency constraint are set, and an error loss function is obtained based on the distance constraint, the smoothness constraint, and the consistency constraint.
[0080] The physical distance refers to the shortest line length between two points in space at the same time. The physical distance can be calculated according to the coordinates of the two points. The coordinates can be two-dimensional coordinates, three-dimensional coordinates, etc. The distance constraint refers to a function for constraining the distance between the optimized sampling point sequence and the sampling point sequence before optimization. It can be understood as a function for constraining the deviation of the optimized sampling point sequence from the sampling point sequence before optimization. The smoothness refers to the smoothness of the curve. The curve can be composed of multiple points. The smoothness constraint refers to a function for constraining the smoothness between the optimized sampling points. The consistency constraint refers to a function for constraining the optimization direction of the sampling points in the optimization process. It can be understood as a function for constraining the adjustment direction of each sampling point. For example, for nonlinear optimization of four sampling points, the more different the adjustment directions of the four sampling points, the greater the value of the consistency constraint. The error loss function refers to a function containing the distance constraint, the smoothness constraint, and the consistency constraint. It can be understood as a function for simultaneously constraining the distance between the optimized sampling point sequence and the sampling point sequence before optimization, the smoothness between the optimized sampling points, and the optimization direction of the sampling points in the optimization process.
[0081] Specifically, the computer device sets the distance constraint related to the physical distance, the smoothness constraint related to the smoothness, and the consistency constraint, and combines the distance constraint, the smoothness constraint, and the consistency constraint into the error loss function.
[0082] In one embodiment, the computer device combines any one or two of the distance constraint, the smoothness constraint, and the consistency constraint into the error loss function.
[0083] Step 208, performing nonlinear optimization on the second sampling point sequence based on the error loss function to obtain a target sampling point sequence.
[0084] The nonlinear optimization refers to a process of adjusting the value of a variable in an objective function to make the objective function reach a maximum or minimum value. The objective function in the nonlinear optimization is a nonlinear function. It can be understood as adjusting the variable in the error loss function to make the error loss function reach a maximum or minimum value. The nonlinear optimization method includes but is not limited to first-order gradient method, second-order gradient method, quasi-Newton method, Gauss-Newton method, etc.
[0085] Specifically, the computer device performs nonlinear optimization on the second sampling point sequence according to the error loss function, and obtains a target sampling point after nonlinear optimization. The target sampling point is combined into a target sampling point sequence.
[0086] In one embodiment, the error loss function and the second sampling point sequence are input into a Ceres Solver module to obtain a target sampling point sequence, wherein the Ceres Solver is a C++ nonlinear optimization library open sourced by Google, which can solve nonlinear least squares problems with or without constraints.
[0087] Step 210: Generate target lane lines based on the target sampling point sequence.
[0088] Specifically, the computer equipment generates the target lane line based on the target sampling points in the target sampling point sequence.
[0089] In one embodiment, the method further includes: performing curve fitting on the target sampling points in the target sampling point sequence to obtain the corresponding target fitting curve, and using the target fitting curve as the target lane line.
[0090] In one embodiment, the method further includes: connecting any two adjacent target sampling points with line segments, and forming a target lane line by the target sampling points and the line segments between adjacent target sampling points.
[0091] In one embodiment, the method further includes: smoothing the target sampling point sequence to obtain an optimized target sampling point sequence, and generating a target lane line based on the optimized target sampling point sequence.
[0092] In the above lane line generation method, an initial fitting curve corresponding to the initial lane line is obtained. The initial fitting curve is sampled to obtain a sequence of fitted sampling points. The fitted sampling point sequence is interpolated to obtain a second sampling point sequence. Based on the second sampling point sequence, distance constraints related to physical distance, smoothness constraints related to smoothness, and consistency constraints are set. The distance constraints, smoothness constraints, and consistency constraints are combined into an error loss function. The error loss function is used to perform nonlinear optimization on the second sampling point sequence to obtain a target sampling point sequence. The target lane line is generated based on the target sampling point sequence. By interpolating the fitted sampling point sequence, the number of sampling points is increased, providing sufficient sampling points for subsequent nonlinear optimization. Distance constraints can constrain the deviation between the optimized sampling points and the unoptimized sampling points. Smoothness constraints can constrain the smoothness between the optimized sampling points. Consistency constraints can constrain the direction of optimization of sampling points during the optimization process. The error loss function obtained based on distance constraints, smoothness constraints, and consistency constraints possesses the above three constraint capabilities. Nonlinear optimization of the second sampling point sequence is performed using the error loss function, improving the accuracy and smoothness between target sampling points in the target sampling point sequence. The target lane line is generated based on the target sampling point sequence, improving the accuracy and smoothness of the target lane line.
[0093] In one embodiment, such as Figure 3 As shown, the distance constraints related to physical distance, the smoothness constraints related to smoothness, and the consistency constraints include:
[0094] The computer device sets a corresponding variable sampling point for each initial sampling point in the initial sampling point sequence, and a plurality of variable sampling points form a variable sampling point sequence; calculates a physical distance between the initial sampling point and the corresponding variable sampling point, and obtains a distance constraint based on the physical distance; and calculates a smoothness of the variable sampling point, and obtains a smooth constraint and a consistency constraint based on the smoothness.
[0095] The variable sampling point refers to a point that can be changed. It can be understood that the coordinates of the variable sampling point contain variables, and one or more variables can be changed by a set rule. For example, the variable sampling point is a two-dimensional point, and the coordinates of the variable sampling point are (x, y), wherein x and y are variables.
[0096] Specifically, the computer device selects a plurality of second sampling points from the second sampling point sequence, groups the selected plurality of second sampling points into an initial sampling point sequence, sets a variable sampling point for each initial sampling point in the initial sampling point sequence, groups a plurality of variable sampling points into a variable sampling point sequence, calculates a physical distance between the initial sampling point and the corresponding variable sampling point, obtains a distance constraint based on the physical distance, calculates a smoothness of the variable sampling point in the variable sampling point sequence, and obtains a smooth constraint and a consistency constraint based on the smoothness.
[0097] In one embodiment, the computer device selects a preset number of adjacent second sampling points from the second sampling point sequence, and groups the selected plurality of second sampling points into an initial sampling point sequence.
[0098] In one embodiment, the computer device performs curve fitting on the second sampling point sequence to obtain a second fitting curve, calculates a curvature of each second sampling point according to the second fitting curve, compares the curvature with a curvature threshold, selects a plurality of second sampling points with a curvature greater than the curvature threshold, and groups the selected plurality of second sampling points into an initial sampling point sequence.
[0099] In this embodiment, by calculating a physical distance between the initial sampling point and the corresponding variable sampling point, obtaining a distance constraint based on the physical distance, calculating a smoothness of the variable sampling point in the variable sampling point sequence, and obtaining a smooth constraint and a consistency constraint based on the smoothness, the distance constraint, the smooth constraint, and the consistency constraint are quantified, and the accuracy of the distance constraint, the smooth constraint, and the consistency constraint is improved.
[0100] In one embodiment, the smoothness of the variable sampling point is calculated by:
[0101] The current variable sampling point, the first variable sampling point and the second variable sampling point are acquired, the first variable sampling point is a previous adjacent variable sampling point of the current variable sampling point, and the second variable sampling point is a next adjacent variable sampling point of the current variable sampling point; a difference value between the first variable sampling point and the current variable sampling point is calculated to obtain a first vector; and a smoothness corresponding to the current variable sampling point is obtained based on the first vector and a second vector.
[0102] A vector refers to a quantity with a size and a direction. The vector can be figuratively represented as a line segment with an arrow, and the arrow represents the direction of the vector, and the length of the line segment represents the size of the vector. The vector can be obtained by solving two point coordinates, for example, the coordinates of point A are (x1, y1), and the coordinates of point B are (x2, y2), and the vector AB is (x2-x1, y2-y1).
[0103] Specifically, the computer device acquires the current variable sampling point, the previous adjacent variable sampling point of the current variable sampling point and the next adjacent variable sampling point of the current variable sampling point in the variable sampling point sequence according to the arrangement order of each variable sampling point in the variable sampling point sequence, takes the previous adjacent variable sampling point as the first variable sampling point, takes the next adjacent variable sampling point as the second variable sampling point, subtracts the coordinates of the current variable sampling point from the coordinates of the first variable sampling point to obtain the first vector, subtracts the coordinates of the current variable sampling point from the coordinates of the second variable sampling point to obtain the second vector, and obtains the smoothness corresponding to the current variable sampling point based on the first vector and the second vector.
[0104] In the embodiment, the first vector and the second vector are obtained according to the coordinates of the current variable sampling point, the coordinates of the first variable sampling point and the coordinates of the second variable sampling point, the first vector and the second vector are calculated to obtain the smoothness corresponding to the current variable sampling point, and the accuracy of the smoothness calculation is improved.
[0105] In one embodiment, obtaining the smoothness corresponding to the current variable sampling point based on the first vector and the second vector includes:
[0106] Step 302, fusing the first vector and the second vector to obtain a fusion result.
[0107] The fusion refers to multiplying two vectors, and the vector multiplication includes dot product and cross product. The dot product can also be referred to as inner product, and the cross product can also be referred to as outer product. The fusion result refers to a result obtained by multiplying two vectors, and includes a dot product result and a cross product result. The dot product result can also be referred to as an inner product result, and refers to a result obtained by dot product of two vectors. For example, the vector AB is (x 2 -x 1, y 2 -y 1 ), the vector BC is (x 3 -x 2, y 3 -y 2 ), and the dot product result of the vector AB and the vector BC is (x 2 -x 1 )*(x 3 -x 2 )+(y 2 -y 1 )*(y 3 -y 2 ). The cross product result can also be referred to as an outer product result, and refers to a result obtained by cross product of two vectors. For example, the cross product result of the vector AB and the vector BC is (x 2 -x 1 )*(y 3 -y 2 )-(x 3 -x 2 )*(y 2 -y 1 ). The dot product result and the cross product result can be obtained by algebraic operation of vector coordinates, or can be solved by introducing geometric concepts such as lengths and angles of two vectors.
[0108] Specifically, the computer device performs dot product on the first vector and the second vector, takes the dot product result as the fusion result, or performs cross product on the first vector and the second vector, and takes the cross product result as the fusion result.
[0109] In step 304, lengths of the first vector and the second vector are calculated respectively to obtain a first length and a second length.
[0110] Specifically, the computer device calculates the length of the first vector to obtain the first length, and calculates the length of the second vector to obtain the second length.
[0111] In step 306, based on the fusion result, the first length and the second length, a smoothness corresponding to the current variable sampling point is calculated.
[0112] Specifically, the computer device calculates the fusion result, the first length and the second length to obtain the smoothness corresponding to the current variable sampling point.
[0113] In one embodiment, the computer device performs dot product on the first vector and the second vector to obtain the fusion result, multiplies the first length by the second length to obtain a statistical length, divides the fusion result by the statistical length to obtain a reference smoothness, and calculates the inverse cosine of the reference smoothness to obtain the smoothness. For example, the coordinates of point A are (x 1, y 1 ), the coordinates of point B are (x 2, y 2 ), and the coordinates of point C are (x 3, y 3 ). The reference smoothness between points A, B and C is arccos((x 2 -x 1 )*(x 3 -x 2 )+(y 2 -y 1 )*(y 3 -y 2 )) / ((x 2 -x 1 ) 2 +(y 2 -y 1 ) 2 )*((x 3 -x 2 ) 2 +(y 3 -y 2 ) 2 ). 2 2 1 / 2 2 2 ) 1 / 2 ), and the reference smoothness is obtained by taking the inverse cosine of the reference smoothness.
[0114] In one embodiment, the computer device performs cross multiplication on the first vector and the second vector to obtain a fusion result, multiplies the first length by the second length to obtain a statistical length, divides the fusion result by the statistical length to obtain the reference smoothness, and takes the inverse sine of the reference smoothness to obtain the smoothness. For example, the coordinates of the A point are (x1, y1), the coordinates of the B point are (x2, y2), and the coordinates of the C point are (x3, y3). The reference smoothness between the A, B, and C points is ((x2-x1)*(y3-y2)-(x3-x2)*(y2-y1))\(((x2-x1) 2 +(y2-y1) 2 ) 1 / 2 *((x3-x2) 2 +(y3-y2) 2 ) 1 / 2 ), and the reference smoothness is obtained by taking the inverse cosine of the reference smoothness.
[0115] In one embodiment, the computer device performs cross multiplication on the first vector and the second vector to obtain a fusion result, multiplies the first length by the second length to obtain a statistical length, divides the fusion result by the statistical length to obtain the reference smoothness, and takes the inverse sine of the reference smoothness to obtain the smoothness. For example, the coordinates of the A point are (x1, y1), the coordinates of the B point are (x2, y2), and the coordinates of the C point are (x3, y3). The reference smoothness between the A, B, and C points is ((x2-x1)*(y3-y2)-(x3-x2)*(y2-y1))\(((x2-x1) 2 +(y2-y1) 2 ) 1 / 2 *((x3-x2) 2 +(y3-y2) 2 ) 1 / 2 ).
[0116] In this embodiment, the first vector and the second vector are fused to obtain a fusion result, the lengths of the first vector and the second vector are calculated respectively to obtain a first length and a second length, and the smoothness corresponding to the current variable sampling point is calculated based on the fusion result, the first length, and the second length. The smoothness is quantized to improve the accuracy of the smoothness calculation.
[0117] In one embodiment, the smoothness-based smoothness constraint and consistency constraint include:
[0118] The smoothness corresponding to each current variable sampling point is counted to obtain a smoothness constraint. The smoothness corresponding to two adjacent current variable sampling points is added to obtain an accumulated smoothness. Each accumulated smoothness is counted to obtain a consistency constraint.
[0119] Specifically, the computer device counts the smoothness corresponding to each current variable sampling point to obtain a smooth constraint, and adds the smoothness corresponding to two adjacent current variable sampling points to obtain an accumulated smoothness, and counts each accumulated smoothness to obtain a consistency constraint.
[0120] In one embodiment, the computer device multiplies the smoothness corresponding to the current variable sampling point by the smoothness corresponding to the current variable sampling point to obtain a first smoothness corresponding to the current variable sampling point, adds each first smoothness to obtain a smooth constraint, multiplies the accumulated smoothness by the accumulated smoothness to obtain a second smoothness, and adds each second smoothness to obtain a consistency constraint.
[0121] In one embodiment, the computer device multiplies the smoothness corresponding to the current variable sampling point by the smoothness corresponding to the current variable sampling point to obtain a first smoothness corresponding to the current variable sampling point, multiplies the first smoothness by a smoothness coefficient, adds each product of the first smoothness and the smoothness coefficient to obtain a smooth constraint, multiplies the accumulated smoothness by the accumulated smoothness to obtain a second smoothness, multiplies the second smoothness by a consistency coefficient, and adds each product of the second smoothness and the consistency coefficient to obtain a consistency constraint.
[0122] In this embodiment, the smoothness constraint and the consistency constraint are constructed based on the smoothness, the smoothness constraint can constrain the smoothness between the optimized sampling points, the consistency constraint can constrain the direction of the sampling point optimization in the optimization process, and the accuracy of the nonlinear optimization is improved.
[0123] In one embodiment, as shown in FIG. 4, the method comprises the following steps. Figure 4 As shown in FIG. 4, the method comprises the following steps.
[0124] Step 402: Obtain an initial fitting curve corresponding to an initial lane line, and start point information and end point information of the initial lane line.
[0125] The start point information refers to the position information of the start point of the initial lane line. The start point information can be represented by latitude and longitude, coordinate points, etc. The end point information refers to the position information of the end point of the initial lane line. The end point information can be represented by latitude and longitude, coordinate points, etc.
[0126] Specifically, the computer device obtains an initial fitting curve representing an initial lane line, and start point information representing a start point of the initial lane line and end point information representing an end point of the initial lane line.
[0127] Step 404: Solve the curvature corresponding to the initial fitting curve, and determine the target number of samplings based on the curvature.
[0128] Curvature refers to the degree of curvature of the initial fitted curve. Curvature can be represented by the radius of curvature of the initial fitted curve, or by the relationship between the curvatures of multiple points on the initial fitted curve, etc.
[0129] Specifically, the computer equipment calculates the curvature of the initial fitted curve and determines the target number of samples based on the curvature.
[0130] In one embodiment, the computer device calculates the radius of curvature of the initial fitted curve, using the radius of curvature to represent the curvature of the initial fitted curve. It then queries a mapping table between curvature and sampling number to obtain the sampling number corresponding to the curvature of the initial fitted curve, and uses this corresponding sampling number as the target number. The mapping table between curvature and sampling number can also be a mapping table between curvature intervals and sampling number.
[0131] Step 406: Calculate the sampling interval based on the target quantity, starting point information, and ending point information.
[0132] Specifically, the computer equipment calculates the length of the initial lane line based on the starting point and ending point information, and divides the length of the initial lane line by the target number to obtain the sampling interval.
[0133] In one embodiment, the starting point information and the ending point information are represented by two-dimensional coordinates. The computer device subtracts the X-axis coordinate value of the starting point information from the X-axis coordinate value of the ending point information to obtain the length of the initial lane line, and divides the length of the initial lane line by the target number to obtain the sampling interval.
[0134] Step 408: Sample the initial fitted curve based on the spacing to obtain the fitted sampling point sequence.
[0135] Specifically, the computer device samples the initial fitted curve, with the distance between the sampling points being the interval, resulting in multiple fitted sampling points. These multiple fitted sampling points are then combined into a fitted sampling point sequence.
[0136] In this embodiment, the initial fitted curve is sampled to obtain a sequence of fitted sampling points. The sampling interval is determined according to the length and curvature of the initial lane line. Sampling the initial fitted curve according to a reasonable interval ensures both the sufficiency of the fitted sampling points and the rationality of the number of fitted sampling points.
[0137] In one embodiment, such as Figure 5 As shown, the second sampling point sequence is obtained by interpolating the fitted sampling point sequence:
[0138] Step 502, inserting an external interpolation point in the direction of the second fitting sample point pointing to the first fitting sample point in the fitting sample point sequence, and inserting an external interpolation point in the direction of the second last fitting sample point pointing to the first last fitting sample point in the fitting sample point sequence.
[0139] Wherein, the external interpolation point refers to the point inserted outside the fitting sample point sequence. It can be understood as the point inserted before the initial lane line starting point and after the terminal point. The first last fitting sample point refers to the last fitting sample point in the fitting sample point sequence. The second last fitting sample point refers to the fitting sample point adjacent to the first last fitting sample point in the fitting sample point sequence, which can be understood as the second last fitting sample point in the fitting sample point sequence.
[0140] Specifically, the computer device calculates the slope of the straight line composed of the first fitting sample point and the second fitting sample point, and inserts an external interpolation point before the first fitting sample point, the slope of the straight line composed of the external interpolation point and the first fitting sample point is equal to the slope of the straight line composed of the first fitting sample point and the second fitting sample point; the slope of the straight line composed of the first last fitting sample point and the second last fitting sample point is calculated, and an external interpolation point is inserted after the first last fitting sample point, the slope of the straight line composed of the external interpolation point and the second last fitting sample point is equal to the slope of the straight line composed of the first last fitting sample point and the second last fitting sample point.
[0141] In one embodiment, a first preset number of external interpolation points are inserted before the first fitting sample point, and a second preset number of external interpolation points are inserted after the first last fitting sample point. The first preset number and the second preset number can be the same or different. For example, 5 external interpolation points are inserted before the first fitting sample point according to the preset requirement, and 2 external interpolation points are inserted after the first last fitting sample point according to the preset requirement. Wherein, the preset requirement can be set differently according to the specific situation.
[0142] Step 504, based on the interpolation distance between any two adjacent fitting sample points in the fitting sample point sequence, performing Bezier curve interpolation between any two adjacent fitting sample points to obtain an internal interpolation point.
[0143] Wherein, the interpolation distance refers to the physical distance between the two adjacent fitting sample points. The Bezier curve interpolation refers to obtaining the interpolation point by using the Bezier curve. The Bezier curve (also known as Bezier curve or Bezier curve) is a mathematical curve applied to two-dimensional graphics application programs. The Bezier curve includes first-order Bezier curve, second-order Bezier curve, third-order Bezier curve, etc.
[0144] Specifically, the computer device calculates an interpolation distance between two adjacent fitting sampling points, determines whether the two adjacent fitting sampling points are suitable for being interpolated by a Bezier curve according to the interpolation distance, and if the interpolation distance meets an interpolation condition, interpolates the two adjacent fitting sampling points by the Bezier curve.
[0145] In step 506, a second sampling point sequence is obtained based on the fitting sampling point sequence, the external interpolation point, and the internal interpolation point.
[0146] Specifically, the computer device groups the fitting sampling points in the fitting sampling point sequence, the external interpolation point, and the internal interpolation point to form the second sampling point sequence.
[0147] In this embodiment, the number of sampling points in the second sampling point sequence is increased by performing external interpolation and internal interpolation on the fitting sampling point sequence, which provides sufficient sampling points for subsequent nonlinear optimization and improves the accuracy of nonlinear optimization.
[0148] In one embodiment, the internal interpolation point is obtained by interpolating any two adjacent fitting sampling points in the fitting sampling point sequence by a Bezier curve based on an interpolation distance between the two fitting sampling points.
[0149] The interpolation distance between any two adjacent sampling points in the sampling point sequence is calculated, the corresponding interpolation number is determined according to the relationship between the interpolation distance and a distance threshold, and the internal interpolation point is obtained by interpolation based on the interpolation number and the Bezier curve.
[0150] The distance threshold refers to a threshold value for Bezier curve interpolation.
[0151] Specifically, the computer device calculates the interpolation distance between the two adjacent sampling points, compares the interpolation distance with the distance threshold, and if the interpolation distance is greater than the distance threshold, determines the interpolation number according to the interpolation distance, and interpolates the two adjacent fitting sampling points by the Bezier curve to obtain the internal interpolation point with the interpolation number.
[0152] In this embodiment, whether the two adjacent sampling points are suitable for being interpolated by the Bezier curve is determined by comparing the interpolation distance with the distance threshold, and if the interpolation distance is greater than the distance threshold, the two adjacent sampling points are interpolated by the Bezier curve, which not only increases the number of sampling points, but also improves the smoothness between the sampling points.
[0153] In one specific embodiment, the lane line generation method is as shown in Figure 6 .
[0154] An initial fitting curve corresponding to an initial lane line is obtained, the initial lane line is as shown in Figure 7 , and the initial fitting curve is a one-variable polynomial equation:
[0155] y=k0+k1*x 1 +k2*x 2 +k3*x 3 +…+k n *x n Formula (1)
[0156] wherein k0, k1, k2, k3, k n are coefficients of each term in the monomial polynomial.
[0157] The curvature expression corresponding to the initial fitting curve is:
[0158]
[0159] wherein k is the curvature.
[0160] The curvatures of the multiple points on the initial fitting curve are obtained by using Formula (2), the curvatures of the multiple points are added, the bending degree of the initial lane line is obtained, the mapping table between the bending degree and the sampling number is inquired, and the sampling number n corresponding to the initial lane line is obtained.
[0161] The starting point coordinates (x min , y min ) and the end point coordinates (x max , y max ) of the initial lane line are obtained, x max in the end point coordinates is subtracted by x min in the starting point coordinates, the length x max -x min of the initial lane line is obtained, the sampling interval (x max -x min ) / n is obtained by dividing the length of the initial lane line by the sampling number n, and the initial fitting curve is equally sampled in the X-axis according to the sampling interval, so that the fitting sampling point sequence is obtained.
[0162] The direction of the second sampling point B pointing to the first sampling point A in the fitting sampling point sequence is extrapolated, so that the first extrapolation point C is obtained, wherein the first sampling point A is the first sampling point in the fitting sampling point sequence, the second sampling point B is the second sampling point in the fitting sampling point sequence, the first extrapolation point C satisfies the following conditions: the slope of the straight line composed of C and A is equal to the slope of the straight line composed of B and A, and the distance between C and A is equal to the distance between B and A. The direction of the second last sampling point N pointing to the first last sampling point M in the fitting sampling point sequence is extrapolated, so that the second extrapolation point Q is obtained, and the second extrapolation point Q satisfies the following conditions: the slope of the straight line composed of Q and M is equal to the slope of the straight line composed of N and M, and the distance between Q and M is equal to the distance between N and M.
[0163] An interpolation distance between two adjacent fitting sampling points is calculated, if the interpolation distance is greater than a distance threshold, interpolation is performed between the two adjacent fitting sampling points, and the number of interpolations R is determined according to the interpolation distance. The two adjacent fitting sampling points P1(X1, Y1) and P2(X2, Y2) are obtained, and two auxiliary points P3(X3, Y3) and P4(X4, Y4) are obtained from the initial fitting curve, and X3 and X4 are between X1 and X2. A third-order Bezier curve equation is solved according to the two adjacent fitting sampling points and the two auxiliary points:
[0164] B(t) = P1(1-t) 3 + P3(1-t) 2 + P4(1-t) + P2(1-t) 3 Formula (3)
[0165] Where t is a variable parameter, and the value range is between 0 and 1.
[0166] Based on formula (3), the interpolation point coordinates (x n , y n ) can be represented as:
[0167] x n = X1(1-t) 3 + X3(1-t) 2 + X4(1-t) + X2(1-t) 3 Formula (4)
[0168] y n = Y1(1-t) 3 + Y3(1-t) 2 + Y4(1-t) + Y2(1-t) 3 Formula (5)
[0169] Change the value of R times t to get R interpolation points. The fitting sampling points, the extrapolation points and the interpolation points form a second sampling point sequence.
[0170] An initial sampling point sequence is obtained from the second sampling point sequence. A preset number of second sampling points in the second sampling point sequence are obtained in sequence, and the preset number of second sampling points form an initial sampling point sequence. For example, the second sampling point sequence has 6 second sampling points, A, B, C, D, E, and F, and the system sets the preset number to 4. The first time A, B, C, and D are obtained to form an initial sampling point sequence, the second time B, C, D, and E are obtained to form an initial sampling point sequence, and the third time C, D, E, and F are obtained to form an initial sampling point sequence.
[0171] An error loss function between the initial sampling point sequence and the reference sampling point sequence is established. The initial sampling point sequence includes four second sampling points A (X1, Y1), B (X2, Y2), C (X3, Y3), and D (X4, Y4), and each second sampling point corresponds to a reference sampling point Q1 (M1, N1), Q2 (M2, N2), Q3 (M3, N3), and Q4 (M4, N4), respectively. The four reference sampling points form a reference sampling point sequence, and the error function between the initial sampling point sequence and the reference sampling point sequence is:
[0172] e 2 = 1 / 2 (S1 + S2 + S3) Formula (6)
[0173] S1 is a distance constraint, S1 = e1 2 + e2 2 + e3 2 + e4 2 + e5 2 + e6 2 + e7 2 + e8 2 , e1 = M1 - X1, e2 = M2 - X2, e3 = M3 - X3, e4 = M4 - X4, e5 = N1 - Y1, e6 = N2 - Y2, e7 = N3 - Y3, e8 = N4 - Y4;
[0174] S2 is a smoothing constraint, S2 = (h1 * e9) 2 + (h2 * e 10 ) 2 , e9 = ((M1 - M2) * (N3 - N2) - (M3 - M2) * (N1 - N2)) / (((M1 - M2) 2 + (N1 - N2) 2 ) 1 / 2 * ((M3 - M2) 2 + (N3 - N2) 2 ) 1 / 2 ), e 10 = ((M2 - M3) * (N4 - N3) - (M4 - M3) * (N2 - N3)) / (((M2 - M3) 2 + (N2 - N3) 2 ) 1 / 2 * ((M4 - M3) 2 + (N4 - N3) 2 ) 1 / 2 ), h1 and h2 are smoothing coefficients;
[0175] S3 is a consistency constraint, S3 = (h3 * (e9 + e 10 )) 2 , h3 is a consistency coefficient.
[0176] The error function e 2 And A(X1, Y1), B(X2, Y2), C(X3, Y3), D(X4, Y4) are input to the Ceres Solver module, when the error function e 2 At the minimum, Q1(M1, N1), Q2(M2, N2), Q3(M3, N3), Q4(M4, N4) corresponding to the initial sampling point sequence composed of A, B, C, D as the optimal sampling point sequence corresponding to the initial sampling point sequence composed of B, C, D, E and the initial sampling point sequence composed of C, D, E, F are executed The above steps obtain a plurality of optimal sampling point sequences, and each optimal sampling point sequence forms a target sampling point sequence, and the target lane line composed of the target sampling points in the target sampling point sequence and the line segment group between the target sampling points is as shown in Figure 8
[0177] In this embodiment, the initial fitting curve corresponding to the initial lane line is obtained, the initial fitting curve is sampled to obtain a fitting sampling point sequence, the fitting sampling point sequence is interpolated to obtain a second sampling point sequence, the distance constraint related to the physical distance, the smoothness constraint related to the smoothness and the consistency constraint are set according to the second sampling point sequence, the distance constraint, the smoothness constraint and the consistency constraint are combined into an error loss function, the second sampling point sequence is nonlinearly optimized using the error loss function, a target sampling point sequence is obtained, and a target lane line is generated according to the target sampling point sequence. By interpolating the fitting sampling point sequence, the number of sampling points is increased, sufficient sampling points are provided for subsequent nonlinear optimization, the distance constraint can constrain the deviation between the optimized sampling points and the sampling points before optimization, the smoothness constraint can constrain the smoothness between the optimized sampling points, and the consistency constraint can constrain the direction of the sampling point optimization in the optimization process. The error loss function obtained according to the distance constraint, the smoothness constraint and the consistency constraint has the above three constraint capabilities, the second sampling point sequence is nonlinearly optimized by the error loss function, the accuracy and smoothness between the target sampling points in the target sampling point sequence are improved, and the target lane line is generated according to the target sampling point sequence, the accuracy and smoothness of the target lane line are improved.
[0178] It should be understood that although the steps in the flowcharts involved in the embodiments described above are shown in sequence according to the arrows, the steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified herein, the execution of the steps is not strictly limited in sequence, and the steps can be executed in other orders. Moreover, at least some of the steps in the flowcharts involved in the embodiments described above can include multiple steps or multiple stages, which are not necessarily executed at the same time, but can be executed at different times, and the execution order of the steps or stages is not necessarily sequential, but can be alternately or alternately executed with at least part of other steps or steps or stages in other steps.
[0179] Based on the same inventive concept, the embodiments of the present application also provide a lane line generation device for implementing the lane line generation method described above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme described in the above method, so the specific limitations in one or more lane line generation device embodiments provided below can refer to the limitations of the lane line generation method described above, which will not be repeated here.
[0180] In one embodiment, as shown in Figure 9 a lane line generation device is provided, comprising: a sampling module 902, an interpolation module 904, a construction module 906, a nonlinear optimization module 908 and a generation module 910, wherein:
[0181] The sampling module 902 is configured to obtain an initial fitting curve corresponding to an initial lane line, and sample the initial fitting curve to obtain a fitting sample point sequence.
[0182] The interpolation module 904 is configured to interpolate the fitting sample point sequence to obtain a second sample point sequence.
[0183] The construction module 906 is configured to set a distance constraint related to a physical distance, a smooth constraint related to a smoothness, and a consistency constraint, and obtain an error loss function based on the distance constraint, the smooth constraint and the consistency constraint.
[0184] The nonlinear optimization module 908 is configured to perform nonlinear optimization on the second sample point sequence based on the error loss function to obtain a target sample point sequence.
[0185] The generation module 910 is configured to generate a target lane line based on the target sample point sequence.
[0186] In one embodiment, the construction module 906 is further configured to:
[0187] The second sampling point sequence is taken as an initial sampling point sequence, a corresponding variable sampling point is set for each initial sampling point in the initial sampling point sequence, and a plurality of variable sampling points form a variable sampling point sequence; a physical distance is calculated for the initial sampling point and the variable sampling point corresponding to the initial sampling point to obtain a distance constraint based on the physical distance; a smoothness is calculated for the variable sampling point to obtain a smoothness constraint and a consistency constraint based on the smoothness.
[0188] In one embodiment, the construction module 906 is further configured to:
[0189] The current variable sampling point, the first variable sampling point and the second variable sampling point are obtained, the first variable sampling point is a previous adjacent variable sampling point of the current variable sampling point, and the second variable sampling point is a next adjacent variable sampling point of the current variable sampling point; a difference value between the first variable sampling point and the current variable sampling point is calculated to obtain a first vector; a difference value between the second variable sampling point and the current variable sampling point is calculated to obtain a second vector; and the smoothness corresponding to the current variable sampling point is obtained based on the first vector and the second vector.
[0190] In one embodiment, the construction module 906 is further configured to:
[0191] The first vector and the second vector are fused to obtain a fusion result; a length calculation is performed on the first vector and the second vector respectively to obtain a first length and a second length; and the smoothness corresponding to the current variable sampling point is calculated based on the fusion result, the first length and the second length.
[0192] In one embodiment, the construction module 906 is further configured to:
[0193] The smoothness corresponding to each current variable sampling point is counted to obtain a smoothness constraint; the smoothness corresponding to two adjacent current variable sampling points is added to obtain an accumulated smoothness; and each accumulated smoothness is counted to obtain a consistency constraint.
[0194] In one embodiment, the sampling module 902 is further configured to:
[0195] The initial fitting curve corresponding to the initial lane line and the start point information and the end point information of the initial lane line are obtained; a curvature corresponding to the initial fitting curve is solved, a target number of sampling is determined based on the curvature; a sampling interval is calculated based on the target number, the start point information and the end point information; and the initial fitting curve is sampled based on the interval to obtain a fitting sampling point sequence.
[0196] In one embodiment, the interpolation module 904 is further configured to:
[0197] An external interpolation point is inserted in the direction from the second fitted sampling point to the first fitted sampling point in the fitted sampling point sequence. An external interpolation point is also inserted in the direction from the second last fitted sampling point to the first last fitted sampling point in the fitted sampling point sequence. Based on the interpolation distance between any two adjacent fitted sampling points in the fitted sampling point sequence, Bézier curve interpolation is performed between any two adjacent fitted sampling points to obtain internal interpolation points. Based on the fitted sampling point sequence, the external interpolation points, and the internal interpolation points, the second sampling point sequence is obtained.
[0198] In one embodiment, the interpolation module 904 is further configured to:
[0199] Calculate the interpolation distance between any two adjacent fitted sampling points in the fitted sampling point sequence; determine the corresponding number of interpolations based on the relationship between the interpolation distance and the distance threshold; and use a Bézier curve to perform interpolation based on the number of interpolations to obtain the internal interpolation points.
[0200] Each module in the aforementioned lane line generation device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device, or stored in the memory of a computer device as software, so that the processor can call and execute the operations corresponding to each module.
[0201] In one embodiment, a computer device is provided, which may be a terminal, and its internal structure diagram may be as follows: Figure 10 As shown, the computer device includes a processor, memory, communication interface, display screen, and input devices connected via a system bus. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The communication interface is used for wired or wireless communication with external terminals; wireless communication can be achieved through Wi-Fi, mobile cellular networks, NFC (Near Field Communication), or other technologies. When executed by the processor, the computer program implements a lane line generation method. The display screen can be an LCD screen or an e-ink display screen. The input devices can be a touch layer covering the display screen, buttons, a trackball, or a touchpad mounted on the computer device casing, or an external keyboard, touchpad, or mouse.
[0202] Those skilled in the art will understand that Figure 10The structure shown in the figure is only a block diagram of part of the structure related to the scheme of the present application, and does not constitute a limitation on the computer device to which the scheme of the present application is applied. The specific computer device can include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0203] In an embodiment, a computer device is also provided, including a memory and a processor, the memory storing a computer program, and the processor implementing the steps in the above method embodiments when executing the computer program.
[0204] In an embodiment, a computer readable storage medium is provided, storing a computer program, and the computer program implementing the steps in the above method embodiments when executed by a processor.
[0205] In an embodiment, a computer program product is provided, including a computer program, and the computer program implementing the steps in the above method embodiments when executed by a processor.
[0206] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data for analysis, stored data, displayed data, etc.) involved in the present application are all information and data authorized by the user or authorized by all parties.
[0207] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a non-volatile computer readable storage medium, and when the computer program is executed, the processes of the above-mentioned embodiments of the methods can be included. Any reference to memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (Read-Only Memory, ROM), magnetic tape, floppy disk, flash memory, optical storage, high-density embedded non-volatile memory, resistive memory (ReRAM), magnetoresistive random access memory (Magnetoresistive Random Access Memory, MRAM), ferroelectric memory (Ferroelectric Random Access Memory, FRAM), phase change memory (Phase Change Memory, PCM), graphene memory, etc. Volatile memory can include random access memory (Random Access Memory, RAM) or external cache memory, etc. As an illustration but not limitation, RAM can be in various forms, such as static random access memory (Static Random Access Memory, SRAM) or dynamic random access memory (Dynamic Random Access Memory, DRAM), etc. The database involved in the embodiments provided in the present application can include at least one of a relational database and a non-relational database. The non-relational database can include a distributed database based on a block chain, etc., without being limited thereto. The processor involved in the embodiments provided in the present application can be a general-purpose processor, a central processing unit, a graphics processing unit, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., without being limited thereto.
[0208] Any combination of the technical features of the above embodiments can be made. In order to make the description simple, all possible combinations of the technical features in the above embodiments are not described, however, as long as the combination of the technical features does not exist contradictory, it should be considered as the scope of the present application.
[0209] The above embodiments only express several implementation manners of the present application, and the description is more specific and detailed, but it should not be understood as a limitation on the scope of the patent of the present application. It should be pointed out that for ordinary skilled in the art, without departing from the concept of the present application, a number of modifications and improvements can be made, which are within the scope of protection of the present application. Therefore, the protection scope of the present application should be subject to the appended claims.
Claims
1. A lane line generation method characterized by, The method comprises: acquiring an initial fitting curve corresponding to an initial lane line, sampling the initial fitting curve to obtain a fitting sample point sequence; interpolating the fitting sample point sequence to obtain a second sample point sequence; the interpolation refers to the process of inserting points in discrete points; taking a plurality of second sample points in the second sample point sequence as an initial sample point sequence, setting a corresponding variable sample point for each initial sample point in the initial sample point sequence, and a plurality of the variable sample points forming a variable sample point sequence; calculating the distance between the initial sample points in the initial sample point sequence and the variable sample points corresponding to the initial sample points to obtain a physical distance, and obtaining a distance constraint based on the physical distance; calculating the smoothness of the variable sample points to obtain a smooth constraint and a consistency constraint based on the smoothness; obtaining an error loss function based on the distance constraint, the smooth constraint and the consistency constraint; performing nonlinear optimization on the second sample point sequence based on the error loss function to obtain a target sample point sequence; generating a target lane line based on the target sample point sequence.
2. The method of claim 1, wherein, The taking a plurality of second sample points in the second sample point sequence as an initial sample point sequence comprises: curve fitting the second sample point sequence to obtain a second fitting curve; calculating the curvature of each second sample point according to the second fitting curve; comparing the curvature with a curvature threshold, and selecting a plurality of second sample points with a curvature greater than the curvature threshold to form an initial sample point sequence.
3. The method of claim 1, wherein, The calculating the smoothness of the variable sample points comprises: acquiring a current variable sample point, a first variable sample point and a second variable sample point, the first variable sample point being a previous adjacent variable sample point of the current variable sample point, and the second variable sample point being a next adjacent variable sample point of the current variable sample point; calculating the difference between the first variable sample point and the current variable sample point to obtain a first vector; calculating the difference between the second variable sample point and the current variable sample point to obtain a second vector; obtaining the smoothness corresponding to the current variable sample point based on the first vector and the second vector.
4. The method of claim 3, wherein, The obtaining the smoothness corresponding to the current variable sample point based on the first vector and the second vector comprises: fusing the first vector and the second vector to obtain a fusion result; respectively calculating the lengths of the first vector and the second vector to obtain a first length and a second length; based on the fusion result, the first length and the second length, calculating the smoothness corresponding to the current variable sample point.
5. The method of claim 3, wherein, The obtaining a smooth constraint and a consistency constraint based on the smoothness comprises: statistically obtaining a smooth constraint corresponding to each current variable sample point; adding the smoothness corresponding to two adjacent current variable sample points to obtain an accumulated smoothness; statistically obtaining a consistency constraint from each accumulated smoothness.
6. The method of claim 1, wherein, The acquiring an initial fitting curve corresponding to an initial lane line, and sampling the initial fitting curve to obtain a fitting sample point sequence comprises: obtain an initial fitting curve corresponding to an initial lane line, and start point information and end point information of the initial lane line; solve a curvature corresponding to the initial fitting curve, and determine a target number of samplings based on the curvature; calculate a sampling interval based on the target number, the start point information, and the end point information; sample the initial fitting curve based on the sampling interval to obtain a fitting sampling point sequence.
7. The method of claim 1, wherein, The interpolating the fitting sampling point sequence to obtain a second sampling point sequence comprises: inserting an external interpolation point in a direction in which a second fitting sampling point in the fitting sampling point sequence points to a first fitting sampling point, and inserting an external interpolation point in a direction in which a second end fitting sampling point in the fitting sampling point sequence points to a first end fitting sampling point; performing Bezier curve interpolation between any two adjacent fitting sampling points in the fitting sampling point sequence based on an interpolation distance between the any two adjacent fitting sampling points to obtain an internal interpolation point; obtaining a second sampling point sequence based on the fitting sampling point sequence, the external interpolation point, and the internal interpolation point.
8. The method of claim 7, wherein, The performing Bezier curve interpolation between any two adjacent fitting sampling points in the fitting sampling point sequence to obtain an internal interpolation point comprises: calculating an interpolation distance between any two adjacent fitting sampling points in the fitting sampling point sequence; determining a corresponding interpolation number according to a relationship between the interpolation distance and a distance threshold; performing interpolation using a Bezier curve based on the interpolation number to obtain an internal interpolation point.
9. A lane line generation device characterized by comprising: The device comprises: a sampling module configured to obtain an initial fitting curve corresponding to an initial lane line, and sample the initial fitting curve to obtain a fitting sampling point sequence; an interpolation module configured to interpolate the fitting sampling point sequence to obtain a second sampling point sequence; the interpolation refers to a process of inserting points in discrete points; a construction module configured to take a plurality of second sampling points in the second sampling point sequence as an initial sampling point sequence, set a corresponding variable sampling point for each initial sampling point in the initial sampling point sequence, and form a variable sampling point sequence with a plurality of the variable sampling points; calculate a physical distance based on an initial sampling point in the initial sampling point sequence and the variable sampling point corresponding to the initial sampling point, obtain a distance constraint based on the physical distance, obtain a smoothness based on smooth calculation of the variable sampling point, obtain a smooth constraint and a consistency constraint based on the smoothness, and obtain an error loss function based on the distance constraint, the smooth constraint, and the consistency constraint; a nonlinear optimization module configured to perform nonlinear optimization on the second sampling point sequence based on the error loss function to obtain a target sampling point sequence; a generation module configured to generate a target lane line based on the target sampling point sequence. 10.A computer device, comprising a memory and a processor, wherein the memory stores a computer program, and the computer device is configured to perform the method according to any one of claims 1-9. The processor implements the steps of the method of any one of claims 1 to 8 when executing the computer program.
11. A computer readable storage medium having stored thereon a computer program, characterized in that, The computer program, when executed by the processor, implements the steps of the method of any one of claims 1 to 8.
Citation Information
Patent Citations
Road curvature determining method and device, storage medium and computer device
CN109033176A
Path curve generation method and device, computer equipment and storage medium
CN111737636A
Lane track point generation method and device, electronic equipment and storage medium
CN114578401A