Road boundary detection methods, devices, computer equipment and storage media
By performing ground segmentation and rasterization on point cloud data, combined with multinomial fitting, the problem of low accuracy in unstructured road boundary detection in traditional methods is solved, achieving high-precision road boundary detection that is applicable to various lidar and visual dense point clouds.
Patent Information
- Application Number
- CN202211488385.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-11-25
- Publication Date
- 2025-12-02
- Estimated Expiration
- 2042-11-25
AI Technical Summary
Existing technologies struggle to accurately detect unstructured road boundaries in the field of autonomous driving, especially vegetation-covered roadside edges, highway scenarios, and median barriers. Traditional methods rely on lidar beam information or have low detection accuracy, resulting in missed detections.
By acquiring raw point cloud data, extracting the target area, performing ground segmentation and non-ground point cloud division, determining the road segmentation angle using the point cloud grid angle, performing distance filtering and curve fitting, and using quadratic and cubic polynomial fitting to extract the road boundary point cloud, the dependence on lidar beam information is eliminated.
It achieves high-precision detection of unstructured road boundaries, and is applicable to various 3D LiDAR and visual dense point clouds, improving the accuracy and applicability of road boundary detection.
Smart Images

Figure CN115731527B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of radar detection technology, and in particular to a road boundary detection method, apparatus, computer equipment, and storage medium. Background Technology
[0002] In the fields of autonomous and assisted driving, 3D LiDAR-based perception solutions can achieve high-precision environmental scene detection. They can detect both dynamic and static objects in the environment. Road boundaries, as crucial detection information in autonomous driving, are essential for determining the vehicle's drivable area and ensuring driving safety. Under normal driving conditions, road boundaries are insurmountable for vehicles, providing a path planning range for vehicle positioning and navigation. Therefore, LiDAR-based road boundary detection is of great significance for the development of autonomous and assisted driving systems.
[0003] In traditional technologies, some road boundary detection algorithms often use random sampling consensus (RSC) to segment the point cloud and then include parts of the road boundary by setting a large threshold parameter. However, this approach is not only inaccurate but also prone to missed detections. Other road boundary detection algorithms rely on the line beam information of the laser point cloud. They use abrupt changes in the curvature of points along the same point cloud line as a basis to determine if the laser line has passed through a road edge, and then save the road edge points. However, this approach is unusable for solid-state LiDARs that lack line beam information or have irregular line beam information. Furthermore, LiDAR-based road boundary detection is generally effective for structured road boundaries. For unstructured road boundaries, such as vegetation-covered road edges, highway scenes, and median barriers, traditional technologies struggle to detect them. Summary of the Invention
[0004] Therefore, it is necessary to provide a road boundary detection method, device, computer equipment, and storage medium that can effectively improve the accuracy of unstructured road boundary detection without relying on the beam information of lidar, in order to address the above-mentioned technical problems.
[0005] Firstly, this application provides a road boundary detection method, the method comprising:
[0006] Obtain the raw point cloud data of the road;
[0007] Extract the target region from the raw point cloud data to obtain the target point cloud;
[0008] Ground segmentation is performed on the target point cloud to obtain a non-ground point cloud;
[0009] The non-ground point cloud is divided into several point cloud grids, and the road segmentation angle is determined according to the angle corresponding to the blank grid in the point cloud grid. The non-ground point cloud is divided by the road segmentation angle to obtain the environmental point cloud on both sides of the road.
[0010] Distance filtering is performed on the environmental point clouds on both sides of the road to obtain the corresponding boundary seed point clouds. Curve fitting is then performed based on the boundary seed point clouds to extract the road boundary point clouds.
[0011] In one embodiment, determining the road segmentation angle based on the angle corresponding to the blank grid in the point cloud grid includes:
[0012] The number of points in each point cloud grid is counted, and blank grids are determined based on the number of points. A blank grid is a point cloud grid with 0 points or less than a preset number threshold.
[0013] Sort the angles corresponding to the blank grid cells and select the median value of all sorted angles as the road dividing angle.
[0014] In one embodiment, before sorting according to the angle corresponding to the blank grid, the method further includes:
[0015] Median filtering is performed based on the annotation information of all point cloud rasters, and point cloud rasters with outliers are removed. The annotation information of point cloud rasters is based on the number of points.
[0016] In one embodiment, extracting the target region from the original point cloud data to obtain the target point cloud includes:
[0017] The target point cloud is extracted by performing pass-through filtering on each axis of the original point cloud data based on the target region. Specifically, the original point cloud data is subjected to pass-through filtering on the height axis using a height array.
[0018] In one embodiment, ground segmentation of the target point cloud to obtain a non-ground point cloud includes:
[0019] Divide the target point cloud into several point cloud regions;
[0020] The ground segmentation of each point cloud region is performed using a random sampling consensus algorithm with plane normal vector constraints, and the segments are merged to obtain a non-ground point cloud. The plane normal vector is the normal vector of the ground plane model fitted to the point cloud region.
[0021] In one embodiment, a random sample consensus algorithm constrained by a plane normal vector is used to segment the ground of each point cloud region, and the resulting non-ground point cloud includes:
[0022] The random sampling consensus algorithm based on plane normal vector constraints fits the ground plane model of each point cloud region in parallel through multi-threading. The correctness of the ground plane model is determined by comparing the angle between the plane normal vector and the standard ground normal vector with a preset angle threshold. If it is incorrect, the fitting is iterated again.
[0023] The ground is segmented for each point cloud region based on the corresponding ground plane model, and then merged to obtain a non-ground point cloud.
[0024] In one embodiment, distance filtering is performed on the environmental point clouds on both sides of the road to obtain the corresponding boundary seed point clouds, including:
[0025] The environmental point clouds on both sides of the road are rasterized to obtain several environmental rasters.
[0026] For each environment grid cell, distance filtering is performed to obtain the seed point for each environment grid cell;
[0027] The boundary seed point cloud is obtained based on the seed points.
[0028] In one embodiment, curve fitting is performed based on the boundary seed point cloud to extract the road boundary point cloud, including:
[0029] The coarse boundary point cloud is extracted by curve fitting of the boundary seed point cloud using a quadratic polynomial.
[0030] The road boundary point cloud is extracted by curve fitting of the coarse boundary point cloud using a cubic polynomial.
[0031] In one embodiment, the road boundary point cloud is extracted by curve fitting of the coarse boundary point cloud using a cubic polynomial, including:
[0032] Multiple cubic curve models are obtained by iterative fitting of coarse boundary point clouds, and the number of interior points of each cubic curve model is counted. Specifically, four points are randomly extracted from the coarse boundary point cloud to establish a cubic curve model. The corresponding model parameter matrix is calculated based on the cubic curve model. The number of interior points of the cubic curve model is counted by using the model parameter matrix and a preset residual threshold.
[0033] The cubic curve model with the largest number of interior points is used as the optimal model to filter the coarse boundary point cloud and extract the road boundary point cloud.
[0034] Secondly, this application also provides a road boundary detection device, the device comprising:
[0035] The acquisition module is used to acquire the raw point cloud data of the road.
[0036] The target extraction module is used to extract the target region from the raw point cloud data to obtain the target point cloud;
[0037] The ground segmentation module is used to segment the target point cloud into ground segments to obtain a non-ground point cloud.
[0038] The road segmentation module is used to divide the non-ground point cloud into several point cloud grids, and determine the road segmentation angle based on the angle corresponding to the blank grid in the point cloud grid. The non-ground point cloud is then segmented using the road segmentation angle to obtain the environmental point clouds on both sides of the road.
[0039] The boundary extraction module performs distance filtering on the environmental point clouds on both sides of the road to obtain the corresponding boundary seed point clouds, and performs curve fitting based on the boundary seed point clouds to extract the road boundary point clouds.
[0040] Thirdly, this application also provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps of the road boundary detection method described in any of the above embodiments.
[0041] Fourthly, this application also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the road boundary detection method described in any of the above embodiments.
[0042] The aforementioned road boundary detection method, apparatus, computer equipment, and storage medium acquire raw point cloud data of the road, extract the target region from the raw point cloud data to obtain the target point cloud, perform ground segmentation on the target point cloud to obtain a non-ground point cloud, divide the non-ground point cloud into several point cloud grids, and determine the road segmentation angle based on the angle corresponding to the blank grid in the point cloud grid. The non-ground point cloud is then segmented using the road segmentation angle to obtain the environmental point clouds on both sides of the road. Distance filtering is then performed on the environmental point clouds on both sides of the road to obtain the corresponding boundary seed point clouds. Curve fitting is then performed based on the boundary seed point clouds to extract the road boundary point cloud. Thus, on the one hand, by filtering the ground point cloud and using the non-ground point cloud for road segmentation and boundary detection, this method is applicable not only to various 3D LiDARs, eliminating the dependence on the beam information of LiDARs, but also to the extraction of road boundaries from visually dense point clouds, achieving unstructured road boundary detection. On the other hand, dividing the point cloud grid based on the non-ground point cloud and segmenting the road based on the blank grid can accurately segment the road, especially suitable for various irregular roads, thereby greatly improving the accuracy of road boundary detection. Attached Figure Description
[0043] To more clearly illustrate the technical solutions in the embodiments of this application or the conventional technology, the drawings used in the description of the embodiments or the conventional technology will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0044] Figure 1 This is a schematic diagram of the overall process of a road boundary detection method in one embodiment;
[0045] Figure 2 This is a schematic diagram of the specific process of step S500 in the road boundary detection method in one embodiment;
[0046] Figure 3 This is a schematic diagram of the detection process of a road boundary detection method in one embodiment;
[0047] Figure 4 This is a structural block diagram of a road boundary detection device in one embodiment;
[0048] Figure 5 This is an internal structural diagram of a computer device in one embodiment. Detailed Implementation
[0049] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0050] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the application.
[0051] It should be noted that when one element is considered to be "connected" to another element, it can be directly connected to the other element or connected to the other element through an intermediary element. Furthermore, in the following embodiments, "connection" should be understood as "electrical connection," "communication connection," etc., if there is transmission of electrical signals or data between the connected objects.
[0052] When used herein, the singular forms of “a,” “an,” and “the” may also include the plural forms unless the context clearly indicates otherwise. It should also be understood that the terms “comprising,” “including,” or “having,” etc., specify the presence of the stated feature, whole, step, operation, component, part, or combination thereof, but do not preclude the possibility of the presence or addition of one or more other features, wholes, steps, operations, components, parts, or combinations thereof.
[0053] The road boundary detection method provided in this application can be applied to various LiDARs such as mechanical LiDAR and solid-state LiDAR for road boundary detection. It is especially suitable for unstructured road boundaries and other irregular roads, such as roadside edges covered by vegetation, highway scenarios, fences in the middle of roads, uphill and downhill roads, curved roads, multi-intersection roads, etc.
[0054] In one embodiment, such as Figure 1 As shown, a road boundary detection method is provided, including the following steps:
[0055] S100: Acquire raw point cloud data of the road;
[0056] Specifically, the raw point cloud data is the data obtained by radar scanning the road. The radar can be a mechanical lidar, a solid-state lidar, or other types of lidar. The raw point cloud data consists of point data obtained by radar scanning the surface characteristics of the road. The point data generally includes three-dimensional coordinates and laser reflection intensity.
[0057] S200: Extract the target region from the raw point cloud data to obtain the target point cloud;
[0058] Specifically, the target area is the region of interest in the original point cloud data, that is, the region of interest in the road. The target area can be extracted from the original point cloud data by the region of interest segmentation algorithm (ROI) to obtain the target point cloud. In one implementation, the target area can be limited with the radar as the center and the distance from the radar as the radius. In another implementation, the target area can be directly limited by three-dimensional coordinates.
[0059] S300: Perform ground segmentation on the target point cloud to obtain a non-ground point cloud;
[0060] Specifically, the ground plane model obtained by fitting the target point cloud is used to segment the target point cloud into ground to filter the ground point cloud and obtain non-ground point cloud. The non-ground point cloud is the point cloud data after filtering the ground point cloud from the target point cloud. The ground plane model can be obtained by fitting the target point cloud using a random sample consensus algorithm. This random sample consensus algorithm is an iterative method used to estimate the parameters of a mathematical model from a set of data containing outliers.
[0061] S400: Divide the non-ground point cloud into several point cloud grids, and determine the road segmentation angle according to the angle corresponding to the blank grid in the point cloud grid. Divide the non-ground point cloud by the road segmentation angle to obtain the environmental point cloud on both sides of the road.
[0062] Specifically, each point cloud grid corresponds to an angle that covers the radar scanning range. In one embodiment, the point cloud grid can be divided into several fan-shaped grids along the circumferential direction of the radar scanning center, and the angle of each fan-shaped grid is determined based on its position in the circumferential direction. Similarly, in another embodiment, the point cloud grid can be divided into point cloud grids of other shapes, and the angle of each grid relative to the radar scanning center is determined based on the three-dimensional coordinates of the center of each grid.
[0063] Specifically, the number of points within each point cloud grid is counted to identify blank grids. It's important to note that a blank grid can be a grid with zero points or a grid with fewer than a preset threshold number of points. Since the non-ground point cloud data is filtered out from the ground point cloud, there will be blank areas within it. These blank areas correspond to the road surface area. Therefore, the range and direction of the road can be determined based on the angles corresponding to the blank grids. The median angle corresponding to all blank grids can then be used to determine the road segmentation angle, which is the boundary line between the two sides of the road. This allows for accurate division of the non-ground point cloud into environmental point clouds on both sides of the road: the left environmental point cloud and the right environmental point cloud. Furthermore, if no blank grids exist, the road segmentation angle can be the radar's default segmentation angle. In the field of autonomous driving, this default segmentation angle is generally the angle corresponding to the vehicle's driving direction.
[0064] S500: Distance filtering is performed on the environmental point clouds on both sides of the road to obtain the corresponding boundary seed point clouds, and curve fitting is performed based on the boundary seed point clouds to extract the road boundary point clouds.
[0065] Specifically, the environmental point cloud on both sides of the road is rasterized, and the points in each raster are filtered by distance. Points that meet the distance requirements are selected as seed points in the corresponding raster, thus obtaining the boundary seed point cloud.
[0066] Specifically, the boundary seed point cloud on both sides of the road is curve-fitted by polynomial fitting. The polynomial fitting is iteratively performed based on random points in the boundary seed point cloud, and the boundary seed point cloud is filtered based on the best curve model obtained by fitting to obtain the required road boundary point cloud.
[0067] The aforementioned road boundary detection method, on the one hand, filters ground point clouds and uses non-ground point clouds for road segmentation and boundary detection. This is not only applicable to various 3D LiDARs, eliminating the dependence on LiDAR beam information, but also applicable to road boundary extraction from visually dense point clouds, achieving unstructured road boundary detection. On the other hand, it divides point cloud gratings based on non-ground point clouds and divides roads based on blank gratings, which can accurately segment roads, especially applicable to various irregular roads, thereby greatly improving the accuracy of road boundary detection.
[0068] In one embodiment, determining the road segmentation angle based on the angle value corresponding to the blank grid in the point cloud grid includes: counting the number of points in each point cloud grid, and determining blank grids based on the number of points, wherein a blank grid is a point cloud grid with a number of points of 0 or less than a preset number threshold; sorting according to the angle value corresponding to the blank grid, and selecting the median value of all sorted angle values as the road segmentation angle.
[0069] Specifically, taking a fan-shaped point cloud grid as an example, the non-ground point cloud is divided into N fan-shaped point cloud grids along the circumference. The angle of each grid is 1°, but this angle can also be other values, such as 0.5°, 2°, etc. Then, the number of points in each point cloud grid is counted. The angle of the point cloud grid with 0 points or less than a preset threshold is saved and marked as 1 to represent a blank grid. The others are marked as 0, resulting in a grid array corresponding to each point cloud grid. Each array stores the label value and the angle of the grid. Finally, all grid arrays with a label of 1 are sorted according to the angle order, and the median angle value is selected as the road dividing angle.
[0070] In one embodiment, before sorting based on the angle value corresponding to the blank raster, the method further includes: performing median filtering based on the annotation information of all point cloud rasters and removing point cloud rasters with outliers, wherein the annotation information of the point cloud rasters is labeled based on the number of points.
[0071] Specifically, in order to improve the accuracy of the data, median filtering is applied to the annotation information of all point cloud rasters to remove individual outliers between point cloud rasters, thereby improving the accuracy of road division.
[0072] This embodiment rasterizes the non-ground point cloud after filtering the ground, and then filters out some outliers using median filtering. Based on the blank grids in the filtered non-ground point cloud, the angle of the road trend ahead can be accurately calculated, thereby improving the accuracy of road segmentation by accurately calculating the road segmentation angle. At the same time, it can also detect the location of irregular roads such as intersections and T-junctions in the surround-view LiDAR.
[0073] In one example, extracting the target region from the raw point cloud data to obtain the target point cloud includes: performing pass-through filtering on the raw point cloud data along each axis based on the target region, thereby extracting the target point cloud. Specifically, the raw point cloud data is subjected to pass-through filtering along the height axis using a height array.
[0074] Specifically, the raw point cloud data is subjected to pass-through filtering along the X, Y, and Z axes. The X and Y axes are horizontal axes, and the Z axis is a height axis. The X and Y axes are restricted upwards according to actual needs, while the Z axis is restricted upwards using the height array.
[0075] Specifically, considering that the installation error of lidar inherently includes a certain pitch angle error, which can lead to a significant difference in the height of the ground point cloud at a distance and at a closer distance, and that factors such as ground slope can also cause a significant difference in the height of the ground point cloud, this embodiment uses a height array H = {z1, z2, z3, ..., zn} to perform height filtering on the original point cloud data. This avoids the loss of road boundary points caused by the height filtering due to the above factors. The number of elements in the height array depends on the number of blocks in the original point cloud data. For example, if the original point cloud data is divided into 3 blocks according to the distance along the X-axis, then the height array H = {z1, z2, z3} is used to perform height filtering on each block separately. The value of each element in the height array depends on the Z-axis coordinate of the point data in the corresponding area to match the height of that area, thereby accurately performing height filtering and avoiding the loss of height filtering data.
[0076] This embodiment uses height filtering based on a height array, which can not only adapt to sloping road surfaces, but also correct for data loss caused by LiDAR installation errors, thereby greatly improving the accuracy of road boundary detection.
[0077] In one embodiment, ground segmentation of the target point cloud to obtain a non-ground point cloud includes: dividing the target point cloud into several point cloud regions; performing ground segmentation on each point cloud region using a random sampling consensus algorithm with plane normal vector constraints, and merging them to obtain a non-ground point cloud, wherein the plane normal vector is the normal vector of the ground plane model fitted to the point cloud region.
[0078] Specifically, the target point cloud can be divided into N point cloud regions along the X-axis direction, where the X-axis direction is the direction of car travel, i.e., the road direction. The number of point cloud regions corresponds to the number in the height array mentioned above.
[0079] Specifically, a ground plane model is obtained by fitting each point cloud region using a random sampling consensus algorithm. The correctness of the fitted ground plane model is then checked by the plane normal vector of the ground plane model. If it is incorrect, the fitting is iterated again until the correct ground plane model is found. The ground plane point cloud is then segmented from each point cloud region using the corresponding ground plane model, and then merged to obtain the non-ground point cloud.
[0080] This embodiment performs ground segmentation based on random sampling consensus constrained by regional block fusion normal vectors, and combines it with multi-threaded parallel processing, which solves the problems of low ground segmentation efficiency and low segmentation accuracy of traditional random sampling consensus algorithms, and greatly improves the accuracy and processing efficiency of ground segmentation.
[0081] In some embodiments, the ground segmentation of each point cloud region using a random sampling consensus algorithm constrained by plane normal vectors and the merging of the results to obtain a non-ground point cloud includes: using a random sampling consensus algorithm constrained by plane normal vectors to fit the ground plane model of each point cloud region in parallel through multi-threading, wherein the correctness of the ground plane model is determined by comparing the angle between the plane normal vector and the standard ground normal vector with a preset angle threshold, and if it is incorrect, the fitting is iterated again; and the ground segmentation of each point cloud region is performed according to the corresponding ground plane model, and the merging of the results to obtain a non-ground point cloud.
[0082] Specifically, multi-threaded parallel processing of each point cloud region is used to improve overall processing efficiency. Taking a point cloud region as an example, a ground plane model is fitted using a random sampling consensus algorithm as Ax + By + Cz + D = 0, where the plane normal vector of the ground plane model is a vector n1 = [A, B, C] composed of normalized coefficients, and the reference standard ground normal vector n2 = [0, 0, 1]. For example, if the preset angle threshold is 45°, the angle between normal vectors n1 and n2 is calculated. If it is greater than 45°, it cannot be used as a ground plane model, and the fitting is iterated again to find the correct ground plane model to segment the ground plane point cloud, obtaining the non-ground point cloud corresponding to the point cloud region. Finally, the non-ground point clouds of each region are merged to obtain the overall non-ground point cloud.
[0083] In one embodiment, see Figure 2The process of performing distance filtering on the environmental point clouds on both sides of the road to obtain the corresponding boundary seed point clouds includes: S501: performing rasterization processing on the environmental point clouds on both sides of the road to obtain several environmental grids; S502: performing distance filtering on each environmental grid to obtain the seed point of each environmental grid; S503: obtaining the boundary seed point cloud based on the seed point.
[0084] Specifically, the environmental point clouds on both sides of the road are rasterized along the X-axis to obtain several environmental grids. Then, distance filtering is performed in each grid based on the Y-axis coordinates of the point cloud. Taking the Y-axis direction towards the left side of the road as an example, for the environmental grids on the left side of the road, the point with the smallest Y-coordinate in each grid is selected as the seed point. For the environmental grids on the right side of the road, the point with the largest Y-coordinate in each grid is selected as the seed point. Finally, the boundary seed point clouds on both sides of the road are combined to obtain the boundary seed point clouds on both sides of the road.
[0085] This embodiment extracts road boundary points based on elevation geometry features. First, it filters out the ground point cloud. Then, it segments the non-ground point cloud according to the road segmentation angle, dividing it into left and right road edges. By using distance filtering, it finds the road edge seed points for each segment along the road segmentation line. Specifically, the point with the smallest Y value is selected for the left road edge, and the point with the largest Y value is selected for the right road edge. In this way, candidate point clouds of road boundaries can be extracted. This method is not only applicable to the extraction of road boundary seed points for various 3D LiDAR systems, but also to the extraction of road boundary seed points for visually dense point clouds.
[0086] In one embodiment, see Figure 2 Based on the boundary seed point cloud, curve fitting is performed to extract the road boundary point cloud, including: S504: Curve fitting is performed on the boundary seed point cloud using a quadratic polynomial to extract the coarse boundary point cloud; S505: Curve fitting is performed on the coarse boundary point cloud using a cubic polynomial to extract the road boundary point cloud.
[0087] Specifically, this embodiment uses a combination of quadratic polynomial fitting and cubic polynomial fitting to extract road boundary point clouds. Specifically, coarse boundary point clouds are extracted from the boundary seed point cloud through quadratic polynomial fitting, and fine road boundary point clouds are extracted from the coarse boundary point cloud through cubic polynomial fitting.
[0088] In one embodiment, the process of curve fitting the boundary seed point cloud using a quadratic polynomial to extract a coarse boundary point cloud includes: iteratively fitting multiple quadratic parabolic models based on the boundary seed point cloud, and counting the number of interior points of each quadratic parabolic model. Specifically, three points are randomly extracted from the boundary seed point cloud to establish a quadratic parabolic model. The corresponding model parameter matrix is calculated based on the quadratic parabolic model. The number of interior points of the quadratic parabolic model is counted using the model parameter matrix and a preset residual threshold. The quadratic parabolic model with the largest number of interior points is selected as the optimal model, and the boundary seed point cloud is filtered to extract the coarse boundary point cloud.
[0089] Specifically, coarse boundary point clouds are extracted through quadratic polynomial fitting, where the quadratic polynomial model is y = ax 2 Specifically, using the random sampling consensus algorithm, three points are randomly selected from the boundary seed point cloud, and the quadratic parabolic model y = a0x is calculated. 2 +b0x+c0, respectively, form matrix X from the x-coordinates of the boundary seed point cloud and matrix Y from the y-coordinates of the boundary seed point cloud. Then calculate the corresponding model parameter matrix M = [a0, b0, c0]. The specific calculation method is: M = X inv ·Y, X inv The inverse matrix of X is then used, along with the model parameter matrix M and a pre-set residual threshold T. two The number of interior points N in the statistical model is determined, and then after n iterations, the model with the largest number of interior points is obtained as the optimal model M. best Then, the optimal model is used to filter out the coarse boundary point clouds on both sides of the road.
[0090] In one embodiment, the method of extracting the road boundary point cloud by curve fitting of the coarse boundary point cloud using a cubic polynomial includes: obtaining multiple cubic curve models through iterative fitting based on the coarse boundary point cloud, and counting the number of interior points in each cubic curve model. Specifically, four points are randomly extracted from the coarse boundary point cloud to establish a cubic curve model, and the corresponding model parameter matrix is calculated based on the cubic curve model. The number of interior points in the cubic curve model is counted using the model parameter matrix and a preset residual threshold. The cubic curve model with the largest number of interior points is selected as the optimal model, and the coarse boundary point cloud is filtered to extract the road boundary point cloud.
[0091] Specifically, the coarse boundary point cloud is further fitted using a cubic polynomial, with the cubic polynomial model being y = ax. 3 +bx 2 +cx+d, specifically, firstly, four points are randomly extracted from the coarse boundary point cloud, and the cubic curve model y=a0x is calculated. 3 +b0x 2+c0x+d0, respectively, form matrix X from the x-coordinates of the coarse boundary point cloud and matrix Y from the y-coordinates of the coarse boundary point cloud. Then calculate the model parameter matrix M = [a0,b0,c0,d0], specifically M = X inv ·Y, X inv The inverse matrix of X is then used, along with the model parameter matrix M and a pre-set residual threshold T. three The number of interior points N in the statistical model is determined, and then after n iterations, the model with the largest number of interior points is obtained as the optimal model M. best Then, the optimal model is used to filter out the road boundary point clouds on both sides of the road, and finally the points are stitched together to obtain the final road boundary point cloud.
[0092] This embodiment extracts road boundary point clouds by combining quadratic and cubic polynomial curves. First, a quadratic polynomial fitting algorithm is used to coarsely extract road boundary points, which can eliminate outliers that deviate from the road boundary and retain more road boundary points. Then, a cubic polynomial curve fitting algorithm is used to finely extract road boundary points, which greatly improves the overall fitting effect of road boundaries.
[0093] This embodiment will now be described with reference to a specific scenario, but it is not limited thereto.
[0094] See Figure 3 We will now perform road boundary detection on a raw point cloud dataset. In the point cloud coordinate system, the X-axis represents the direction the car is traveling along the road, the Y-axis points to the left of the car, and the Z-axis represents the height. The specific steps are as follows:
[0095] 1) First, the original point cloud data is subjected to pass-through filtering along the X, Y, and Z axes using a region of interest segmentation algorithm to obtain the target point cloud P. roi In this process, the X and Y directions are restricted according to actual needs, the Z direction is restricted using a height array, and the target point cloud after pass-through filtering is divided into N point cloud regions P along the X direction. i ;
[0096] Considering that the point cloud obtained by LiDAR scanning may have installation errors or ground slope, a height array H = {z1, z2, z3, ..., zn} is used to sequentially filter the height of the N point cloud regions segmented along the X-axis. The specific values of z1, z2, z3, ..., zn in the array are determined according to the height coordinates of the corresponding point cloud regions. This is to remove as many irrelevant point clouds as possible without losing road boundary points and to improve the efficiency of subsequent ground segmentation algorithms.
[0097] 2) Secondly, a random sampling consensus algorithm with normal vector constraints is used to process each point cloud region P. i Ground segmentation is performed, which is accelerated through multi-threaded parallel computing;
[0098] Specifically, through the point cloud region P i The random sample consensus algorithm is used to fit a ground plane model as Ax + By + Cz + D = 0, where the plane normal vector of the ground plane model is a vector n1 = [A, B, C] composed of normalized coefficients, and the reference standard ground plane normal vector n2 = [0, 0, 1]. Here, the angle between normal vectors n1 and n2 is calculated. If it is greater than a preset angle threshold of 45°, it cannot be used as a ground plane model, and the fitting is iterated again until a correct ground plane model is found to segment the ground point cloud of the road. Finally, each point cloud region P is... i The ground point cloud and non-ground point cloud are merged to obtain the ground point cloud P. ground Non-terrestrial point cloud P noground ;
[0099] 3) Then, by analyzing the non-ground point cloud P noground Perform sector-shaped grid segmentation, determine the road segmentation angle α based on the angle value corresponding to the blank grid in the sector-shaped grid, and use the road segmentation angle to define the non-ground point cloud P. noground The points are divided to obtain the environmental point cloud P on both sides of the road. left and P right ;
[0100] Specifically, non-ground point cloud P noground Divide the environment into N sector grids along the circumference, with each grid having an angle of 1°, to obtain the environment grid P. grid_i , i∈N, then statistically analyze the environmental grid P grid_i The number of midpoints is determined by saving the angles of the sector grids with a count of 0 and labeling them as 1 (blank grids), while the rest are labeled as 0. Then, median filtering is applied to the saved label information in all grids to remove outliers, resulting in a grid array N_grid. Each array stores the label value and the grid angle. Finally, the grid array N_grid with a label of 1 is processed. grid Sort the angles and select the median angle as the road dividing angle α. If the angle array N with label 1... grid A value of 0 indicates that there is congestion and severe obstruction of traffic ahead. In this case, the road segmentation angle can be set to the default value of 0°, i.e., the X-axis direction.
[0101] Specifically, based on the road segmentation angle α, the non-ground point cloud P can be... noground Divided into left-side environmental point cloud P left And the environmental point cloud P on the right right The specific segmentation formula is as follows:
[0102]
[0103] Where pt represents a point in the point cloud, pt.x represents the X coordinate of the point cloud, and pt.y represents the Y coordinate of the point cloud;
[0104] 4) Finally, the road boundary point cloud is filtered out from the seed point cloud by a polynomial fitting algorithm, the coarse boundary point cloud is extracted by a quadratic polynomial fitting algorithm, and the fine road boundary point cloud is extracted by a cubic polynomial fitting algorithm.
[0105] First, extract the left and right road boundary seed points P from the left and right environment point clouds using distance filtering. l_seed and P r_seed The specific approach is to first rasterize the left and right environment point clouds along the X-axis to obtain the environment raster P. X_grid_left and P X_grid_right Then, within each grid cell, selection is performed based on the Y-coordinate of the point cloud. Specifically, in P... X_grid_left Select the min(pt.y) of the point cloud in each raster as the seed point, in P X_grid_right Select the max(pt.y) of the point cloud in each raster as the seed point to obtain the boundary seed point cloud P of the road. l_seed and P r_seed ;
[0106] Then, coarse boundary point clouds are extracted by fitting a quadratic polynomial. The quadratic polynomial model is y = ax 2 +bx+c, specifically, through a random sampling consensus algorithm, from the seed point cloud P l_seed and P r_seed Select three points randomly and calculate the quadratic parabola model y = a0x. 2 +b0x+c0, construct matrix X from the point cloud's pt.x coordinates and matrix Y from its pt.y coordinates. Then calculate the model parameter matrix M = [a0, b0, c0]. The specific calculation method is M = X inv ·Y, X inv The inverse matrix of X is then obtained through model M and a pre-set residual threshold T. two The number of interior points N in the statistical model is determined, and then after n iterations, the model with the largest number of interior points is obtained as the optimal model M. best Then, the coarse boundary point cloud is filtered out using the optimal model to obtain P. l_rough_bound and P r_rough_bound .
[0107] Then, a cubic polynomial is used to continue fitting the coarse boundary point cloud. The cubic polynomial model is y = ax 3 +bx 2 +cx+d, specifically, firstly, four points are randomly extracted from the coarse boundary point cloud to calculate the cubic curve model y=a0x 3 +b0x 2+c0x+d0, construct matrix X from the point cloud's pt.x coordinates and matrix Y from its pt.y coordinates. Then calculate the model parameter matrix M = [a0, b0, c0, d0]. The specific calculation method is M = X inv ·Y, X inv The inverse matrix of X is then obtained through model M and a pre-set residual threshold T. three The number of interior points N in the statistical model is determined, and then after n iterations, the model with the largest number of interior points is obtained as the optimal model M. best Then, the optimal model is used to filter out the detailed road boundary point cloud, resulting in P. l_bound and P r_bound Finally, the point clouds of the left and right boundaries are stitched together to obtain the final road boundary point cloud P. bound .
[0108] It should be understood that although the steps in the flowcharts of the embodiments described above are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the embodiments described above may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages of other steps.
[0109] Based on the same inventive concept, this application also provides a road boundary detection device for implementing the road boundary detection method described above. The solution provided by this device is similar to the solution described in the above method; therefore, the specific limitations in one or more road boundary detection device embodiments provided below can be found in the limitations of the road boundary detection method described above, and will not be repeated here.
[0110] In one embodiment, such as Figure 4 As shown, a road boundary detection device is provided, the device comprising:
[0111] Module 10 is used to acquire the raw point cloud data of the road;
[0112] Target extraction module 20 is used to extract the target region from the raw point cloud data to obtain the target point cloud;
[0113] Ground segmentation module 30 is used to segment the target point cloud into ground to obtain a non-ground point cloud;
[0114] The road segmentation module 40 is used to divide the non-ground point cloud into several point cloud grids, and determine the road segmentation angle according to the angle value corresponding to the blank grid in the point cloud grid. The non-ground point cloud is segmented by the road segmentation angle to obtain the environmental point cloud on both sides of the road.
[0115] The boundary extraction module 50 performs distance filtering on the environmental point clouds on both sides of the road to obtain the corresponding boundary seed point clouds, and performs curve fitting based on the boundary seed point clouds to extract the road boundary point clouds.
[0116] In one embodiment, determining the road segmentation angle based on the angle value corresponding to the blank grid in the point cloud grid includes: counting the number of points in each point cloud grid, and determining blank grids based on the number of points, wherein a blank grid is a point cloud grid with a number of points of 0 or less than a preset number threshold; sorting according to the angle value corresponding to the blank grid, and selecting the median value of all sorted angle values as the road segmentation angle.
[0117] In one embodiment, before sorting based on the angle value corresponding to the blank raster, the method further includes: performing median filtering based on the annotation information of all point cloud rasters and removing point cloud rasters with outliers, wherein the annotation information of the point cloud rasters is labeled based on the number of points.
[0118] In one embodiment, extracting a target region from raw point cloud data to obtain a target point cloud includes: performing pass-through filtering on the raw point cloud data along each axis based on the target region to extract the target point cloud, wherein the raw point cloud data is subjected to pass-through filtering along the height axis using a height array.
[0119] In one embodiment, ground segmentation of the target point cloud to obtain a non-ground point cloud includes: dividing the target point cloud into several point cloud regions; performing ground segmentation on each point cloud region using a random sampling consensus algorithm with plane normal vector constraints, and merging them to obtain a non-ground point cloud, wherein the plane normal vector is the normal vector of the ground plane model fitted to the point cloud region.
[0120] In one embodiment, the ground segmentation of each point cloud region using a random sampling consensus algorithm constrained by plane normal vectors and the merging of the resulting non-ground point cloud includes: using a random sampling consensus algorithm constrained by plane normal vectors to fit the ground plane model of each point cloud region in parallel through multi-threading, wherein the correctness of the ground plane model is determined by comparing the angle between the plane normal vector and the standard ground normal vector with a preset angle threshold; if incorrect, the fitting is iterated again; and ground segmentation of each point cloud region according to the corresponding ground plane model and the merging of the resulting non-ground point cloud.
[0121] In one embodiment, performing distance filtering on the environmental point clouds on both sides of the road to obtain the corresponding boundary seed point cloud includes: rasterizing the environmental point clouds on both sides of the road to obtain several environmental grids; performing distance filtering on each environmental grid to obtain seed points for each environmental grid; and obtaining the boundary seed point cloud based on the seed points.
[0122] In one embodiment, extracting the road boundary point cloud by curve fitting based on the boundary seed point cloud includes: extracting the coarse boundary point cloud by curve fitting the boundary seed point cloud using a quadratic polynomial; and extracting the road boundary point cloud by curve fitting the coarse boundary point cloud using a cubic polynomial.
[0123] In one embodiment, the method of extracting the road boundary point cloud by curve fitting of the coarse boundary point cloud using a cubic polynomial includes: obtaining multiple cubic curve models through iterative fitting based on the coarse boundary point cloud, and counting the number of interior points in each cubic curve model. Specifically, four points are randomly extracted from the coarse boundary point cloud to establish a cubic curve model, and the corresponding model parameter matrix is calculated based on the cubic curve model. The number of interior points in the cubic curve model is counted using the model parameter matrix and a preset residual threshold. The cubic curve model with the largest number of interior points is selected as the optimal model, and the coarse boundary point cloud is filtered to extract the road boundary point cloud.
[0124] Each module in the aforementioned road boundary detection device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device, or stored in the memory of a computer device as software, so that the processor can call and execute the corresponding operations of each module.
[0125] In one embodiment, a computer device is provided, the internal structure of which can be shown as follows: Figure 5 As shown, the computer device includes a processor, memory, and a communication interface connected via a system bus. The processor provides computing and control capabilities. The memory includes a non-volatile storage medium and internal memory. The non-volatile storage medium stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage medium. The communication interface is used for wired or wireless communication with external terminals; wireless communication can be achieved through Wi-Fi, mobile cellular networks, NFC (Near Field Communication), or other technologies. When executed by the processor, the computer program implements a road boundary detection method.
[0126] Those skilled in the art will understand that Figure 5The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0127] In one embodiment, a computer device is provided, including a memory and a processor. The memory stores a computer program, and the processor executes the computer program to implement any of the road boundary detection methods described in the above embodiments. For detailed explanations, please refer to the corresponding descriptions of the methods; they will not be repeated here.
[0128] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When executed by a processor, the computer program implements any one of the road boundary detection methods described above. For detailed explanations, please refer to the corresponding descriptions of the methods, which will not be repeated here.
[0129] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, etc., and are not limited to these.
[0130] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0131] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.
Claims
1. A road boundary detection method, characterized in that, The method includes: Obtain the raw point cloud data of the road; Extract the target region from the original point cloud data to obtain the target point cloud; The target point cloud is segmented into ground data to obtain a non-ground point cloud. The non-ground point cloud is divided into several point cloud grids, and the road segmentation angle is determined according to the angle corresponding to the blank grid in the point cloud grid. The non-ground point cloud is divided by the road segmentation angle to obtain the environmental point clouds on both sides of the road. The blank grid is the point cloud grid with a point number of 0 or less than a preset number threshold. Distance filtering is performed on the environmental point clouds on both sides of the road to obtain the corresponding boundary seed point clouds, and curve fitting is performed based on the boundary seed point clouds to extract the road boundary point cloud. The step of performing distance filtering on the environmental point clouds on both sides of the road to obtain the corresponding boundary seed point clouds includes: The environmental point clouds on both sides of the road are rasterized to obtain several environmental rasters; Distance filtering is performed on each of the environmental grids to obtain the seed point of each environmental grid; the seed point refers to the point in the environmental grid that is closest to the road boundary line. The boundary seed point cloud is obtained based on the seed points.
2. The method according to claim 1, characterized in that, Determining the road segmentation angle based on the angle corresponding to the blank grid in the point cloud grid includes: The number of points in each point cloud grid is counted, and the blank grid is determined based on the number of points. The blank grids are sorted according to their corresponding angles, and the median value of all sorted angles is selected as the road dividing angle.
3. The method according to claim 2, characterized in that, Before sorting according to the angle corresponding to the blank grid, the method further includes: Median filtering is performed on the annotation information of all the point cloud graticles, and the point cloud graticles with outliers are removed, wherein the annotation information of the point cloud graticles is labeled based on the number of points.
4. The method according to any one of claims 1 to 3, characterized in that, The step of extracting the target region from the original point cloud data to obtain the target point cloud includes: The target point cloud is obtained by performing pass-through filtering on the original point cloud data along each axis based on the target region, wherein the original point cloud data is subjected to pass-through filtering along the height axis using a height array.
5. The method according to any one of claims 1 to 3, characterized in that, The step of performing ground segmentation on the target point cloud to obtain a non-ground point cloud includes: The target point cloud is divided into several point cloud regions; The ground is segmented for each point cloud region using a random sampling consensus algorithm with plane normal vector constraints, and the resulting non-ground point cloud is obtained by merging the segments. The plane normal vector is the normal vector of the ground plane model fitted to the point cloud region.
6. The method according to claim 5, characterized in that, The random sampling consensus algorithm constrained by the plane normal vector performs ground segmentation on each point cloud region, and merges them to obtain the non-ground point cloud, including: The random sampling consensus algorithm based on the plane normal vector constraint fits the ground plane model of each point cloud region in parallel through multi-threading. The correctness of the ground plane model is determined by comparing the angle between the plane normal vector and the standard ground normal vector with a preset angle threshold. If it is incorrect, the fitting is iterated again. The point cloud region is segmented into ground planes according to the corresponding ground plane model, and then merged to obtain the non-ground point cloud.
7. The method according to any one of claims 1 to 3, characterized in that, The process of curve fitting based on the boundary seed point cloud to extract the road boundary point cloud includes: The coarse boundary point cloud is obtained by curve fitting of the boundary seed point cloud using a quadratic polynomial. The road boundary point cloud is extracted by curve fitting of the coarse boundary point cloud using a cubic polynomial.
8. The method according to claim 7, characterized in that, The step of performing curve fitting on the coarse boundary point cloud using a cubic polynomial to extract the road boundary point cloud includes: Multiple cubic curve models are obtained by iterative fitting based on the coarse boundary point cloud, and the number of interior points of each cubic curve model is counted. Specifically, four points are randomly extracted from the coarse boundary point cloud to establish the cubic curve model. The corresponding model parameter matrix is calculated based on the cubic curve model. The number of interior points of the cubic curve model is counted by using the model parameter matrix and a preset residual threshold. The cubic curve model with the largest number of interior points is used as the optimal model to filter the coarse boundary point cloud and extract the road boundary point cloud.
9. A road boundary detection device, characterized in that, The device includes: The acquisition module is used to acquire the raw point cloud data of the road. The target extraction module is used to extract the target region from the original point cloud data to obtain the target point cloud; The ground segmentation module is used to segment the target point cloud into ground segments to obtain a non-ground point cloud. The road segmentation module is used to divide the non-ground point cloud into several point cloud grids, and determine the road segmentation angle according to the angle corresponding to the blank grid in the point cloud grid. The non-ground point cloud is divided by the road segmentation angle to obtain the environmental point clouds on both sides of the road. The blank grid is the point cloud grid with a point number of 0 or less than a preset number threshold. The boundary extraction module is used to perform distance filtering on the environmental point clouds on both sides of the road to obtain the corresponding boundary seed point clouds, and to perform curve fitting based on the boundary seed point clouds to extract the road boundary point cloud. The boundary extraction module is also used to perform rasterization processing on the environmental point clouds on both sides of the road to obtain several environmental rasteres. Distance filtering is performed on each of the environmental grids to obtain the seed point of each environmental grid; the seed point refers to the point in the environmental grid that is closest to the road boundary line. The boundary seed point cloud is obtained based on the seed points.
10. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 8.
11. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 8.
Citation Information
Patent Citations
Road environment element sensing method based on laser radar
CN111985322A
Road surface boundary estimation device and program
JP2014006588A