A lane detection method and system based on millimeter wave radar
By using a lane detection method based on millimeter-wave radar, lane lines are adaptively extracted using traffic heatmaps and statistical histograms. Combined with dynamic time warping and random sampling consistency algorithms, the robustness and computational complexity issues of lane detection in harsh environments are solved, and high-precision, adaptive lane model generation is achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-19
- Publication Date
- 2026-04-10
AI Technical Summary
Existing lane detection methods suffer from performance degradation in harsh environments, rely on insufficient visibility of physical lane lines, have high computational complexity, are difficult to deploy in real time on edge computing platforms, and traditional radar methods struggle to accurately capture changes in road curvature.
By spatially accumulating and density mapping vehicle target tracking data collected by millimeter-wave radar, a traffic flow heatmap is generated. Lane lines are adaptively extracted using statistical histograms and morphological features. Lane centerlines are fitted using subsequence dynamic time warping and random sampling consensus algorithms to generate smooth lane boundary lines.
It achieves stable lane detection in harsh environments, reduces computational complexity, is suitable for deployment on edge computing platforms, adapts to changes in road curvature, and generates high-precision, robust lane models.
Smart Images

Figure CN121348273B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of road traffic, and particularly relates to a lane detection method and system based on a millimeter wave radar. BACKGROUND
[0002] With the rapid development of intelligent transportation and autonomous driving technology, lane detection has become an indispensable key link in vehicle positioning, path planning and traffic management. Accurate and reliable lane detection can not only provide accurate road structure information for autonomous vehicles, but also provide real-time traffic analysis and decision support for traffic management departments.
[0003] The most widely used lane detection method at present is mainly based on visual sensor technology. This kind of method usually uses vehicle-mounted cameras to obtain road images, identifies lane line positions through image processing algorithms or deep learning models, and then divides lane ranges. In the standard road environment with clear lane lines and good lighting conditions, visual methods can achieve high detection accuracy, so they have been widely used in current assisted driving systems and intelligent traffic monitoring. However, visual methods have inherent limitations: in night, rain, fog, backlight and other adverse environmental conditions, image quality decreases significantly, lane lines are prone to blur, reflection or occlusion; in the case of road construction, worn or missing lane lines, visual algorithms are difficult to work stably; in addition, traditional methods often need manual lane line annotation as prior information, and have poor adaptability to dynamic changes in traffic environment.
[0004] To solve the shortcomings of visual methods, researchers began to explore detection schemes based on millimeter wave radars. Millimeter wave radars have all-weather working ability and can still output target distance, speed and angle information stably in poor lighting, rain, snow and other adverse weather conditions, showing strong environmental adaptability. Existing researches are mostly focused on using millimeter wave radars deployed at fixed positions for traffic monitoring, and through clustering analysis of multi-vehicle detection points, traffic flow statistics and vehicle trajectory detection are realized. These methods can reflect the distribution characteristics of road traffic flow to some extent, but usually lack the ability to extract lane-level fine structure.
[0005] In the prior art, the Chinese patent application with publication number CN120411905A discloses a lane line detection and correction method based on millimeter wave radar. The method uses a time-space two-dimensional DBSCAN clustering algorithm to remove noise and identify lane point cloud clusters. After filtering high-curvature points, the point cloud clusters are accurately aligned to the reference data using the ICP algorithm. Finally, a smooth lane line is generated by segmenting the principal component analysis and Bezier curve fusion. However, this scheme faces significant challenges in engineering practice: the time-space two-dimensional distance calculation, DBSCAN clustering, ICP registration, and a series of complex processing steps such as segmented PCA fitting result in high algorithm time-space complexity. In scenarios with dense road targets and heavy traffic flow, it is difficult to meet the real-time requirements of edge computing devices. The performance of the DBSCAN clustering algorithm is highly dependent on the setting of the neighborhood radius parameter. In different scenarios and different time periods, the performance is unstable due to changes in traffic flow and density. It is difficult to adaptively determine the number of lanes and to inject reliable prior information into the model. The subsequent registration and fitting process completely relies on the clustering results, lacks a fault-tolerant mechanism, and will cause the entire detection chain to fail if clustering fails.
[0006] In summary, the current technology mainly has the following three shortcomings:
[0007] 1. The method based on vision completely depends on the visibility of physical lane lines. When the lane lines are blurred due to wear, dirt, coverage, or adverse weather conditions, the detection performance decreases sharply. Even if detection or segmentation algorithms are used, post-processing straight line drawing is required, and the overall robustness is limited.
[0008] 2. The method based on deep learning has a certain tolerance to lane line blur, but it requires a large amount of labeled data for training, and the model has high computational complexity, making it difficult to efficiently deploy on resource-constrained edge computing platforms.
[0009] 3. Traditional traffic radar methods mostly use fixed models or preset lane shapes, making it difficult to accurately capture the curvature changes and lane channelization characteristics of actual roads. It is a passive sensing method that does not fully utilize the road structure information contained in the vehicle trajectory. SUMMARY
[0010] The present application addresses the technical problems existing in the prior art and provides a lane detection method and system based on millimeter wave radar. By spatially accumulating and density mapping the target tracking data collected by a fixed-position traffic radar over a long period of time, a traffic heat map reflecting the traffic flow distribution characteristics is generated. The statistical histogram and morphological features of the heat map are used to adaptively extract lane lines and lane ranges. This method does not rely on the visibility of physical lane lines and can adapt to various weather and lighting conditions. By simplifying the algorithm process, the computational complexity is reduced, making it more suitable for deployment and application in actual traffic scenarios.
[0011] To solve the above technical problems, the technical scheme provided by the present application is:
[0012] A lane detection method based on millimeter wave radar, comprising the following steps:
[0013] Step S1: Based on the vehicle target tracking data collected by the fixed position millimeter wave radar, the lateral coordinate distribution is counted to generate a lateral distribution histogram within a preset longitudinal range, and the number of lanes and the initial lateral position of each lane center are determined by detecting the peak value in the lateral distribution histogram;
[0014] Step S2: Splice multiple vehicle trajectory sequences collected within a time window into a global point set, and perform polynomial fitting on the global point set to generate a global center curve; based on the number of lanes and the initial lateral position of each lane center, the global center curve is translated laterally to generate the initial center line of each lane;
[0015] Step S3: Calculate the subsequence dynamic time warping distance between each vehicle trajectory sequence and each initial center line, and distribute each vehicle trajectory to the corresponding lane cluster according to the minimum distance; for each lane cluster, use the random sample consensus algorithm and the polynomial regression model for joint fitting to obtain the updated lane center line; iteratively perform trajectory assignment and center line fitting until the update amount of each lane center line is less than a preset threshold or the maximum iteration number is reached, and output the final lane center line set;
[0016] Step S4: Based on the final lane center line set, a common reference center line is constructed; the global lateral offset of each lane center line relative to the common reference center line in the normal direction is calculated; based on the global lateral offset, the lateral offset of each lane boundary line is determined by extrapolating the midpoint offset between adjacent center lines and the outermost center line offset; along the normal direction of the common reference center line, the lateral offset of each lane boundary line is applied to generate parallel and smooth lane boundary lines.
[0017] As a further improvement of the method of the present application: in step S1, the counting of the lateral coordinate distribution to generate the lateral distribution histogram comprises:
[0018] Divide multiple longitudinal intervals with a preset step size along the driving direction of the vehicle;
[0019] Extract the lateral coordinates of all radar points in each longitudinal interval;
[0020] With a preset lateral interval width as the statistical unit, count the number of lateral coordinates falling into each statistical unit to form a lateral distribution histogram.
[0021] As a further improvement of the method of the present application: the lateral distribution histogram is defined as:
[0022]
[0023] wherein, denotes the distribution density of radar points at the lateral coordinate in the i-th longitudinal interval; is the lateral coordinate of the i-th radar point in the i-th longitudinal interval, j is an indicator function, which takes the value 1 when and 0 otherwise, is the width of the lateral statistical unit; is the total number of radar points in the i-th longitudinal interval; The first derivative of
[0024] is calculated:
[0025]
[0026] Local maximum points satisfying are identified, and peak points satisfying are screened out, wherein is a preset proportion coefficient; The screened peak points are taken as real lane center candidate points, so as to determine the number of lanes and the lane width.
[0027] As a further improvement of the method of the present application: in step S3, the dynamic time warping distance of the subsequence is calculated, and the trajectory is assigned to the lane cluster according to the minimum distance, specifically including:
[0028] The distance between each vehicle trajectory sequence and each current lane center line curve is calculated, and the distance is the minimum cumulative cost obtained by aligning the trajectory sequence with any continuous subsequence of the center line curve through dynamic time warping;
[0029] The minimum value in the distance is obtained, and the vehicle trajectory sequence is assigned to the lane cluster associated with the lane center line corresponding to the minimum distance.
[0030] As a further improvement of the method of the present application: in step S3, the random sample consensus algorithm and the polynomial regression model are jointly fitted for each lane cluster, including:
[0031]
[0032] Step S301: Randomly select a minimum sample set of size n from the current set of trajectory points of the lane cluster, where n is the minimum number of parameters required to fit the polynomial regression model;
[0033] Step S302: Calculate the initial polynomial model parameters based on the minimum sample set to obtain the initial model;
[0034] Step S303: Calculate the vertical distance from all trajectory points within the lane cluster to the initial model, and select points with distances less than a preset threshold. The trajectory points are marked as interior points of the initial model;
[0035] Step S304: Repeat steps S301 to S303 a preset number of times, retain and record the candidate model with the most interior points and the set of interior points corresponding to the candidate model with the most interior points;
[0036] Step S305: Use the set of all interior points corresponding to the candidate model with the most interior points to perform third-order polynomial least squares fitting again to obtain a smooth and stable lane centerline curve.
[0037] As a further improvement to the method of the present invention: in step S3, the termination condition of the iterative execution is determined by the following convergence criterion:
[0038] Calculate the average change between the sets of lane centerlines generated in two consecutive iterations. :
[0039]
[0040] in, K For the number of lanes, and The results of the t-th and t+1-th iterations are respectively K The center line of each lane; when Δ < δ When convergence is determined, the iteration terminates. δ This is the preset error threshold.
[0041] As a further improvement to the method of the present invention: in step S4, the construction of the common reference centerline is to perform an arithmetic average of the lateral coordinates of all centerlines in the final set of lane centerlines at each longitudinal sampling point, and form the common reference centerline with the average value sequence.
[0042] As a further improvement to the method of the present invention: in step S4, calculating the global lateral offset of each lane centerline relative to the common reference centerline in the normal direction includes:
[0043] Calculate the center line of each lane offsets of each centerline at multiple longitudinal sampling points relative to the common reference centerline in the direction of the normal vector of the common reference centerline :
[0044]
[0045]
[0046] wherein, is the unit normal vector of the common reference centerline at , the tangent vector of the reference line is (1, ;
[0047] taking a robust statistical value of all instantaneous offsets of each centerline to obtain the global lateral offset constant of the centerline.
[0048] As a further improvement of the method of the present application: in step S4, the lateral offset of each lane boundary line is determined by extrapolation of the midpoint offset between adjacent centerlines and the offset of the outermost centerline, specifically comprising:
[0049] sorting the global lateral offset constants of each lane centerline in ascending order to obtain an ordered offset constant sequence;
[0050] internal boundary offset calculation, setting the midpoint of adjacent offset constants in the ordered offset constant sequence as the lateral offset of the internal lane boundary between the lanes corresponding to the adjacent offset constants;
[0051] calculating the outer boundary offset using the following formula:
[0052]
[0053]
[0054] wherein, is the lateral offset of the leftmost lane boundary line, is the centerline position of the leftmost lane corresponding to the smallest offset constant, is the second smallest offset constant after sorting, corresponding to the centerline position of the second lane from the left, is the lateral offset of the rightmost lane boundary line, is the largest offset constant after sorting, corresponding to the centerline position of the rightmost lane, is the left extrapolation amount, is the right extrapolation amount.
[0055] The application also provides a lane detection system based on millimeter wave radar, comprising a microprocessor and a memory connected with each other, wherein the microprocessor is programmed or configured to execute the lane detection method based on millimeter wave radar.
[0056] Compared with the prior art, the application has the beneficial effects that:
[0057] The application firstly realizes the unsupervised and adaptive extraction of the number of road lanes and the initial position of each lane center by performing lateral spatial distribution statistics and peak detection on the vehicle trajectory collected by the millimeter wave radar, thereby overcoming the dependence on the preset model or manual labeling of the traditional method, and using the physical characteristics of the millimeter wave radar to ensure the working stability in the night, rain, fog and other harsh environments. Further, the high-precision and anti-interference estimation and continuous optimization of the lane center line are realized by combining the elastic trajectory matching based on the sub-sequence dynamic time warping with the robust iterative fitting based on the random sample consensus, effectively processing the problems of different lengths of trajectories, noise and local deviation, and significantly improving the accuracy and robustness of lane recognition. Finally, the complete lane range with high geometric consistency, adaptive road curvature and actual traffic width is output by constructing a unified public reference center line and generating parallel boundaries based on the normal translation of the real lane center distribution. The above technical means are closely linked and work together, and finally realize the end-to-end automatic generation from the original low-level radar trajectory data to the high-level structured lane model, providing a reliable and universal lane-level environment perception basis for intelligent transportation and autonomous driving. BRIEF DESCRIPTION OF DRAWINGS
[0058] Figure 1 The application provides a lane detection method based on millimeter wave radar.
[0059] Figure 2 The application provides a lane detection method based on millimeter wave radar.
[0060] Figure 3 The application provides a lane detection method based on millimeter wave radar. DETAILED DESCRIPTION
[0061] The technical solutions in the embodiments of the application will be described clearly and completely below with reference to the drawings in the embodiments of the application. Obviously, the described embodiments are only part of the embodiments of the application, rather than all the embodiments of the application. Based on the embodiments in the application, all other embodiments obtained by a person of ordinary skill in the art without creative labor fall within the protection scope of the application.
[0062] As shown in the drawings, Figure 1 The application provides a lane detection method based on millimeter wave radar, comprising the following steps:
[0063] Step S1: Based on the vehicle target tracking data collected by the fixed position millimeter wave radar, the lateral coordinate distribution is counted in the preset longitudinal range to generate a lateral distribution histogram, and the number of lanes and the initial lateral position of each lane center are determined by detecting the peaks in the lateral distribution histogram.
[0064] In this embodiment, the number of lanes and the lane width are determined according to user input or automatic analysis of vehicle trajectories. If the user specifies lane information in the system, the specified lane information is directly used as a reference value; if no lane information is specified, the number of lanes and the width are automatically determined by analyzing the lateral position information of all collected vehicle trajectories.
[0065] In this embodiment, counting the lateral coordinate distribution to generate a lateral distribution histogram includes:
[0066] Divide a plurality of longitudinal intervals with a preset step size along the driving direction of the vehicle;
[0067] Extract the lateral coordinates of all radar points in each longitudinal interval;
[0068] Count the number of lateral coordinates falling into each statistical unit with a preset lateral interval width as the statistical unit to form a lateral distribution histogram.
[0069] Specifically, the road lateral coordinates are counted to generate a histogram of vehicle occurrence frequency, where the abscissa represents the road lateral position and the ordinate represents the occurrence frequency of vehicles at that position. By detecting the significant peaks in the histogram, each peak corresponds to an area where vehicles are concentrated, which can be used as a candidate position for the center of a lane. The number of histogram peaks is the number of lanes on the road. This method completely relies on actual vehicle trajectory data and does not require pre-drawing lane lines or manual annotation, thereby realizing data-driven lane number determination. The final output determines the number of lanes and the lateral center position of each lane, which is used to initialize each lane center line and provides a basic reference for subsequent trajectory clustering and polynomial fitting.
[0070] In this embodiment, first, a set of longitudinal coordinate sequences with a length of is selected in the original millimeter wave radar point cloud, and segmented processing is performed in the forward distance direction with a step size of For each longitudinal interval , all radar points in the interval are extracted, and the lateral coordinate is counted to establish a lateral distribution histogram. Assuming that there are radar points in the current interval, the lateral histogram is defined as:
[0071] (1)
[0072] wherein, denotes the distribution density of radar points at the horizontal coordinate in the th longitudinal interval; is the horizontal coordinate of the th radar point in the j th longitudinal interval, is an indicator function, which takes the value 1 when and 0 otherwise, is the width of the horizontal statistical unit; is the total number of radar points in the th longitudinal interval; To extract the lane center position from the histogram, peak detection is performed on
[0073] , and the first derivative of is calculated:
[0074] (2)
[0075] Local maximum points satisfying , are identified, and to avoid false peaks caused by stray points, a threshold condition is further introduced to screen out peak points satisfying , where is a preset proportion coefficient (selected as 0.3-0.5); The screened peak points are taken as real lane center candidate points, thereby determining the number of lanes
[0076] and the lane width .
[0077] Through the above technical solution, the embodiment can automatically adapt to different road structures (such as changes in the number of lanes) and dynamic traffic density, significantly improving the efficiency and universality of system deployment, and completely avoiding the tedious operation of relying on manual drawing or labeling of lane lines in traditional methods. Especially in the curved road scene, the scheme can perfectly adapt to the change of road curvature through data-driven geometric modeling, generate continuous, smooth and actual traffic flow-compliant lane models.
[0078] This advantage is derived from two aspects: first, in terms of environmental robustness, the embodiment takes the point cloud and trajectory statistics of the millimeter wave radar as the core information source, replacing the dependence on visible light images. Millimeter waves have strong penetration and insensitivity to rain, fog, night, and backlight, ensuring that the density statistics of vehicle trajectories (such as heat maps and cross-sectional histograms) remain stable and reliable in these complex environments, thereby providing a high-quality data foundation for subsequent processing. Second, in terms of automation level, the embodiment realizes complete data-driven from perception to modeling. Through cross-sectional peak detection, the number of lanes and the initial center position can be automatically determined directly from the historical trajectory distribution, and the final lane center line and boundary can be automatically generated based on statistical and fitting methods. The entire process does not require any manual pre-drawing or labeling of physical lane lines, significantly reducing deployment costs and long-term maintenance workload, enabling the system to quickly and autonomously establish accurate lane-level road models in new scenarios.
[0079] Step S2: splice the plurality of vehicle trajectory sequences collected within the time window into a global point set, and perform polynomial fitting on the global point set to generate a global center curve; based on the number of lanes and the initial lateral positions of the lane centers, perform lateral translation on the global center curve to generate the initial center lines of the lanes.
[0080] In this embodiment, suppose the system collects a total of vehicle trajectory sequences within the time window, denoted as:
[0081] (3)
[0082] wherein, is the trajectory point set of the th vehicle, is the number of points contained in the trajectory.
[0083] Splice all trajectory point sets in the longitudinal direction to obtain the global point set :
[0084] (4)
[0085] wherein, .
[0086] To obtain a reference geometric shape that can represent the overall trend of the road, the embodiment first models the global point set formed by collecting all vehicle trajectory points. Specifically, a third-order polynomial regression model is used to fit the two-dimensional coordinate relationship of the point set , thereby generating a global center reference curve that is continuous, smooth, and can reflect the change in the curvature of the main road. The form is:
[0087] (5)
[0088] Minimize the residual sum of squares by least square method:
[0089] (6)
[0090] Get the coefficient , generate a continuous smooth global center curve:
[0091] (7)
[0092] After getting the global center curve, according to the detected number of lanes , a plurality of parallel curves are generated as the initial center lines of each lane along the lateral direction at a fixed distance interval based on the center curve. Assuming that the lateral range of the road is , the th lane center line can be expressed as:
[0093] (8)
[0094] wherein, is the average estimated value of the lane width, which can be obtained by point cloud statistics or preset in advance, is the lateral offset of each lane center relative to the global center. By adjusting the left and right offset parameters , the system can flexibly adapt to different road widths and lane numbers.
[0095] Step S3: Calculate the sub-sequence dynamic time warping distance between each vehicle trajectory sequence and each initial center line, and distribute each vehicle trajectory to the corresponding lane cluster according to the minimum distance; for each lane cluster, use the random sample consensus algorithm and the polynomial regression model for joint fitting to obtain the updated lane center line; iteratively perform trajectory distribution and center line fitting until the update amount of each lane center line is less than a preset threshold or the maximum iteration number is reached, and output the final lane center line set.
[0096] The embodiment adopts a sequence clustering and fitting algorithm, which aims to automatically extract high-precision lane center lines from vehicle trajectory data. The core of the algorithm is to deeply combine sub-sequence dynamic time warping (Sub-DTW), random sample consensus (RANSAC) robust estimation, and K-means clustering framework, and construct an iterative optimization "sequence K-means" process to solve the problems of inflexible matching and poor noise resistance faced by traditional methods when processing actual trajectory data.
[0097] Specifically, Sub-DTW as a similarity measure between trajectories and lane lines allows each vehicle trajectory to optimally and elastically align with any continuous segment of lane centerlines, thus effectively overcoming the matching difficulties caused by different start and end points, different lengths, or local deformations (such as temporary lane changes). On this basis, the algorithm draws on the idea of K-means clustering, and dynamically assigns each trajectory to the most similar lane cluster according to its minimum Sub-DTW distance from the current lane centerlines. Subsequently, for each preliminary trajectory cluster, the RANSAC algorithm and polynomial regression are introduced for robust fitting. RANSAC can automatically identify and remove abnormal trajectory points (such as noise points or temporary deviation points) in the cluster through iterative sampling and consistency verification, ensuring that subsequent fitting is based only on reliable "inliers", thus obtaining a smooth and accurate lane centerline that is not disturbed. The above two steps of "distance calculation and trajectory assignment based on Sub-DTW" and "robust centerline fitting based on RANSAC" are placed in an iterative loop. In each iteration, the centerline is updated, and the cluster membership of the trajectory is also re-optimized, and so on, until the position of the centerline converges to a stable state.
[0098] In this embodiment, the sub-sequence dynamic time warping distance is calculated, and the trajectory is assigned to the lane cluster according to the minimum distance, which specifically includes:
[0099] The distance between each vehicle trajectory sequence and each current lane centerline curve is calculated, and the distance is the minimum cumulative cost obtained by aligning the trajectory sequence and the arbitrary continuous sub-sequence of the centerline curve through dynamic time warping;
[0100] The minimum value in the distance is obtained, and the vehicle trajectory sequence is assigned to the lane cluster associated with the lane centerline corresponding to the minimum distance.
[0101] The distance calculation and assignment mechanism described above is implemented in the embodiment by a sub-sequence dynamic time warping (Sub-DTW) algorithm. For each input trajectory sequence, the algorithm calculates the Sub-DTW distance between the trajectory sequence and all the current lane center curves. Unlike the traditional DTW which requires the full length of the sequence to be aligned, the core feature of Sub-DTW is to allow the trajectory sequence to find a best continuous sub-segment on the center curve to match. This design enables the algorithm to effectively handle the case where the trajectory does not match the center curve in the start and end positions, length, or local segments (for example, the vehicle does not completely pass through the detection area). Through this process, each trajectory will obtain a set of distance values corresponding to each center line. Finally, the algorithm assigns the trajectory to the lane cluster corresponding to the center line with the smallest Sub-DTW distance. After completing the assignment of all trajectories, the system obtains a set of preliminary trajectory clusters, each cluster representing a set of vehicle driving data for a potential lane, laying the foundation for the subsequent center line fitting step.
[0102] In the embodiment, polynomial fitting (RANSAC) is used to remove abnormal trajectory points (such as lane changing, abnormal detection, or vehicle deviation), and a third-order polynomial model can take into account the geometric characteristics of straight roads and gentle curves. The fitting result is used as the new lane center line , where the subscript is the kth lane line, and the superscript is the lane line generated by the tth iteration.
[0103] To robustly fit the center line from each trajectory cluster, the embodiment uses the random sample consensus algorithm and the polynomial regression model for joint fitting for each lane cluster, including:
[0104] Step S301: Randomly select a minimum sample set of n points from the set of trajectory points of the current lane cluster, where n is the minimum number of parameters required for fitting the polynomial regression model; for example, at least 4 points are selected for fitting a third-order polynomial;
[0105] Step S302: Calculate the initial polynomial model parameters according to the minimum sample set, thereby obtaining an initial model; for example, use a third-order polynomial to fit the curve model parameters ;
[0106] Step S303: Calculate the perpendicular distance of all trajectory points in the lane cluster to the initial model, and mark the trajectory points with a distance less than a predetermined threshold as inliers of the initial model; where the threshold is usually set according to a certain proportion of the trajectory noise level or the lane width;
[0107] Step S304: Repeat steps S301 to S303 a preset number of times, retain and record the candidate model with the most interior points and the set of interior points corresponding to the candidate model with the most interior points;
[0108] Step S305: Use the set of all interior points corresponding to the candidate model with the most interior points to perform third-order polynomial least squares fitting again to obtain a smooth and stable lane centerline curve.
[0109] The above allocation and fitting steps are placed in an iterative loop, the termination of which is controlled by the following convergence criterion:
[0110] Calculate the average change between the sets of lane centerlines generated in two consecutive iterations. :
[0111] (9)
[0112] in, K For the number of lanes, and The results of the t-th and t+1-th iterations are respectively K The center line of each lane; when Δ < δ When the number of iterations reaches a preset upper limit (e.g., 100), the algorithm considers it converged and terminates the iteration, outputting the final set of lane centerlines and the corresponding trajectory cluster results. δ If the difference between the results of two iterations is small and less than the preset error limit, then convergence is considered to have been achieved.
[0113] Step S4: Based on the final set of lane centerlines, construct a common reference centerline; calculate the global lateral offset of each lane centerline relative to the common reference centerline in the normal direction; based on the global lateral offset, extrapolate the midpoint offset between adjacent centerlines and the offset of the outermost centerline to determine the lateral offset of each lane boundary line; apply the lateral offset of each lane boundary line along the normal direction of the common reference centerline to generate parallel and smooth lane boundary lines.
[0114] Unlike traditional methods that simply shift the centerline left and right by a fixed distance, the lane boundary calculation method in this embodiment fully considers the local geometric differences between different lanes, the distribution of vehicle traffic density, and the curvature changes of the centerline, ensuring that the generated boundary line can maintain global geometric consistency while flexibly adapting to curve shapes and lane width changes in local areas.
[0115] In this embodiment, constructing a common reference centerline involves taking the arithmetic mean of the lateral coordinates of all centerlines in the final set of lane centerlines at each longitudinal sampling point, and using the average value sequence to form the common reference centerline.
[0116] (10)
[0117] wherein, is the common reference centerline, is the total number of lane lines, and the tangent vector of the reference line is (1, .
[0118] In this embodiment, the common reference centerline reflects the longitudinal geometric trend of the overall road and is the unified reference for generating parallel boundaries. At each longitudinal sampling point , the tangent vector of the common reference centerline and the unit normal vector are calculated. The tangent vector of the reference line :
[0119] (11)
[0120] The corresponding unit normal vector is:
[0121] (12)
[0122] The unit normal vector represents the positive direction in the lateral direction in the local coordinate system of the road.
[0123] Calculate the offset of each lane centerline from the normal direction of the common reference centerline at multiple longitudinal sampling points: :
[0124] (13)
[0125] wherein, is the unit normal vector of the common reference centerline at , the tangent vector of the reference line is (1, , and denotes the dot product of vectors, which is used to calculate the projection in the normal direction. To avoid the influence of local noise or measurement error, the offset of each centerline in the longitudinal range is taken as a robust statistical value to obtain the global lateral offset constant of the centerline. For example, the median or weighted average:
[0126] (14)
[0127] In this embodiment, the lateral offset of each lane boundary line is determined by extrapolation of the midpoint offset between adjacent centerlines and the offset of the outermost centerline, which specifically includes:
[0128] Sort the global lateral offset constants of each lane centerline in ascending order of numerical value to obtain an ordered offset constant sequence:
[0129] (15)
[0130] These offsets represent the lateral position of each lane center relative to the reference line. To generate the lane boundary lines, the present embodiment adopts a strategy of midpoint offset between adjacent center lines and lateral extrapolation.
[0131] For the internal boundary offset calculation, the midpoint of adjacent offset constants in the ordered offset constant sequence is set as the lateral offset of the internal lane boundary between the lanes corresponding to the adjacent offset constants:
[0132] (16)
[0133] For the offset value of the outer boundary, the lateral boundary offset is calculated using the following formula:
[0134] (17)
[0135] (18)
[0136] wherein, is the lateral offset of the leftmost lane boundary line, is the center line position of the leftmost lane corresponding to the smallest offset constant, is the center line position of the second left lane corresponding to the second smallest offset constant after sorting, is the lateral offset of the rightmost lane boundary line, is the center line position of the rightmost lane corresponding to the largest offset constant after sorting, is the left lateral extrapolation, is the right lateral extrapolation.
[0137] Finally, each lane boundary line at the longitudinal coordinate can be obtained by the following formula:
[0138] (19)
[0139] Since all boundary lines are obtained by fixed offset in the same direction (normal direction) based on the same reference center line, they are geometrically parallel to each other. This "parallelism" not only ensures the consistency of the width of adjacent lanes, but also adapts to the overall bending trend of the road.
[0140] The lane detection scheme of the present embodiment, by integrating innovative technical means, exhibits significant comprehensive advantages compared to traditional methods:
[0141] In terms of environmental robustness, the application uses the point cloud and trajectory statistics of the millimeter wave radar as the core perception source, replacing the dependence on visible light images. Millimeter waves have strong penetration and insensitivity to adverse conditions such as rain, fog, insufficient night lighting, and backlight, thereby ensuring that the density statistics of vehicle trajectories (such as heat maps and cross-sectional histograms) can stably and reliably reflect the real vehicle driving patterns in all-weather complex environments.
[0142] In terms of automation and adaptability, the application realizes complete data-driven from data to model without any pre-drawn artificial lane lines or fixed models. It directly determines the lane structure and initial position through cross-sectional peak detection, and generates a complete lane center line and boundary using statistical and fitting methods, significantly reducing system deployment, maintenance costs, and manual workload, enabling it to quickly establish an accurate lane model in new scenarios. At the same time, the time window-based sliding accumulation strategy can alleviate transient abnormal interference, allowing the system to locally adaptively adjust rather than globally fail when facing dynamic changes such as road merging, splitting, temporary changes in the number of lanes, or construction rerouting.
[0143] In terms of robustness and accuracy of the core algorithm, the application is specially designed for the complexity of vehicle trajectories. Sub-sequence dynamic time warping is used as a similarity measure between trajectories and lane lines, allowing elastic local matching between trajectories and center lines, effectively overcoming the matching difficulties caused by different starting and ending points, different lengths, or containing short-term lane-changing segments, thereby achieving robust clustering of sparse and unequal-length trajectories. After clustering, the random sample consensus algorithm is further introduced for robust fitting, which can automatically remove noise and outliers, ensuring the generation of smooth and accurate lane center lines. Finally, by constructing a common reference line and applying an offset based on the center line statistical distribution along its normal direction, the generated lane boundary lines are strictly parallel and continuous in geometry, and can adapt to road curvature and local width changes, ensuring the high quality and practicality of the output model.
[0144] The detection effect comparison in the two-lane straight scene in this embodiment is shown in Figure 2 , wherein Figure 2 (a) is the original vehicle trajectory point cloud collected by the millimeter wave radar, with scattered data distribution and no clear lane structure. Figure 2 (b) is the processing result of using the existing typical method (such as the lane extraction method based on DBSCAN clustering), which may have problems such as broken lane lines, positioning deviation, or boundary smoothing. Figure 2(c) shows the results obtained by the method, the system accurately identifies two lanes, and generates flat, continuous and mutually parallel lane centerlines and boundary lines, clearly outlining the lane range, which is highly consistent with the physical structure of straight roads. The comparison results show that the method can effectively overcome noise interference in straight scenes, and output more stable and accurate lane models.
[0145] In this embodiment, the detection effect comparison in the four-lane curved road scene is shown in Figure 3 Figure 3 (a) is the original trajectory point cloud, which presents significant curve distribution characteristics in the curved road area. Figure 3 (b) is the processing result of the existing comparative method, which often shows insufficient tracking ability for the curvature of the curved road, which may lead to lane line distortion, discontinuous curvature, intersection of adjacent lane lines or misjudgment of the number of lanes. Figure 3 (c) shows the processing result of the method: the system successfully identifies four lanes, and the generated lane centerlines are smooth and closely follow the geometric trend of the curved road. The lane boundary lines derived therefrom maintain strict geometric parallel relationship on the entire curved road, and can adapt to the curvature change, thus defining the spatial range of each lane completely and reasonably. The comparison results strongly prove that the method has superior curve fitting ability, lane keeping ability and overall robustness in complex curved road scenes compared to existing technologies.
[0146] It should be noted that, in addition to the specific implementation modes described in detail in this embodiment, those skilled in the art should understand that the specific algorithms in each technical module can be replaced or combined without departing from the core idea of the present application. These variants should also be considered to fall within the protection scope of the present application.
[0147] (I) About the trajectory clustering method
[0148] Within the core iterative framework of step S3, the clustering method used to preliminarily divide the trajectories into lane clusters is not limited to the K-means algorithm. For example, the DBSCAN (Density-Based Spatial Clustering with Noise) algorithm can also be used. DBSCAN can automatically determine the number of clusters according to data density, and has natural robustness to sparse distribution or isolated abnormal trajectory points. In addition, methods such as spectral clustering (Spectral Clustering) can be used to handle the non-linear manifold structure that may exist in trajectory data, which may show advantages in specific complex road geometry.
[0149] (II) About the similarity measurement between trajectory and lane line
[0150] As the core measure of trajectory and lane centerline matching, Sub-DTW is preferred due to its flexibility in sequence length and local alignment. Other sequence similarity measure algorithms can also be considered on the premise of achieving similar technical effects (i.e., allowing elastic and local matching of trajectories and centerlines). For example, the Fréchet distance is effective in measuring the global shape similarity of continuous trajectories by considering the spatial form between two curves; and the Longest Common Subsequence (LCSS) method has good tolerance for noise points and local missing in trajectory data, and is suitable for scenes with partial occlusion or sampling discontinuity.
[0151] (III) Curve fitting model of lane centerline
[0152] The preferred third-order polynomial model is used for robust fitting of the lane centerline in this embodiment, as it can achieve a good balance between the simplicity of the model and the fitting ability for common road alignments (straight roads and gentle curves). According to the complexity of the actual road and the requirement for smoothness, the fitting module of the present application can also be adapted to other continuous function models. For example, using Spline for fitting can more flexibly adapt to complex curves with variable curvature while ensuring high-order continuity of the curve; while using higher-order polynomials can provide stronger curve fitting ability, but attention should be paid to prevent overfitting when the data is sparse.
[0153] The embodiment also provides a lane detection system based on a millimeter wave radar, which comprises a microprocessor and a memory connected to each other, and the microprocessor is programmed or configured to execute the lane detection method based on the millimeter wave radar.
[0154] The above is only the preferred embodiment of the present application, and does not limit the present application in any form. Although the present application has been disclosed as above with the preferred embodiment, it is not intended to limit the present application. Therefore, any simple modification, equivalent change and modification made to the above embodiment without departing from the technical solution of the present application, according to the technical essence of the present application, shall fall within the scope of protection of the technical solution of the present application.
Claims
1. A millimeter wave radar-based lane detection method, characterized by, The method comprises the following steps: Step S1: based on the vehicle target tracking data collected by the fixed position millimeter wave radar, the lateral coordinate distribution is counted in the preset longitudinal range to generate a lateral distribution histogram, and the number of lanes and the initial lateral positions of the lane centers are determined by detecting the peaks in the lateral distribution histogram; Step S2: a plurality of vehicle trajectory sequences collected within a time window are spliced into a global point set, and the global point set is polynomially fitted to generate a global center curve; based on the number of lanes and the initial lateral positions of the lane centers, the global center curve is laterally translated to generate the initial center lines of the lanes; Step S3: the sub-sequence dynamic time warping distance between each vehicle trajectory sequence and each initial center line is calculated, and each vehicle trajectory is assigned to the corresponding lane cluster according to the minimum distance; for each lane cluster, a random sample consensus algorithm and a polynomial regression model are used for joint fitting to obtain updated lane center lines; the trajectory assignment and center line fitting are iteratively performed until the update amount of each lane center line is less than a preset threshold or the maximum iteration number is reached, and a final set of lane center lines is output; Step S4: based on the final set of lane center lines, a common reference center line is constructed; the global lateral offset of each lane center line relative to the common reference center line in the normal direction is calculated; based on the global lateral offset, the lateral offset of each lane boundary line is determined by extrapolation of the midpoint offset between adjacent center lines and the extrapolation of the offset amount of the outermost center line; the lateral offset of each lane boundary line is translated along the normal direction of the common reference center line at each longitudinal position to generate parallel and smooth lane boundary lines; The lateral offset of each lane boundary line is determined by extrapolation of the midpoint offset between adjacent center lines and the extrapolation of the offset amount of the outermost center line, specifically comprising: The global lateral offsets of the lane center lines are sorted in ascending order to obtain an ordered offset sequence; Based on the ordered offset sequence, the lateral offset of each lane boundary line is determined, wherein: For the inner lane boundary, the lateral offset is the midpoint value of the adjacent two offsets in the ordered offset sequence; For the outermost lane boundary, the lateral offset is determined by extrapolation, the lateral offset of the leftmost lane boundary line is the smallest offset minus a first extrapolation amount, and the lateral offset of the rightmost lane boundary line is the largest offset plus a second extrapolation amount; wherein the first extrapolation amount is determined based on the difference between the smallest offset and the second smallest offset, and the second extrapolation amount is determined based on the difference between the largest offset and the second largest offset.
2. The millimeter wave radar-based lane detection method according to claim 1, characterized in that, In step S1, the counting of the lateral coordinate distribution to generate the lateral distribution histogram comprises: Divide multiple longitudinal intervals with a preset step size along the driving direction of the vehicle; Extract the lateral coordinates of all radar points in each longitudinal interval; With a preset lateral interval width as the statistical unit, count the number of lateral coordinates falling into each statistical unit to form a lateral distribution histogram.
3. The millimeter-wave radar-based lane detection method according to claim 2, characterized in that, The lateral distribution histogram is defined as: in, Indicates the first Radar points within a vertical interval have horizontal coordinates Distribution density at location; For the first Within the first vertical interval j The lateral coordinates of each radar point For indicator functions, when hour The value is 1 if it is not 1, otherwise it is 0. This represents the width of the horizontal statistical unit; For the first The total number of radar points within each longitudinal interval; Calculations the first derivative: Identify and satisfy , ,and Local maxima Filter out those that meet the requirements The peak point, of which This is a preset proportionality coefficient; The peak points screened out are taken as real lane center candidate points, so as to determine the number and width of the lanes. 4.The millimeter wave radar-based lane detection method of claim 1, wherein, In step S3, the sub-sequence dynamic time warping distance is calculated, and the trajectory is assigned to the lane cluster according to the minimum distance, specifically including: The distance between each vehicle trajectory sequence and each current lane center line curve is calculated, and the distance is the minimum cumulative cost obtained by aligning the trajectory sequence with any continuous sub-sequence of the center line curve through dynamic time warping; The minimum value in the distance is obtained, and the vehicle trajectory sequence is assigned to the lane cluster associated with the lane center line corresponding to the minimum distance. 5.The millimeter wave radar-based lane detection method of claim 1, wherein, In step S3, the random sample consensus algorithm and the polynomial regression model are jointly fitted for each lane cluster, including: Step S301: randomly selecting a minimum sample set with a number of n from the trajectory point set of the current lane cluster, wherein n is the minimum number of parameters required for fitting the polynomial regression model; Step S302: calculating the initial polynomial model parameters according to the minimum sample set, thereby obtaining an initial model; Step S303: calculating the perpendicular distance of all trajectory points in the lane cluster to the initial model, and marking the trajectory points with a distance less than a preset threshold as inliers of the initial model; Step S304: repeating steps S301-S303 for a preset number of times, retaining and recording the candidate model with the largest number of inliers and the inlier set corresponding to the candidate model with the largest number of inliers; Step S305: using the entire inlier set corresponding to the candidate model with the largest number of inliers to perform a third-order polynomial least squares fitting again to obtain a smooth and stable lane center line curve. 6.The millimeter wave radar-based lane detection method of claim 1, wherein, In step S3, the termination condition of the iterative execution is determined by the following convergence criterion: calculating an average amount of change between sets of lane centerlines generated by adjacent two iterations : in, K For the number of lanes, and The results of the t-th and t+1-th iterations are respectively K The center line of each lane; when Δ < δ When convergence is determined, the iteration terminates. δ This is the preset error threshold. 7.The millimeter wave radar-based lane detection method of claim 1, wherein, In step S4, the common reference center line is constructed by calculating the arithmetic mean of the transverse coordinates of all center lines in the final lane center line set at each longitudinal sampling point, and forming the common reference center line from the average value sequence. 8.The millimeter wave radar-based lane detection method of claim 1, wherein, In step S4, the global transverse offset of each lane center line relative to the common reference center line in the normal direction is calculated, including: calculating a centerline of each lane an offset in the direction of a normal vector relative to the common reference centerline at a plurality of longitudinal sampling points : wherein is the unit normal vector of the common reference center line at is the tangent vector of the reference line at (1, ; all the instantaneous deviations of each center line taking a robust statistical value, obtaining the global lateral deviation of this center line. 9.The millimeter wave radar-based lane detection method of claim 1, wherein, In step S4, the transverse offset of each lane boundary line is determined by extrapolation of the midpoint offset between adjacent center lines and the offset of the outermost center line, specifically including: The global transverse offsets of each lane center line are sorted in ascending order of numerical value to obtain an ordered offset sequence; The midpoint of adjacent offsets in the ordered offset sequence is set as the transverse offset of the internal lane boundary between the lanes corresponding to the adjacent offsets. The outer boundary offset is calculated using the following formula: wherein, is a lateral offset of the leftmost lane boundary line, is a centerline position of the leftmost lane corresponding to the smallest offset, is a second smallest offset after sorting, corresponding to a centerline position of the second lane from the left, is a lateral offset of the rightmost lane boundary line, is a centerline position of the rightmost lane corresponding to the largest offset after sorting, is a left extrapolation, is a right extrapolation.
10. A millimeter wave radar based lane detection system comprising a microprocessor and a memory connected to each other, characterized in that, The microprocessor is programmed or configured to perform the millimeter wave radar-based lane detection method of any one of claims 1-9.
Citation Information
Patent Citations
Lane line construction method based on semantic map
CN117788867A
Lane line detection and correction method based on millimeter wave radar
CN120411905A