Unstructured lane detection method based on Bezier curve and local regression algorithm
The unstructured lane detection method based on Bezier curve and local regression algorithm solves the problems of discontinuity and poor real-time performance in unstructured road detection, and achieves high-precision and efficient lane line recognition.
Patent Information
- Application Number
- CN202510735646.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-04
- Publication Date
- 2025-09-26
- Estimated Expiration
- 2045-06-04
AI Technical Summary
Existing unstructured road lane line detection technology has difficulty in accurately identifying lane lines under factors such as shadow occlusion, traffic marking wear, and obstacle occlusion. In addition, methods based on neural networks and support vector machines require a large number of sample training, resulting in detection discontinuity and poor real-time performance.
An unstructured lane detection method based on Bezier curves and local regression algorithm is adopted to improve detection accuracy and robustness through image preprocessing, road model selection, path continuity definition, maximum curvature constraint, curve smoothing and local weighted regression algorithm.
It achieves high-precision, real-time lane line detection on unstructured roads, overcomes the detection discontinuity problem of traditional methods, and improves detection accuracy and real-time performance.
Smart Images

Figure CN120260003B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of autonomous driving technology, and in particular relates to an unstructured lane detection method based on Bezier curves and a local regression algorithm. Background Art
[0002] Lane markings are critical infrastructure for ensuring safe and smooth traffic flow. On structured roads, they are typically marked on the road surface as solid or dashed lines. Lane detection is a key technology in autonomous driving, enabling safe and autonomous driving by identifying road boundaries and predicting vehicle trajectories. However, in real-world driving scenarios, factors such as shadows, worn traffic markings, and obstructions can interfere with accurate lane recognition. This is particularly true on unstructured roads, such as forest roads, rural roads, and muddy or sandy roads. These roads often lack lane markings and clear road boundaries, are shaded by dense vegetation, or are affected by waterlogging in unusual weather conditions, making it difficult to distinguish between road and non-road areas. Therefore, traditional lane detection technology has certain limitations.
[0003] Currently, unstructured road detection algorithms can be categorized into four categories: road feature-based methods, road model-based methods, neural network-based methods, and support vector machine-based methods. Road model-based methods require the construction of a highly adaptable road model, but are difficult to establish effective models in complex scenarios. Road feature-based methods distinguish between roads and non-roads based on the color and texture of the road, making them sensitive to shadows, lighting changes, and water accumulation. Both neural network-based and support vector machine-based methods require the collection of large numbers of samples and multiple training runs. Key points for road model-based methods include ensuring the continuity of the model path and considering the vehicle's maximum curvature constraint. In current research, some parametric spline algorithms for road models, while taking maximum curvature into account, suffer from path discontinuities. Furthermore, the connection between different road segments can also create discontinuities, significantly impacting the accuracy of the road model. To address these issues, the present invention proposes an unstructured lane detection method based on Bezier curves and a local regression algorithm. Summary of the Invention
[0004] The purpose of the present invention is to provide an unstructured lane detection method based on Bezier curves and a local regression algorithm, aiming to solve the problems raised in the above background technology.
[0005] The purpose of the present invention is achieved through the following technical solutions:
[0006] The unstructured lane detection method based on Bezier curve and local regression algorithm includes the following steps:
[0007] Step 1: Obtain road segment image;
[0008] Use the on-board camera to shoot unstructured roads, obtain road segment videos, and then extract road segment images from the videos;
[0009] Step 2: Image preprocessing;
[0010] Perform image preprocessing on the acquired road section images, including calibrating the onboard camera, correcting image distortion, converting the color space, delineating the ROI area, and converting the view into a bird's-eye view;
[0011] Step 3: Select the road model;
[0012] The B-spline basis function is used to replace the Bernstein basis function, and the cubic B-spline curve is adopted as the road model;
[0013] Step 4: Define the path continuity problem of the road model;
[0014] Step 5: Constrain the maximum curvature of the road model;
[0015] Step 6: midpoint insertion operation;
[0016] Step 7: Curve smoothing;
[0017] The maximum curvature constraint is satisfied by curve smoothing and the path curvature is derived as a function of the segment parameters;
[0018] Step 8: Smoothing of cubic B-spline curve road model;
[0019] Smoothing the cubic B-spline curve road model using the parameters obtained from steps 4 to 7;
[0020] Step 9: Implementation of local weighted regression algorithm;
[0021] Step 10: Fit and identify the road.
[0022] Furthermore, the specific steps of step 2 are as follows:
[0023] Step 2.1: Use Zhang Zhengyou calibration method to calibrate the camera to map the image pixel coordinates to the world coordinates of the corresponding points in space. The formula is as follows:
[0024] ;
[0025] in, is the midpoint of the camera coordinate system Z Coordinates, indicating the distance from the vehicle-mounted camera to the object being photographed in the direction of the optical axis; are the horizontal and vertical coordinates of the selected point in the pixel coordinate system respectively; is the pixel size; are the horizontal and vertical coordinates of the image center point in the pixel coordinate system respectively; f is the focal length of the onboard camera; = f / , = f / , are the normalized focal lengths on the x-axis and y-axis respectively; R is the rotation matrix, T is the translation matrix, which are all external parameters of the vehicle-mounted camera; The position components of the spatial point in the horizontal direction, vertical direction and depth direction in the world coordinate system respectively;
[0026] Step 2.2: Correct the image distortion using the following formula:
[0027] ;
[0028] in, is the radial distortion coefficient; is the coordinate in the normalized image coordinate system; are the horizontal and vertical coordinates in the corrected image coordinate system;
[0029] Step 2.3: Transform the obtained image from RGB space to HSV color space, where H is hue, S is saturation, and V is lightness; segment the image using HSV color space and obtain its gradient threshold in the S channel ( );
[0030] Step 2.4: Use the Sobel operator to detect the edge of the image and obtain the threshold of the image in the x direction ( ) and the threshold in the y direction ( ), and superimpose the gradient threshold of the Sobel operator in the x and y directions with the color threshold of the S channel of the HSV color space;
[0031] Step 2.5: The ROI area is defined by prior knowledge, and the ROI area range is ROI = [0, H / 2 ]x[0, W ], where W is the image width and H is the image height;
[0032] Step 2.6: Convert the processed view into a bird's-eye view through inverse perspective transformation. The inverse perspective matrix is expressed as P = [Mt], where M is the camera intrinsic parameter matrix and t is the camera extrinsic parameter matrix.
[0033] Furthermore, in step 3, the mathematical expression of the curve function corresponding to the road model is:
[0034] = + + ;
[0035] Among them, P0, P1, P2, and P3 are control points on the road; are the basis functions corresponding to the control points P0, P1, P2, and P3 respectively.
[0036] Furthermore, in step 4, the path continuity problem of the road model is defined as:
[0037] ;
[0038] It is assumed that the curve consists of segments He Duan Linked, and segment The beginning of the link to the segment the end of For segment S ( u ) at the starting point u =0 The derivative reflects the curve at that point k Order rate of change; For segment R ( u ) at the end u =1 The derivative reflects the curve at that point k Order rate of change; is the order of the derivative, ranging from 1, 2, ..., i −1, that is, from the first derivative to i −1 derivative; is a positive integer that defines the highest-order derivative continuity that needs to be satisfied.
[0039] Furthermore, in step 5, the formula for constraining the maximum curvature of the road model is as follows:
[0040] ;
[0041] in, is the steering angle limit; is the minimum turning radius; is the maximum curvature.
[0042] Furthermore, in step 7, the path curvature is:
[0043] ;
[0044] in, is the path curvature;L is the vehicle wheelbase; is the curve parameter;
[0045] For a given minimum segment angle , the corresponding minimum segment length for:
[0046] .
[0047] Furthermore, the specific process of step 8 is as follows:
[0048] Enter the maximum curvature , path point coordinates , minimum segment angle ; Perform midpoint insertion on every two consecutive path points. and Insert midpoint between , then update the waypoints ; Calculate the minimum segment length of segment parameters ; For each segment, do the following: If > , then use and Build segments, insert midpoints in new segments , update the path point ;like < , then proceed to the next step; calculate 、 And return to obtain the smoothed cubic B-spline curve road model;
[0049] The expression is as follows:
[0050] ;
[0051] ;
[0052] in, L is the vehicle wheelbase; is the curve parameter.
[0053] Furthermore, the specific steps of step 9 are as follows:
[0054] Step 9.1: For each data point X in the dataset i , calculate the weight according to its distance from the target point X0 , where the weight calculation formula is as follows:
[0055] = exp(- );
[0056] For areas where the data fluctuation exceeds the threshold, the kernel function is replaced by:
[0057] = exp(- );
[0058] in, is a smoothing parameter;
[0059] Step 9.2: Use the Huber Loss function, which has the following formula:
[0060] ;
[0061] in, is the value of the Huber Loss loss function, which is used to measure the predicted value and the true value y The error between To represent the true value, that is, the true label or target value of the sample data; is the predicted value; ϵ is a threshold used to distinguish the size of the error.
[0062] Furthermore, the specific steps of step 10 are as follows:
[0063] Step 10.1: Search for pixels whose grayscale values are not equal to 0 in the detected image to obtain the data point set A;
[0064] Step 10.2: Based on the smoothed cubic B-spline curve road model, randomly select control points from the data point set A to obtain the initial cubic B-spline curve;
[0065] Step 10.3: Filter the valid points by comparing the relative distances between the remaining data points in the data point set A and the initial cubic B-spline curve to obtain the valid point set F;
[0066] Step 10.4: When the number of data points in the valid point set F reaches the preset road model valid number threshold n, proceed to the next step; otherwise, return to steps 10.2 and 10.3 and repeat the calculation until the number of valid points meets the requirement or there are no more eligible data points to search;
[0067] Step 10.5: Refit the cubic B-spline curve using the data points in the current valid point set A and update the positions of the control points;
[0068] Step 10.6: When the number of iterations reaches the upper limit k, the optimal road model is obtained.
[0069] Compared with the prior art, the present invention has the following beneficial effects:
[0070] Building on traditional road recognition algorithms, this method utilizes the HSV color space and Sobel operator edge detection threshold superposition technology to improve the accuracy of threshold detection for unstructured roads. Simultaneously, it performs smoothing optimization on the existing cubic B-spline Bezier model to ensure that it satisfies both path continuity and maximum vehicle curvature constraints. Furthermore, an improved local weighted regression algorithm is employed to optimize the road model through iteration. This series of operations enhances detection accuracy and robustness, and offers superior real-time performance compared to traditional machine learning methods, enabling effective recognition of unstructured roads. BRIEF DESCRIPTION OF THE DRAWINGS
[0071] Figure 1 Flow chart of the method of the present invention.
[0072] Figure 2 Schematic diagram of the parameters of the middle section of the present invention.
[0073] Figure 3 This is a flow chart of step 8 in the present invention.
[0074] Figure 4 This is a flow chart of step 10 in the present invention. DETAILED DESCRIPTION
[0075] In order to have a clearer understanding of the technical features, objectives and beneficial effects of the present invention, the technical solution of the present invention is now described in detail below, but it should not be understood as limiting the scope of implementation of the present invention.
[0076] The present invention provides an unstructured lane detection method based on Bezier curve and local regression algorithm. The method flow chart is as follows: Figure 1 As shown, the following steps are included:
[0077] Step 1: Obtain road segment image;
[0078] Use the vehicle-mounted camera to shoot unstructured roads, obtain road segment videos, and then extract road segment images from the videos.
[0079] Step 2: Image preprocessing;
[0080] Perform image preprocessing on the acquired road section images, including calibrating the onboard camera, correcting image distortion, converting the color space, defining the ROI area, and converting the view into a bird's-eye view. The specific steps are as follows:
[0081] Step 2.1: Use the Zhang Zhengyou calibration method to calibrate the vehicle-mounted camera, obtain the internal and external parameters of the vehicle-mounted camera, and establish a mapping relationship between the image pixel coordinates and the world coordinates of the corresponding points in space.
[0082] Taking a point on the image as an example, its pixel coordinate system coordinate is ( u , v ), according to the mapping relationship between the pixel coordinate system and the world coordinate system, solve its corresponding world coordinate system coordinates ( , , ), recorded as:
[0083] Formula 1: ;
[0084] in, is the midpoint of the camera coordinate system Z Coordinates, indicating the distance from the vehicle-mounted camera to the object being photographed in the direction of the optical axis; are the horizontal and vertical coordinates of the selected point in the pixel coordinate system respectively; is the pixel size; are the horizontal and vertical coordinates of the image center point in the pixel coordinate system respectively; f is the focal length of the onboard camera; = f / , = f / , are the normalized focal lengths on the x-axis and y-axis respectively; R is the rotation matrix, T is the translation matrix, which are all external parameters of the vehicle-mounted camera; The position components of a spatial point in the horizontal, vertical, and depth directions in the world coordinate system respectively.
[0085] Step 2.2: Correct the image distortion using the following formula:
[0086] Formula 2: ;
[0087] in, is the radial distortion coefficient; is the coordinate in the normalized image coordinate system; are the horizontal and vertical coordinates in the rectified image coordinate system.
[0088] Step 2.3: Transform the obtained image from RGB space to HSV color space, where H is hue, S is saturation, and V is lightness. Use HSV color space to segment the image and obtain its gradient threshold in S channel ( ).
[0089] Step 2.4: Use the Sobel operator to detect the edge of the image and obtain the threshold of the image in the x direction ( ) and the threshold in the y direction ( ), and superimpose the gradient threshold of the Sobel operator in the x and y directions with the color threshold of the S channel of the HSV color space.
[0090] Step 2.5: Considering that lane lines usually appear at the bottom of the image, select the lower part of the image as the region of interest (ROI). Based on prior knowledge, for an input image with width W and height H, the selected ROI area is:
[0091] Formula 3: ROI = [0, H / 2 ]x[0, W ];
[0092] Step 2.6: Convert the processed view into a bird's-eye view through inverse perspective transformation. The inverse perspective matrix is expressed as P = [M t], where M is the camera intrinsic parameter matrix and t is the camera extrinsic parameter matrix.
[0093] Step 3: Select the road model;
[0094] The B-spline basis function is used to replace the Bernstein basis function, and the cubic B-spline curve is adopted as the road model.
[0095] (Bezier) Bézier curve is a parametric curve defined by a set of control points. For an n-degree Bézier curve, it has n+1 control points P0, P1, ..., P n . Its mathematical expression is: Bezier curves can represent free-form curves, but when the curve shape is too complex, modifying the position of one control point will affect the shape of the entire curve, making it difficult to meet the design requirements in practical applications. Based on the above problems, and given that B-spline curves have local control characteristics, B-spline basis functions are used to replace Bernstein basis functions:
[0096] Formula 4: ;
[0097] Among B-spline parametric curves, cubic B-spline is superior to other parametric curves and smoothing methods in path tracking and replanning. Therefore, the present invention adopts cubic B-spline curve as the road model, and its mathematical expression is:
[0098] = + + ;
[0099] Among them, P0, P1, P2, and P3 are control points on the road and can be adjusted according to road conditions; are the basis functions corresponding to the control points P0, P1, P2, and P3 respectively.
[0100] Step 4: Define the path continuity problem of the road model;
[0101] In Bezier curves, path discontinuities often occur at the connection points between curves. 1 and C 2 Continuity is an important concept to describe the smoothness of a curve. 1 Continuity means that the first derivative of the curve at that point is continuous. 2 Continuity requires that the second-order derivative of the curve at that point is also continuous. The continuity of the path in this invention mainly considers C 2 The constraints at , assuming that the curve consists of segments He Duan Linked, and segment The beginning of the link to the segment In the B-spline curve function, for i th Degree adjacent curve segments and , C i-1 The continuity of a path is defined by the following formula:
[0102] Formula 6: ;
[0103] in, For segment S ( u ) at the starting point u =0 The derivative reflects the curve at that point k Order rate of change; For segment R ( u ) at the end u =1 The derivative reflects the curve at that point k Order rate of change; is the order of the derivative, ranging from 1, 2, ..., i −1, that is, from the first derivative to i −1 derivative; is a positive integer that defines the highest-order derivative continuity that needs to be satisfied.
[0104] Step 5: Constrain the maximum curvature of the road model;
[0105] The maximum curvature constraint of the curve is derived from the bicycle model, which is a simplified mathematical model describing the dynamic behavior of the vehicle, in which the velocity component is constrained as follows As shown, where x and y are the axes in the Cartesian coordinate system, and and is the velocity of the vehicle relative to its local coordinate system axes, and the angle θ is the direction of change relative to the x-axis.
[0106] Define the path curvature as , the turning radius is ρ , the steering angle is δ , the vehicle wheelbase is L ; In the actual operation of the vehicle, the steering angle is limited to , which in turn limits the turning radius and path curvature of the road model to the minimum turning radius and maximum curvature The vehicle's path is constrained by a limited steering angle, but curvature is often used to describe the path constraint, as shown in the following equation:
[0107] Formula 7: .
[0108] Step 6: midpoint insertion operation;
[0109] Path discontinuity occurs between two arbitrarily connected segments. To ensure that a single B-spline curve can accurately represent the path and maintain continuity. A point is inserted between every two consecutive control points, that is, a midpoint insertion. This can effectively force the B-spline curve to follow the path more accurately using the tangent property. Based on the application of the cubic B-spline curve, two midpoints are inserted between the original three control points. Inserting the midpoint will increase the path curvature, that is, any path can be subdivided into segments consisting of five consecutive points (three control points and two midpoints). Using the local control characteristics of B-spline, the maximum curvature constraint of each segment can be met. The curvature of the segment is defined and calculated according to its mathematical formula, and the segment parameters are set by the maximum curvature of the vehicle. A segment consists of five points, three of which are control points, and these points form two intersecting lines. The two parameters of the segment are the segment length and segment angle , is the shorter segment length (see Figure 2 ). Five control points , the expression is as follows:
[0110] Formula 8: ;
[0111] Formula 9: ;
[0112] in, For several points A collection of For several points A collection of .
[0113] Step 7: Curve smoothing;
[0114] In order to fully satisfy the maximum curvature constraint, the path curvature is derived as a function of the segment parameters, as follows:
[0115] Formula 10: ;
[0116] in, for x Parameters u The first derivative of x rate of change in direction; for y Parameters u The second derivative of y changes in the rate of change of direction; for y Parameters u The first derivative of y rate of change in direction; for x Parameters u The second derivative of x changes in the rate of change of direction; is the path curvature.
[0117] The curve equation corresponding to the original segment is the path calculated by substituting the control points into the B-spline curve and the basis functions ,in are the horizontal and vertical positions of the path respectively, and the expressions are as follows:
[0118] Formula 11: ;
[0119] Formula 12: ;
[0120] Substituting into Equation 10, we get the path curvature as ;
[0121] in, L is the vehicle wheelbase; is the curve parameter.
[0122] The purpose of curve smoothing is to ensure that the segment curvature is less than the maximum vehicle curvature, defining the minimum segment angle And calculate the corresponding minimum segment length , if the angle of a segment exceeds the threshold, it is modified. For a given minimum segment angle , corresponding for This operation relies on the local control properties of B-splines, which allow segments to be modified with minimal impact on other segments and a single curve to maintain path continuity.
[0123] Step 8: Smoothing of cubic B-spline curve road model;
[0124] The parameters obtained from steps 4 to 7 are used to smooth the cubic B-spline curve road model. The specific steps are as follows (see Figure 3 ):
[0125] Step 8.1: Enter the maximum curvature , path point coordinates , minimum segment angle ;
[0126] Step 8.2: Output B-spline path coordinates ;
[0127] Step 8.3: Perform midpoint interpolation on every two consecutive path points. and Insert midpoint between , then update the waypoints ;
[0128] Step 8.4: Calculate the minimum segment length of segment parameters ;
[0129] Step 8.5: For each segment, do the following: If > , then use and Build segments, insert midpoints in new segments , update the path point ;like < , then proceed to the next step;
[0130] Step 8.6: Calculation 、 And return to obtain the smoothed cubic B-spline curve road model.
[0131] This algorithm smoothes a path by interpolating midpoints between waypoints and adjusting waypoints while ensuring that the path curvature does not exceed a given maximum curvature.
[0132] Step 9: Implementation of local weighted regression algorithm;
[0133] In a set of data points, for the selected target point X0, the points closer to the target point X0 will be given higher weights, and conversely, the data points farther away will be given lower weights.
[0134] The specific steps are as follows:
[0135] Step 9.1: For each data point X in the dataset i , calculate the weight according to its distance from the target point X0 , where the weight calculation formula is as follows:
[0136] Formula 13: = exp(- );
[0137] For areas where data fluctuates greatly, the kernel function is replaced by:
[0138] Equation 14: = exp(- );
[0139] in, Is a smoothing parameter that determines the range of weighting.
[0140] Step 9.2: Use the Huber Loss loss function instead of the loss function of the ordinary regression algorithm. The formula is as follows:
[0141] Equation 15: ;
[0142] in, is the value of the Huber Loss loss function, which is used to measure the predicted value and the true value y The error between To represent the true value, that is, the true label or target value of the sample data; is the predicted value; ϵ is a threshold used to distinguish the size of the error. ϵ The best value can be obtained through cross validation.
[0143] when When , the gradient gradually decreases, ensuring that the model obtains the global optimal value more accurately; when When , the gradient is approximately ϵ , ensuring that the model updates parameters at a faster speed.
[0144] Step 10: Fit and identify the road; the specific steps are as follows (see Figure 4 ):
[0145] Step 10.1: Search for pixels whose grayscale values are not equal to 0 in the detected image to obtain the data point set A;
[0146] Step 10.2: Based on the smoothed cubic B-spline curve road model, randomly select four points from the data point set A as the initial control points P0, P1, P2, and P3 for curve fitting to obtain an initial cubic B-spline curve;
[0147] Step 10.3: Calculate the relative distances between the remaining data points in the data point set A and the initial cubic B-spline curve. Select data points whose distances do not exceed the threshold d (indicating that the data points are very close to the fitted curve) as valid points and add them to the valid point set F.
[0148] Step 10.4: When the number of data points in the valid point set F reaches the preset road model valid number threshold n, proceed to the next step; otherwise, return to steps 10.2 and 10.3 and repeat the calculation until the number of valid points meets the requirement or there are no more eligible data points to search;
[0149] Step 10.5: Refit the cubic B-spline curve using the data points in the current valid point set A and update the positions of the control points P0, P1, P2, and P3;
[0150] Step 10.6: When the number of iterations reaches the upper limit k, the optimal road model is obtained.
[0151] The specific implementation of the present invention is described in detail below with reference to specific embodiments.
[0152] Example 1: Verification of the effect of the method of the present invention;
[0153] Experimental environment:
[0154] Hardware: CPU: 12 cores;
[0155] Memory: 90GB
[0156] GPU: NVIDIA vGPU-32GB, 1 card;
[0157] Software: python==3.8, cuda==11.8.
[0158] Public datasets such as TuSimple, CULane, and Curve Lane were used, and the video frame rate in the dataset was set to 30fps. Some clips were selected from the three datasets for algorithm performance testing, and the algorithm performance was verified through frame-by-frame statistical analysis. Among them, the TuSimple dataset mainly contains road data on highways and road sections under good lighting conditions, and the recognition difficulty is relatively low. The CULane dataset is mainly urban road data, with high authenticity and diversity. The Curve Lane dataset contains a variety of complex curved lane images and focuses on curved lane line detection. In order to reflect the advantages of the method of the present invention over traditional machine learning methods, 800 frames, 1200 frames, and 1600 frames of images were selected from the three datasets for testing. The experimental results are shown in Tables 1-3 (Table A is the method of the present invention, and Table B is the traditional machine learning method):
[0159] Table 1 TuSimple
[0160] method Frame rate Accuracy / % Calculation speed / fps AB 800800 98.398.2 6665
[0161] Table 2 CULane
[0162] method Frame rate Accuracy / % Calculation speed / fps AB 12001200 97.997.6 5955
[0163] Table 3 Curve Lane
[0164] method Frame rate Accuracy / % Calculation speed / fps AB 16001600 96.994.2 4939
[0165] Note: The higher the fps unit of calculation speed in the table, the better the real-time performance of the algorithm.
[0166] Experimental conclusion:
[0167] From the data in the table, it can be seen that when processing the relatively simple TuSimple and CULane data sets, the performance of the method of the present invention is close to that of the traditional machine learning method; when processing the more complex Curve Lane data set, the method of the present invention has better accuracy and real-time performance than the traditional machine learning method.
[0168] The above are only preferred embodiments of the present invention. It should be pointed out that for those skilled in the art, several variations and improvements can be made without departing from the concept of the present invention. These should also be regarded as the scope of protection of the present invention. These will not affect the effect of the implementation of the present invention and the practicality of the patent.
Claims
1. Unstructured lane detection method based on Bezier curve and local regression algorithm, characterized by: The following steps are involved: Step 1: Obtain road segment image; Use the on-board camera to shoot unstructured roads, obtain road segment videos, and then extract road segment images from the videos; Step 2: Image preprocessing; Perform image preprocessing on the acquired road section images, including calibrating the onboard camera, correcting image distortion, converting the color space, delineating the ROI area, and converting the view into a bird's-eye view; Step 3: Select the road model; The B-spline basis function is used to replace the Bernstein basis function, and the cubic B-spline curve is adopted as the road model; Step 4: Define the path continuity problem of the road model; Step 5: Constrain the maximum curvature of the road model; Step 6: midpoint insertion operation; Step 7: Curve smoothing; Satisfy the maximum curvature constraint through curve smoothing and derive the path curvature as a function of segment parameters; Step 8: Smoothing of cubic B-spline curve road model; Smoothing the cubic B-spline curve road model using the parameters obtained from steps 4 to 7; Step 9: Implementation of local weighted regression algorithm; Step 10: Fit and identify the road.
2. The unstructured lane detection method based on Bezier curve and local regression algorithm according to claim 1, characterized in that: The specific steps of step 2 are as follows: Step 2.1: Use Zhang Zhengyou calibration method to calibrate the camera to map the image pixel coordinates to the world coordinates of the corresponding points in space. The formula is as follows: ; in, is the midpoint of the camera coordinate system Z coordinate; are the horizontal and vertical coordinates of the selected point in the pixel coordinate system respectively; is the pixel size; are the horizontal and vertical coordinates of the image center point in the pixel coordinate system respectively; f is the focal length of the onboard camera; = f / , = f / , are the normalized focal lengths on the x-axis and y-axis respectively; R is the rotation matrix, T is the translation matrix, which are all external parameters of the vehicle-mounted camera; The position components of the spatial point in the horizontal direction, vertical direction and depth direction in the world coordinate system respectively; Step 2.2: Correct the image distortion using the following formula: ; in, is the radial distortion coefficient; is the coordinate in the normalized image coordinate system; are the horizontal and vertical coordinates in the corrected image coordinate system; Step 2.3: Convert the obtained image from RGB space to HSV color space, where H is hue, S is saturation, and V is lightness; segment the image using HSV color space and obtain its gradient threshold in the S channel. ; Step 2.4: Use the Sobel operator to detect the edge of the image and obtain the threshold of the image in the x direction ( ) and the threshold in the y direction ( ), and superimpose the gradient threshold of the Sobel operator in the x and y directions with the color threshold of the S channel of the HSV color space; Step 2.5: The ROI area is defined by prior knowledge, and the ROI area range is ROI = [0, H / 2 ]x[0, W ], where W is the image width and H is the image height; Step 2.6: Convert the processed view into a bird's-eye view through inverse perspective transformation. The inverse perspective matrix is expressed as P = [M t], where M is the camera intrinsic parameter matrix and t is the camera extrinsic parameter matrix.
3. The unstructured lane detection method based on Bezier curve and local regression algorithm according to claim 1, characterized in that: In step 3, the mathematical expression of the curve function corresponding to the road model is: ; Among them, P0, P1, P2, and P3 are control points on the road; are the basis functions corresponding to the control points P0, P1, P2, and P3 respectively.
4. The unstructured lane detection method based on Bezier curve and local regression algorithm according to claim 1, characterized in that: In step 4, the path continuity problem of the road model is defined as: ; It is assumed that the curve consists of segments He Duan Linked, and segment The beginning of the link to the segment the end of For segment S ( u ) at the starting point u =0 order derivatives; For segment R ( u ) at the end u =1 order derivatives; is the order of the derivative, ranging from 1, 2, ..., i −1, that is, from the first derivative to i −1 derivative; is a positive integer.
5. The unstructured lane detection method based on Bezier curve and local regression algorithm according to claim 1, characterized in that: In step 5, the formula for constraining the maximum curvature of the road model is as follows: ; in, is the steering angle limit; is the minimum turning radius; is the maximum curvature; L is the vehicle wheelbase.
6. The unstructured lane detection method based on Bezier curve and local regression algorithm according to claim 1, characterized in that: In step 7, the path curvature is: ; in, is the path curvature; L is the vehicle wheelbase; is the curve parameter; is the segment angle; For a given minimum segment angle , the corresponding minimum segment length for: 。 7. The unstructured lane detection method based on Bezier curve and local regression algorithm according to claim 1, characterized in that: The specific process of step 8 is as follows: Enter the maximum curvature , path point coordinates , minimum segment angle ; Perform midpoint insertion on every two consecutive path points. and Insert midpoint between , then update the waypoints ; Calculate the minimum segment length of segment parameters ; For each segment, do the following: If , then use and Build segments, insert midpoints in new segments , update the path point ;like , then proceed to the next step; calculate 、 And return to obtain the smoothed cubic B-spline curve road model; The expression is as follows: ; ; in, L is the vehicle wheelbase; is the curve parameter; is the segment angle.
8. The unstructured lane detection method based on Bezier curve and local regression algorithm according to claim 1, characterized in that: The specific steps of step 9 are as follows: Step 9.1: For each data point X in the dataset i , calculate the weight according to its distance from the target point X0 , where the weight calculation formula is as follows: = exp(- ); For areas where the data fluctuation exceeds the threshold, the kernel function is replaced by: ; in, is a smoothing parameter; Step 9.2: Use the Huber Loss function, which has the following formula: ; in, is the value of the Huber Loss loss function, which is used to measure the predicted value and the true value y The error between To represent the true value, that is, the true label or target value of the sample data; is the predicted value; ϵ is a threshold used to distinguish the size of the error.
9. The unstructured lane detection method based on Bezier curve and local regression algorithm according to claim 1, characterized in that: The specific steps of step 10 are as follows: Step 10.1: Search for pixels whose grayscale values are not equal to 0 in the detected image to obtain the data point set A; Step 10.2: Based on the smoothed cubic B-spline curve road model, randomly select control points from the data point set A to obtain the initial cubic B-spline curve; Step 10.3: Filter the valid points by comparing the relative distances between the remaining data points in the data point set A and the initial cubic B-spline curve to obtain the valid point set F; Step 10.4: When the number of data points in the valid point set F reaches the preset road model valid number threshold n, proceed to the next step; otherwise, return to steps 10.2 and 10.3 and repeat the calculation until the number of valid points meets the requirement or there are no more eligible data points to search; Step 10.5: Refit the cubic B-spline curve using the data points in the current valid point set A and update the positions of the control points; Step 10.6: When the number of iterations reaches the upper limit k, the optimal road model is obtained.
Citation Information
Patent Citations
A lane line self-adaptive detection method
CN109785291A
Mechanical arm obstacle avoidance path planning based on improved bidirectional RRT algorithm
CN119188771A