A lane centerline determination method, apparatus, device and medium
By calculating the lateral distance variance and weight of lane lines in the intelligent driving system and selecting lane lines with better linearity as references, the problem of insufficient lane centerline calculation accuracy is solved, thereby improving vehicle driving safety.
Patent Information
- Application Number
- CN202510096784.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-21
- Publication Date
- 2025-10-14
- Estimated Expiration
- 2045-01-21
AI Technical Summary
In complex road scenarios, the lane centerline calculation accuracy of a single-camera-based intelligent driving system is insufficient, causing the vehicle to deviate or the steering wheel angle to be too large, and may even cause a traffic accident.
By obtaining the longest length of the left and right lane lines as the sampling distance, calculating the lateral distance of each sampling point, evaluating the lateral distance variance, and combining the preset threshold and weight, selecting the lane line with better straightness as the reference lane line to determine the lane centerline.
The accuracy of lane centerline determination is improved, ensuring that vehicles travel along the correct trajectory and reducing the risk of traffic accidents.
Smart Images

Figure CN119821409B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of intelligent driving, and in particular to a method, device, equipment and medium for determining a lane centerline. Background Art
[0002] Current intelligent driving control solutions based on a single camera typically output left and right lane markings. The centerline of the lane must be calculated based on these left and right lane markings for back-end control. In complex road scenarios, such as ramp ingress and egress, merging and diverging, an incorrectly calculated centerline can cause the vehicle to veer off course, generate a large steering angle, or even cause an accident.
[0003] Related technical solutions determine lane lines with excellent effects based on the confidence, effective length, curvature and other characteristics of the lane lines, and then calculate the center line based on the lane lines with excellent effects. However, the accuracy of determining the lane lines with excellent effects is insufficient, resulting in low accuracy of the lane center.
[0004] Therefore, how to accurately determine the lane centerline has become a technical problem that needs to be solved urgently in this field. Summary of the Invention
[0005] The purpose of this application is to provide a lane centerline determination method, device, equipment and medium that can accurately determine effective lane lines, thereby improving the accuracy of lane centerline determination.
[0006] In a first aspect, a method for determining a lane centerline is provided, comprising:
[0007] Get the left lane markings and right lane markings output by the current camera;
[0008] Determine the longest length of the first length of the left lane line and the second length of the right lane line as the sampling distance; the first length is the longitudinal coordinate of the farthest point of the left lane line, and the second length is the longitudinal coordinate of the farthest point of the right lane line;
[0009] Determining, based on the sampling distance and the preset number of sampling points, a first lateral distance of each first sampling point on a target lane line, where the target lane line is either the left lane line or the right lane line; the first lateral distance is the distance from the first sampling point to the longitudinal axis; and determining, based on the first lateral distance of each first sampling point on the target lane line, a lateral distance variance of the target lane line;
[0010] A reference lane line is determined from the left lane line and the right lane line based on the lateral distance variance of the left lane line and the lateral distance variance of the right lane line and a first preset variance threshold, and the reference lane line is used to determine the lane center line.
[0011] In a preferred example, the present application may be further configured to determine a reference lane line from the left lane line and the right lane line based on the lateral distance variance of the left lane line and the lateral distance variance of the right lane line and a first preset variance threshold, including:
[0012] If the lateral distance variances corresponding to the left lane marking and the right lane marking are both less than the first preset variance threshold, determining the lateral deviation variance of the target straight line of the target lane marking, and determining a reference lane marking from the left lane marking and the right lane marking based on the lateral deviation variance of the left lane marking, the lateral deviation variance of the right lane marking, and a second preset variance threshold;
[0013] If only one of the lateral distance variances of the left lane mark and the right lane mark is smaller than a first preset variance threshold, determining that the reference lane mark is a lane mark with a variance smaller than the first preset variance threshold;
[0014] If the lateral distance variance of the left lane line and the lateral distance variance of the right lane line are both not less than a first preset variance threshold, the left lane line weight and the right lane line weight are determined according to the lateral distance variance of the left lane line and the lateral distance variance of the right lane line; and the reference lane line is determined from the left lane line and the right lane line according to the left lane line weight and the right lane line weight.
[0015] In a preferred example, the present application may be further configured as follows: determining the lateral deviation variance of the target straight line of the target lane line includes:
[0016] Determining, based on the sampling distance and the preset number of sampling points, a second lateral distance corresponding to each second sampling point on a target straight line of the target lane line, the target straight line being a line formed by connecting the farthest point determined based on the sampling distance and the current initial point, and the second lateral distance being the distance from the second sampling point to the longitudinal axis;
[0017] Determine a lateral deviation between a second lateral distance of a second sampling point of the target lane line and a first lateral distance of a first sampling point corresponding to the second sampling point;
[0018] According to each lateral deviation of the target lane line, a lateral deviation variance of the target lane line is determined.
[0019] In a preferred example, the present application may be further configured to: determine a reference lane line from the left lane line and the right lane line based on the lateral deviation variance of the left lane line, the lateral deviation variance of the right lane line, and a second preset variance threshold, including:
[0020] When the lateral deviation variance of the left lane line and the lateral deviation variance of the right lane line are both less than a second preset variance threshold, determining that the reference lane line includes the left lane line and the right lane line;
[0021] Otherwise, the reference lane line is determined to be the lane line corresponding to the target lateral deviation variance, where the target lateral deviation variance is the smallest variance between the lateral deviation variance of the left lane line and the lateral deviation variance of the right lane line.
[0022] In a preferred example, the present application may be further configured to: determine a reference lane line from the left lane line and the right lane line according to the left lane line weight and the right lane line weight, including:
[0023] Determining a weight difference between the left lane line weight and the right lane line weight;
[0024] If the weight difference is less than a preset weight difference threshold, determining that the reference lane marking is the left lane marking and the right lane marking;
[0025] If the weight difference is not less than a preset weight difference threshold, the reference lane line is determined to be the lane line with a smaller weight between the left lane line and the right lane line.
[0026] In a preferred example, the present application may be further configured to include:
[0027] If the reference lane line includes one lane line, determining a lane centerline based on the one lane line and a lane width, wherein the lane width is determined based on the left lane line and the right lane line;
[0028] If the reference lane line includes the left lane line and the right lane line, the lane center line is determined according to the left lane line and the right lane line.
[0029] In a preferred example, the present application may be further configured to include:
[0030] determining whether the lane width is greater than a preset lane width threshold;
[0031] Accordingly, determining the lane centerline according to the lane line and the lane width includes:
[0032] If the lane width is greater than a preset lane width threshold, determining a lane centerline based on the one lane line and the set lane width;
[0033] Accordingly, determining the lane centerline according to the left lane line and the right lane line includes:
[0034] If the lane width is greater than a preset lane width threshold, the lane centerline is determined based on either the left lane line or the right lane line and the set lane width.
[0035] In a second aspect, a lane centerline determination device is provided, comprising:
[0036] The acquisition module is used to obtain the left lane markings and right lane markings output by the current camera;
[0037] a sampling distance determination module, configured to determine the longest length of a first length of the left lane line and a second length of the right lane line as the sampling distance; the first length being the longitudinal coordinate of the farthest point of the left lane line, and the second length being the longitudinal coordinate of the farthest point of the right lane line;
[0038] a lateral distance determination module, configured to determine, based on the sampling distance and a preset number of sampling points, a first lateral distance of each first sampling point on a target lane line, where the target lane line is either the left lane line or the right lane line; the first lateral distance being the distance from the first sampling point to the longitudinal axis;
[0039] a lateral distance variance determining module, configured to determine a lateral distance variance of the target lane line according to a first lateral distance of each first sampling point on the target lane line;
[0040] A reference lane line determination module is used to determine a reference lane line from the left lane line and the right lane line based on the lateral distance variance of the left lane line and the lateral distance variance of the right lane line and a first preset variance threshold, wherein the reference lane line is used to determine the lane center line.
[0041] In a third aspect, an electronic device is provided, comprising a memory and a processor, wherein a computer program is stored in the memory, and the processor executes the lane centerline determination method described in any one of the first aspects when running the computer program.
[0042] In a fourth aspect, a computer-readable storage medium is provided, wherein at least one program code is stored in the computer-readable storage medium, and the program code is loaded and executed by a processor to implement the lane centerline determination method as described in any one of the first aspects.
[0043] In a fifth aspect, a computer program product is provided, comprising a computer program or instructions, which, when executed by a processor, implements the lane centerline determination method as described in any one of the first aspects.
[0044] In summary, the lane centerline determination method provided by this application has the following beneficial technical effects:
[0045] The left and right lane lines output by the current camera are obtained, and the longest of the left and right lane lines is determined as the sampling distance, so that the sampling can cover the farthest recognizable lane line. Based on the sampling distance and the preset number of sampling points, the first lateral distance of each first sampling point on the target lane line is accurately calculated. The linearity of the lane line is evaluated by calculating the lateral distance variance of the target lane line. The smaller the variance, the closer the lane line is to a straight line. By combining the lateral distance variance of the left and right lane lines with the first preset variance threshold, the lane line with better linearity can be selected from the left and right lane lines as the reference lane line, thereby more accurately determining the lane centerline.
[0046] In addition, the present application also provides a lane centerline determination device, equipment and medium, all of which have the above-mentioned beneficial technical effects. BRIEF DESCRIPTION OF THE DRAWINGS
[0047] In order to more clearly illustrate the embodiments of the present application or the technical solutions of the prior art, the following is a brief introduction to the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0048] Figure 1 This is a flow chart of a lane centerline determination method provided in an embodiment of the present application;
[0049] Figure 2 This is a schematic diagram of a lane line on both sides provided by an embodiment of the present application;
[0050] Figure 3 This is a schematic diagram of an embodiment of the present application in which one lane line is a curved line with an arc and the other side is a straight line;
[0051] Figure 4 is a schematic diagram of a lateral deviation provided in an embodiment of the present application;
[0052] Figure 5 This is a schematic diagram of a scenario provided by an embodiment of the present application;
[0053] Figure 6 This is another scenario diagram provided by an embodiment of the present application;
[0054] Figure 7 This is a schematic diagram of lane width calculation provided by an embodiment of the present application;
[0055] Figure 8 This is a flow chart of another lane centerline determination method provided in an embodiment of the present application;
[0056] Figure 9 This is a schematic structural diagram of a lane centerline determination device provided in an embodiment of the present application;
[0057] Figure 10 This is a structural diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0058] This specific embodiment is merely an explanation of the present application and is not a limitation of the present application. After reading this specification, those skilled in the art may make non-creative modifications to the present embodiment as needed, but as long as they are within the scope of the present application, they are protected by patent law.
[0059] It should be noted that in the optional embodiments of the present application, the object information and other related data involved, when the embodiments in the present application are applied to specific products or technologies, need to obtain the permission or consent of the object, and the collection, use and processing of the relevant data need to comply with the relevant laws, regulations and standards of the relevant countries and regions. In other words, if the embodiments of the present application involve data related to the object, it needs to be obtained through the authorization and consent of the object, the authorization and consent of the relevant departments, and in compliance with the relevant laws, regulations and standards of the country and region. If personal information is involved in the embodiments, the acquisition of all personal information requires the consent of the individual. If sensitive information is involved, the separate consent of the information subject needs to be obtained. The embodiments also need to be implemented with the authorization and consent of the object.
[0060] To make the purpose, technical solutions, and advantages of the embodiments of this application more clear, the technical solutions in the embodiments of this application will be clearly and completely described below in conjunction with the drawings in the embodiments of this application. Obviously, the described embodiments are part of the embodiments of this application, not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.
[0061] In this document, the term "and / or" simply describes a relationship between related objects, indicating that three possible relationships exist. For example, "A and / or B" can represent: A exists alone, A and B exist simultaneously, or B exists alone. Furthermore, the character " / " in this document, unless otherwise specified, generally indicates an "or" relationship between the related objects.
[0062] In current intelligent driving solutions based on a single camera, the center line is calculated based on the lane lines on the left and right sides. If the calculated center line is incorrect in complex road scenarios, such as ramp inflow, outflow, and merger, it can cause the vehicle to deviate, or cause the vehicle to produce a large steering wheel angle, or even cause a traffic accident.
[0063] The embodiment of the present application calculates the variance of the lateral distance between the vehicle and the left and right lane lines by evenly sampling points on the left and right lane lines, respectively. This can accurately determine which of the current left and right lane lines is more consistent with the trajectory of the vehicle, thereby guiding the vehicle to travel along the correct trajectory.
[0064] Specifically, the embodiment of the present application provides a method for determining the lane centerline, such as Figure 1 As shown, the method provided in the embodiment of the present application can be executed by an electronic device, which is a server. The server can be an independent physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing cloud computing services. The terminal device can be a smartphone, a tablet computer, a laptop computer, a desktop computer, a vehicle-mounted device, etc., but is not limited to these. The terminal device and the electronic device can be directly or indirectly connected via wired or wireless communication, which is not limited in the embodiment of the present application. The method includes:
[0065] S101, obtaining the left lane marking and the right lane marking output by the current camera;
[0066] In this embodiment of the present application, the camera captures and analyzes images to obtain expressions for the left and right lane lines. Furthermore, the output left and right lane lines have a fixed length and are not infinitely extended. The lane line expressions can be cubic or quintic polynomials, and this embodiment is not limited thereto; these expressions can be set based on actual needs.
[0067] A cubic polynomial For example, in the form of:
[0068] : Indicates the lateral distance from the center axis of the vehicle to the lane line;
[0069] : represents the heading angle between the vehicle and the lane line;
[0070] : represents the curvature of the lane line;
[0071] : represents the curvature change rate of the lane line;
[0072] Therefore, the left lane line is expressed as: ; The right lane line is represented as: .
[0073] S102: Determine the longest length of a first length of the left lane line and a second length of the right lane line as a sampling distance;
[0074] The first length is the longitudinal coordinate of the farthest point of the left lane line, and the second length is the longitudinal coordinate of the farthest point of the right lane line;
[0075] S103, determining a first lateral distance of each first sampling point on the target lane line according to the sampling distance and the preset number of sampling points;
[0076] The target lane line is any one of the left lane line and the right lane line, and the first lateral distance is the distance from the first sampling point to the longitudinal axis;
[0077] In this embodiment of the present application, the longest effective length of the left and right lane lines is selected as the longest sampling distance LongPreDist of the lane lines. This effective length refers to the maximum longitudinal coordinate of the farthest point of the left lane line and the farthest point of the right lane line output by the camera. Determining the longest length as the sampling distance ensures that regardless of the degree of road curvature, the sampling can cover the farthest end of the lane line, avoiding centerline determination errors caused by insufficient sampling range. The number of preset sampling points is not limited in this embodiment of the present application, and the user can set it according to actual needs, such as 8, 9, 10, 15, etc.
[0078] Assuming the preset number of sampling points is 10, the spacing between adjacent points is step = LongPreDist / 10. Substitute the distance at each first sampling point into the left and right lane lines, and calculate the lateral distance from the vehicle to each sampling point on the left and right lane lines, that is, the first lateral distance from the first sampling point to the longitudinal axis; in, ; .
[0079] In one possible scenario, = step*i, i = 0, 1, ..., 9, to ensure that the distribution of sampling points is uniform and reasonable, as shown in Table 1:
[0080] Table 1
[0081]
[0082] At this time, the first lateral distance of each first sampling point on the left lane line is 、 … ; The first lateral distance of each first sampling point on the right lane line is 、 … .
[0083] S104, determining a lateral distance variance of the target lane line based on the first lateral distance of each first sampling point on the target lane line;
[0084] In this embodiment, the average values of the lateral distances between the first sampling points of the left and right lane lines (LeftAverageY0 and RightAverageY0) are calculated. From these values, the lateral distance variances (LeftLineVariance) for the left lane line and RightLineVariance for the right lane line are calculated. The calculated lateral distance variances are used to quantitatively assess the straightness of the lane lines, providing a basis for lane line selection and centerline determination.
[0085] Take the preset number of sampling points as 10 as an example:
[0086] ;
[0087] .
[0088] S105. Determine a reference lane line from the left lane line and the right lane line based on the lateral distance variance of the left lane line and the lateral distance variance of the right lane line and a first preset variance threshold. The reference lane line is used to determine the lane centerline.
[0089] A first preset variance threshold is pre-set, which is set by technicians based on experience and can be adjusted in practice. The first preset variance threshold can be 0.05, 0.08, 0.1, etc.
[0090] In an embodiment of the present application, the reference lane line is determined by combining the lateral distance variance and the preset variance threshold, which can intelligently screen out lane lines with better linearity as the basis for determining the lane centerline, thereby effectively improving the accuracy of lane centerline determination and making the determination of the lane centerline more in line with actual road conditions.
[0091] It can be seen that in the embodiment of the present application, the left lane line and the right lane line output by the current camera are obtained, and the longest one of the left lane line and the right lane line is determined as the sampling distance, so that the sampling can cover the farthest recognizable lane line; based on the sampling distance and the preset number of sampling points, the first lateral distance of each first sampling point on the target lane line is accurately calculated; by calculating the lateral distance variance of the target lane line, the linearity of the lane line is evaluated, and the smaller the variance, the closer the lane line is to a straight line; and then combined with the lateral distance variance of the left and right lane lines and the first preset variance threshold, the lane line with better linearity can be selected from the left lane line and the right lane line as the reference lane line, thereby more accurately determining the lane centerline.
[0092] A possible implementation of the embodiment of the present application includes determining a reference lane line from the left lane line and the right lane line based on the lateral distance variance of the left lane line and the lateral distance variance of the right lane line and a first preset variance threshold, including:
[0093] S1051. If the lateral distance variances corresponding to the left lane marking and the right lane marking are both less than the first preset variance threshold, determining the lateral deviation variance of the target straight line of the target lane marking, and determining a reference lane marking from the left lane marking and the right lane marking based on the lateral deviation variance of the left lane marking, the lateral deviation variance of the right lane marking, and the second preset variance threshold;
[0094] In one achievable manner, if the lateral distance variances corresponding to the left lane line and the right lane line are both smaller than a first preset variance threshold, the reference lane line is determined to be the left lane line and the right lane line.
[0095] In another feasible method, in order to accurately determine the reference lane line, the lateral distance variance can represent the changing trend of a curve. If the lateral distance variance is less than the first preset variance threshold, it is considered that the curve is consistent with the driving trajectory of the vehicle. However, there may be two working conditions where the lateral distance variance is less than the first preset variance threshold, such as Figure 2 and Figure 3 , Figure 2 This is a schematic diagram of a lane line on both sides provided by an embodiment of the present application; Figure 3 This is a schematic diagram provided by an embodiment of the present application in which a lane line on one side is a curved line with an arc and another side is a straight line.
[0096] At this time, based on Figure 3 ,as well as Figure 4 , the lateral distance deviations of the left lane line and the right lane line calculated based on the current vehicle posture may be relatively small. If the left lane line and the right lane line are used to calculate the center line at this time, the calculated center line may not be ideal. The actual desired effect is to fit the lane line based on the straight line on the right. The method used at this time is to take a starting point and an end point on the current left and right lane lines, and then connect the two points into a straight line. The second lateral distance LatDistToLeftInterpolateLine and LatDistToRightInterpolateLine from the vehicle to the target straight lines on both sides are calculated respectively, and the first lateral distance LatDistToLeftLine and LatDistToRightLine from the vehicle to the lane lines on both sides are calculated. Then the difference between the two distances is calculated to obtain the distance from each point on the straight line to the lane, that is, the lateral deviation; then the lateral deviation variance is determined; according to the lateral deviation variance of the left lane line, the lateral deviation variance of the right lane line, and the second preset variance threshold, the reference lane line is determined from the left lane line and the right lane line.
[0097] S1052: If only one of the lateral distance variances of the left lane marking and the right lane marking is smaller than a first preset variance threshold, determine that the reference lane marking is the lane marking with a variance smaller than the first preset variance threshold.
[0098] Among them, if the lateral distance variance of the left lane line , the lateral distance variance of the right lane line , one side is smaller than the first preset variance threshold, and the other side is larger than the first preset variance threshold, then the reference lane line is determined to be the lane line smaller than the first preset variance threshold, so that the lane line with the variance smaller than the first preset variance threshold can be directly used to calculate the lane center line. The corresponding scenario example is as follows Figure 5 As shown: At this time, the variance calculated for the left lane line is less than the first preset variance threshold, and the variance calculated for the right lane line is greater than the first preset variance threshold. The lane centerline calculated based on the left lane line can well guide the vehicle to move straight forward without being affected by the curved line on the right.
[0099] S1053. If the lateral distance variance of the left lane line and the lateral distance variance of the right lane line are both not less than the first preset variance threshold, determine the left lane line weight and the right lane line weight based on the lateral distance variance of the left lane line and the lateral distance variance of the right lane line; and determine the reference lane line from the left lane line and the right lane line based on the left lane line weight and the right lane line weight.
[0100] If the calculated lateral distance variance of the left lane line , the lateral distance variance of the right lane line When both are greater than the first preset variance threshold, the lane line on the left and right sides is determined by calculating the weight of the variance of the lane lines on the left and right sides. The left lane line weight can be represented by LeftLineVarianceWeight, and the right lane line weight can be represented by RightLineVarianceWeight. Then:
[0101] ;
[0102] ;
[0103] Furthermore, after determining the left lane line weight and the right lane line weight, a reference lane line is determined from the left lane line and the right lane line according to the left lane line weight and the right lane line weight.
[0104] A possible implementation of the embodiment of the present application is to determine the lateral deviation variance of the target straight line of the target lane line, including:
[0105] Determine, based on the sampling distance and the preset number of sampling points, a second lateral distance corresponding to each second sampling point on a target line of the target lane, where the target line is a line formed by connecting the farthest point determined based on the sampling distance and the current initial point; wherein the second lateral distance is the distance from the second sampling point to the longitudinal axis;
[0106] Determine a lateral deviation between a second lateral distance of a second sampling point of the target lane line and a first lateral distance of a first sampling point corresponding to the second sampling point;
[0107] According to each lateral deviation of the target lane line, a lateral deviation variance of the target lane line is determined.
[0108] Among them, Figure 4 For example, the circle represents the second sampling point, and the square represents the first sampling point. Each sampling pair corresponds to the same vertical axis coordinate. Taking the left lane line as an example, the cubic polynomial equation of the left lane line can be expressed as: , then the lateral distance from the vehicle to the starting point of the left lane line is for: ; Given that the longest sampling distance of a lane line is LongPreDist, the lateral distance from the vehicle to the end of the left lane line is : .
[0109] With this starting point (0, ), end point (LongPreDist, ) are connected into a straight line to form the target line, then the second lateral distance from the vehicle to any sampling point on the target line is for:
[0110] ;
[0111] Calculate the lateral deviation between the second lateral distance from the vehicle to the interpolation line (target line) and the first lateral distance to the lane line at each pair of sampling points for:
[0112] ;
[0113] Calculate the average value of the lateral deviation at all sampling points for:
[0114] ;
[0115] Calculate the lateral deviation variance of the lateral deviation for:
[0116] ;
[0117] The variance of the lateral distance between the left lane line and the straight line connecting its starting point and end point can be calculated as , the variance of the second lateral distance between the right lane line and the straight line connecting its starting point and end point is .
[0118] A possible implementation of the embodiment of the present application includes determining a reference lane line from the left lane line and the right lane line based on the lateral deviation variance of the left lane line, the lateral deviation variance of the right lane line, and a second preset variance threshold, including:
[0119] When the lateral deviation variance of the left lane line and the lateral deviation variance of the right lane line are both less than a second preset variance threshold, it is determined that the reference lane line includes the left lane line and the right lane line;
[0120] Otherwise, the reference lane line is determined to be the lane line corresponding to the target lateral deviation variance, and the target lateral deviation variance is the minimum variance between the lateral deviation variances of the left lane line and the lateral deviation variance of the right lane line.
[0121] In the embodiment of the present application, a second preset variance threshold is pre-set. This value is set by a technician based on experience and can be adjusted in practice. The second preset variance threshold can be equal to or different from the first preset variance threshold, and the embodiment of the present application is not limited thereto. The second preset variance threshold can be 0.05, 0.08, 0.1, etc.
[0122] If the calculated left lane line lateral deviation variance Variance of lateral deviation from the right lane line If both lane lines are less than the second preset variance threshold, both lane lines are considered straight. In this case, the reference lane lines include the left and right lane lines, and the centerline can be calculated using both lane lines. If one lane line is less than the second preset variance threshold and the other lane line is greater than the second preset variance threshold, the lane line with the greater variance threshold may be a curved curve. In this case, the reference lane line is considered to be the lane line with the less than second preset variance threshold. The lane centerline is then calculated based on the lane line with the less than 0.1 variance, using the lane width. If both lane lines are greater than 0.1, the lane centerline can only be calculated based on the lane line with the smaller variance. In this case, the reference lane line is the lane line with the smaller lateral deviation variance.
[0123] A possible implementation of the embodiment of the present application includes determining a reference lane line from the left lane line and the right lane line according to the left lane line weight and the right lane line weight, including:
[0124] Determine the weight difference between the left lane line weight and the right lane line weight;
[0125] According to the weight difference, the reference lane line is determined from the left lane line and the right lane line.
[0126] It is understandable that the larger the weight, the faster the lane line on the corresponding side changes. Usually, the lane line with a smaller weight is selected. The reference lane line is determined by calculating the weight difference WeightError between the lane line and the right lane line. The weight difference is calculated as follows: WeightError = abs( Specifically, determining the reference lane line from the left lane line and the right lane line based on the weight difference includes:
[0127] If the weight difference is less than the preset weight difference threshold, the reference lane line is determined to be the left lane line and the right lane line;
[0128] If the weight difference is not less than the preset weight difference threshold, the reference lane line is determined to be the lane line with the smaller weight between the left lane line and the right lane line.
[0129] Among them, the preset weight difference threshold is a pre-set value, which can be set according to the experience of technical personnel and is not limited in this embodiment. For example, it can be set to 0.15.
[0130] The weight difference can be used to determine the reference lane line under large variance conditions, which can be divided into the following conditions:
[0131] If the weight difference WeightError is less than the preset weight difference threshold, it means that the weights of the lane lines on both sides are not much different, and the lane lines on both sides have the same change trend. In this case, both lane lines are considered valid, and the reference lane lines are determined to be the left lane line and the right lane line. Then, the center line is calculated based on the lane lines on both sides. For example, Figure 6 As shown in a, b, and c, when the curve is normal, the center line is calculated based on the lane lines on both sides. When the lane lines are eight inches inward, the center line is calculated based on the lane lines on both sides. When the lane lines are eight inches outward, the center line can also be calculated based on the lane lines on both sides.
[0132] If the weight difference WeightError is not less than the preset weight difference threshold, the lane line on the side with the smaller current weight is selected as the reference lane line to calculate the center line.
[0133] A possible implementation of the embodiment of the present application further includes:
[0134] If the reference lane line includes one lane line, determining the lane centerline based on the one lane line and the lane width, wherein the lane width is determined based on the left lane line and the right lane line;
[0135] If the reference lane lines include a left lane line and a right lane line, the lane center line is determined based on the left lane line and the right lane line.
[0136] If the reference lane has only one lane line, specifically the right lane line, the lane centerline is:
[0137] ;
[0138] If the reference lane line is only one lane line, specifically the right lane line, the lane center line is:
[0139] ;
[0140] If the reference lane line includes the left lane line and the right lane line, the lane center line is:
[0141] .
[0142] For the calculation of the lane width, see Figure 7 , the position relationship between the vehicle body posture of the ego vehicle and the lane line of the road can be represented by the following figure: C0_Left represents the distance from the rear axle center of the ego vehicle to the left lane line, C0_Right represents the distance from the rear axle center of the ego vehicle to the right lane line, and the heading angle with the lane line is , generally the distance from the ego vehicle to the left lane line is positive, and the distance to the right lane line is negative, so the lane width of the current lane can be represented as: .
[0143] In an implementable manner, the method further comprises: determining whether the lane width is greater than a preset lane width threshold; accordingly, determining the lane center line according to one lane line and the lane width, comprising: if the lane width is greater than the preset lane width threshold, determining the lane center line according to one lane line and the set lane width; accordingly, determining the lane center line according to the left lane line and the right lane line, comprising: if the lane width is greater than the preset lane width threshold, determining the lane center line according to any one of the left lane line and the right lane line and the set lane width.
[0144] The preset lane width threshold can be user-defined, such as 4m, and the set lane width can be user-defined, such as 3.5m. Generally, the width of a normal lane is about 3.5m, and a lane wider than four meters is considered a super-wide lane. Generally, a center line is calculated based on one side lane line with a lane width of 3.5m, which is done to enable the lane to be followed along one side lane line in a wider lane.
[0145] Based on any of the above embodiments, the present embodiment provides a specific lane center line determination method, see Figure 8 , comprising:
[0146] perceiving the input lane line; calculating the current lane width based on the left and right lane lines; calculating the variance of the lateral distance of the left and right lane lines based on the current posture of the ego vehicle;
[0147] If the lane line variance of both vehicles is less than 0.1, the lateral deviation variance of the left and right lane lines and the straight line formed by the start and end points of the lane line is calculated; if the variances of both sides are less than 0.1, it is considered that the lane lines of both vehicles are effective; if the variance of one side is greater than 0.1 and the variance of the other side is less than 0.1, it is considered that the lane line of the side with the smaller variance is effective; if the variances of both sides are greater than 0.1, it is considered that the lane line of the side with the smaller variance is effective.
[0148] If the variance of one side is less than 0.1 and the variance of the other side is greater than 0.1, it is considered that the lane line of the side with the smaller variance is effective.
[0149] If the variances of both sides are greater than 0.1, the weight of the variances of the left and right lane lines is calculated; if the absolute value of the difference between the weights of the variances of the left and right lane lines is less than 0.15, it is considered that the lane lines of both sides are effective; if the absolute value of the difference between the weights of the variances of the left and right lane lines is greater than 0.15, it is considered that the lane line of the side with the smaller weight is effective.
[0150] The embodiment of the present application can accurately indicate which lane line is more matched with the motion trajectory of the ego vehicle by calculating the lateral distance variance of the ego vehicle to the sampling points of the left and right lane lines under the current vehicle body posture. If the variances of both lane lines are less than 0.1, the lateral distance variance of the current lane line and the straight line formed by the start and end points of the lane line is calculated, and then it can be clearly judged whether the current lane line is a straight line. If the variances of both lane lines are greater than 0.1, the weight of the lane line is used to judge the change trend of the two lane lines. If the weights are close to each other, it is considered that both lane lines are available, otherwise, the lane line with the smaller weight is selected. The algorithm can clearly indicate the change trend of the current lane line and correctly guide the driving direction of the vehicle.
[0151] Next, an apparatus provided by an embodiment of the present application is described. The apparatus described below can be referred to the method described above. The apparatus of the embodiment is arranged in an electronic device, which is described with reference to Figure 9 , Figure 9 is a structural block diagram of the apparatus of one embodiment of the present application, which includes:
[0152] The acquisition module 210 is configured to acquire the left lane line and the right lane line output by the current camera.
[0153] The sampling distance determination module 220 is configured to determine the longest length of the first length of the left lane line and the second length of the right lane line as the sampling distance. The first length is the longitudinal axis coordinate of the farthest point of the left lane line, and the second length is the longitudinal axis coordinate of the farthest point of the right lane line.
[0154] The transverse distance determination module 230 is configured to determine a first transverse distance of each first sampling point on the target lane line according to the sampling distance and the preset number of sampling points, the target lane line being any one of the left lane line and the right lane line, and the first transverse distance being a distance of the first sampling point to the longitudinal axis.
[0155] The transverse distance variance determination module 240 is configured to determine a transverse distance variance of the target lane line according to the first transverse distance of each first sampling point on the target lane line.
[0156] The reference lane line determination module 250 is configured to determine a reference lane line from the left lane line and the right lane line according to the transverse distance variance of the left lane line, the transverse distance variance of the right lane line, and a first preset variance threshold, the reference lane line being used to determine the lane center line.
[0157] In a preferred example, the reference lane line determination module 250 is further configured to:
[0158] If the transverse distance variances corresponding to the left lane line and the right lane line are both less than the first preset variance threshold, the transverse deviation variance of the target straight line of the target lane line is determined, and the reference lane line is determined from the left lane line and the right lane line according to the transverse deviation variance of the left lane line, the transverse deviation variance of the right lane line, and a second preset variance threshold.
[0159] If only one of the transverse distance variances of the left lane line and the right lane line is less than the first preset variance threshold, the reference lane line is determined as the lane line with the transverse distance variance less than the first preset variance threshold.
[0160] If the transverse distance variances of the left lane line and the right lane line are both not less than the first preset variance threshold, the left lane line weight and the right lane line weight are determined according to the transverse distance variance of the left lane line and the transverse distance variance of the right lane line, and the reference lane line is determined from the left lane line and the right lane line according to the left lane line weight and the right lane line weight.
[0161] In a preferred example, the reference lane line determination module 250 is further configured to:
[0162] The second transverse distance corresponding to each second sampling point on the target straight line of the target lane line is determined according to the sampling distance and the preset number of sampling points, the target straight line being a straight line formed by connecting the farthest point determined based on the sampling distance and the current initial point, and the second transverse distance being a distance of the second sampling point to the longitudinal axis.
[0163] The transverse deviation of the second transverse distance of the second sampling point of the target lane line from the first transverse distance of the first sampling point corresponding to the second sampling point is determined.
[0164] According to each lateral deviation of the target lane line, a lateral deviation variance of the target lane line is determined.
[0165] In a preferred example, the present application may be further configured as: a reference lane line determination module 250 for:
[0166] When the lateral deviation variance of the left lane line and the lateral deviation variance of the right lane line are both less than a second preset variance threshold, it is determined that the reference lane line includes the left lane line and the right lane line;
[0167] Otherwise, the reference lane line is determined to be the lane line corresponding to the target lateral deviation variance, and the target lateral deviation variance is the minimum variance between the lateral deviation variances of the left lane line and the lateral deviation variance of the right lane line.
[0168] In a preferred example, the present application may be further configured as: a reference lane line determination module 250 for:
[0169] Determine the weight difference between the left lane line weight and the right lane line weight;
[0170] If the weight difference is less than the preset weight difference threshold, the reference lane line is determined to be the left lane line and the right lane line;
[0171] If the weight difference is not less than the preset weight difference threshold, the reference lane line is determined to be the lane line with the smaller weight between the left lane line and the right lane line.
[0172] In a preferred example, the present application may be further configured to include:
[0173] a first lane centerline determination module, configured to determine the lane centerline based on the lane line and a lane width if the reference lane line includes a lane line, wherein the lane width is determined based on a left lane line and a right lane line;
[0174] The second lane centerline determination module is used to determine the lane centerline according to the left lane line and the right lane line if the reference lane line includes a left lane line and a right lane line.
[0175] In a preferred example, the present application may be further configured to include:
[0176] A lane width determination module is used to determine whether the lane width is greater than a preset lane width threshold;
[0177] Accordingly, the first lane centerline determination module is configured to:
[0178] If the lane width is greater than the preset lane width threshold, the lane centerline is determined based on one lane line and the set lane width;
[0179] Accordingly, the second lane centerline determination module is used to:
[0180] If the lane width is greater than the preset lane width threshold, the lane centerline is determined based on either the left lane line or the right lane line and the set lane width.
[0181] An electronic device is provided in an embodiment of the present application, such as Figure 10 As shown, Figure 10 The electronic device 300 shown includes: at least one processor 301 ( Figure 10 301 and memory 303. The processor 301 and memory 303 are connected, for example, via a bus 302. Optionally, the electronic device 300 may further include a transceiver 304. It should be noted that in practical applications, the number of transceivers 304 is not limited to one, and the structure of the electronic device 300 does not constitute a limitation on the embodiments of the present application.
[0182] Processor 301 can be a CPU (Central Processing Unit), a general-purpose processor, a DSP (Digital Signal Processor), an ASIC (Application Specific Integrated Circuit), an FPGA (Field Programmable Gate Array), or other programmable logic device, transistor logic device, hardware component, or any combination thereof. It can implement or execute the various exemplary logic blocks, modules, and circuits described in conjunction with the disclosure of this application. Processor 301 can also be a combination that implements computing functions, such as a combination of one or more microprocessors, a combination of a DSP and a microprocessor, etc.
[0183] Bus 302 may include a path for transmitting information between the above components. Bus 302 may be a PCI (Peripheral Component Interconnect) bus or an EISA (Extended Industry Standard Architecture) bus. Bus 302 may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, Figure 10 Only one thick line is used in the diagram, but this does not mean that there is only one bus or one type of bus.
[0184] The memory 303 can be a ROM (Read Only Memory) or other type of static storage device that can store static information and instructions, a RAM (Random Access Memory) or other type of dynamic storage device that can store information and instructions, an EEPROM (Electrically Erasable Programmable Read Only Memory), a CD-ROM (Compact Disc Read Only Memory) or other optical disk storage, a magnetic disk storage or other magnetic storage devices, or any other medium capable of storing desired program code in the form of instructions or data structures and that can be accessed by a computer, but is not limited thereto.
[0185] The memory 303 is configured to store application program codes for implementing the solutions of the present application, and the processor 301 is configured to control the execution of the application program codes. The processor 301 is configured to execute the application program codes stored in the memory 303 to implement the content shown in the foregoing method embodiments.
[0186] Figure 10 The electronic device shown is merely an example, and should not impose any limitation on the functions and use range of the embodiments of the present application.
[0187] The embodiments of the present application provide a computer readable storage medium, which stores at least one program code, and when the program code is executed on a computer, the computer can execute the corresponding content in the foregoing method embodiments.
[0188] The embodiments of the present application provide a computer program product, which includes a computer program or instructions, and the computer program or instructions are executed by a processor to implement the corresponding content in the foregoing method embodiments.
[0189] It should be understood that, although each step in the flowchart of the accompanying drawings is shown in sequence according to the direction of the arrow, these steps are not necessarily executed in sequence according to the direction of the arrow. Unless otherwise specified herein, the execution of these steps is not strictly limited in sequence, and they can be executed in other sequences. Moreover, at least part of the steps in the flowchart of the accompanying drawings can include multiple sub-steps or multiple stages, which are not necessarily executed at the same time, but can be executed at different times, and the execution sequence is not necessarily sequential, but can be executed in rotation or alternation with at least part of other steps or sub-steps or stages of other steps.
[0190] The above are only some of the implementation methods of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.
Claims
1. A method for determining a lane centerline, characterized in that: include: Get the left lane markings and right lane markings output by the current camera; Determine the longest length of the first length of the left lane marking and the second length of the right lane marking as a sampling distance; The first length is the longitudinal coordinate of the farthest point of the left lane line, and the second length is the longitudinal coordinate of the farthest point of the right lane line; Determine, based on the sampling distance and the preset number of sampling points, a first lateral distance of each first sampling point on a target lane line, where the target lane line is either the left lane line or the right lane line; the first lateral distance is the distance from the first sampling point to the longitudinal axis; Determine a lateral distance variance of the target lane line according to a first lateral distance of each first sampling point on the target lane line; A reference lane line is determined from the left lane line and the right lane line based on the lateral distance variance of the left lane line and the lateral distance variance of the right lane line and a first preset variance threshold, and the reference lane line is used to determine the lane center line.
2. The lane centerline determination method according to claim 1, characterized in that: Determining a reference lane line from the left lane line and the right lane line according to the lateral distance variance of the left lane line and the lateral distance variance of the right lane line and a first preset variance threshold includes: If the lateral distance variances corresponding to the left lane marking and the right lane marking are both less than the first preset variance threshold, determining the lateral deviation variance of the target straight line of the target lane marking, and determining a reference lane marking from the left lane marking and the right lane marking based on the lateral deviation variance of the left lane marking, the lateral deviation variance of the right lane marking, and a second preset variance threshold; If only one of the lateral distance variances of the left lane mark and the right lane mark is smaller than a first preset variance threshold, determining that the reference lane mark is a lane mark with a variance smaller than the first preset variance threshold; If the lateral distance variance of the left lane line and the lateral distance variance of the right lane line are both not less than a first preset variance threshold, the left lane line weight and the right lane line weight are determined according to the lateral distance variance of the left lane line and the lateral distance variance of the right lane line; and the reference lane line is determined from the left lane line and the right lane line according to the left lane line weight and the right lane line weight.
3. The lane centerline determination method according to claim 2, characterized in that: Determining the lateral deviation variance of the target straight line of the target lane line includes: Determining, based on the sampling distance and the preset number of sampling points, a second lateral distance corresponding to each second sampling point on a target straight line of the target lane line, the target straight line being a line formed by connecting the farthest point determined based on the sampling distance and the current initial point, and the second lateral distance being the distance from the second sampling point to the longitudinal axis; Determine a lateral deviation between a second lateral distance of a second sampling point of the target lane line and a first lateral distance of a first sampling point corresponding to the second sampling point; According to each lateral deviation of the target lane line, a lateral deviation variance of the target lane line is determined.
4. The lane centerline determination method according to claim 3, characterized in that: Determining a reference lane line from the left lane line and the right lane line according to the lateral deviation variance of the left lane line, the lateral deviation variance of the right lane line, and a second preset variance threshold includes: When the lateral deviation variance of the left lane line and the lateral deviation variance of the right lane line are both less than a second preset variance threshold, determining that the reference lane line includes the left lane line and the right lane line; Otherwise, the reference lane line is determined to be the lane line corresponding to the target lateral deviation variance, where the target lateral deviation variance is the smallest variance between the lateral deviation variance of the left lane line and the lateral deviation variance of the right lane line.
5. The lane centerline determination method according to claim 2, characterized in that: Determining a reference lane line from the left lane line and the right lane line according to the left lane line weight and the right lane line weight, comprising: Determining a weight difference between the left lane line weight and the right lane line weight; If the weight difference is less than a preset weight difference threshold, determining that the reference lane marking is the left lane marking and the right lane marking; If the weight difference is not less than a preset weight difference threshold, the reference lane line is determined to be the lane line with a smaller weight between the left lane line and the right lane line.
6. The lane centerline determination method according to any one of claims 1 to 5, characterized in that: Also includes: If the reference lane line includes one lane line, determining a lane centerline based on the one lane line and a lane width, wherein the lane width is determined based on the left lane line and the right lane line; If the reference lane line includes the left lane line and the right lane line, the lane center line is determined according to the left lane line and the right lane line.
7. The lane centerline determination method according to claim 6, characterized in that: Also includes: determining whether the lane width is greater than a preset lane width threshold; Accordingly, determining the lane centerline according to the lane line and the lane width includes: If the lane width is greater than a preset lane width threshold, determining a lane centerline based on the one lane line and the set lane width; Accordingly, determining the lane centerline according to the left lane line and the right lane line includes: If the lane width is greater than a preset lane width threshold, the lane centerline is determined based on either the left lane line or the right lane line and the set lane width.
8. A lane centerline determination device, characterized in that: include: The acquisition module is used to obtain the left lane markings and right lane markings output by the current camera; a sampling distance determination module, configured to determine the longest length of a first length of the left lane line and a second length of the right lane line as the sampling distance; the first length being the longitudinal coordinate of the farthest point of the left lane line, and the second length being the longitudinal coordinate of the farthest point of the right lane line; a lateral distance determination module, configured to determine, based on the sampling distance and a preset number of sampling points, a first lateral distance of each first sampling point on a target lane line, wherein the target lane line is either the left lane line or the right lane line, and the first lateral distance is the distance from the first sampling point to the longitudinal axis; a lateral distance variance determining module, configured to determine a lateral distance variance of the target lane line according to a first lateral distance of each first sampling point on the target lane line; A reference lane line determination module is used to determine a reference lane line from the left lane line and the right lane line based on the lateral distance variance of the left lane line and the lateral distance variance of the right lane line and a first preset variance threshold, wherein the reference lane line is used to determine the lane center line.
9. An electronic device, characterized in that: The electronic device includes a memory and a processor, wherein a computer program is stored in the memory, and the processor executes the lane centerline determination method according to any one of claims 1 to 7 when running the computer program.
10. A computer-readable storage medium, characterized in that The computer-readable storage medium stores at least one program code, and the program code is loaded and executed by the processor to implement the lane centerline determination method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Lane line reservation and detection algorithm based on binary image
CN104573627A
Line following driving mode switching method and device, equipment and medium
CN116853244A