Lidar-based road edge detection method and device, processor, and vehicle

By separating planar and non-planar point cloud sets, using grid maps and eight-neighbor search methods, and combining DBSCAN and random sampling consensus algorithm to fit road edge curves, the bias and speed problems of road edge detection are solved, achieving high-precision, all-weather road edge detection.

CN116203582BActive Publication Date: 2026-07-03SUZHOU ZHITU TECH CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
SUZHOU ZHITU TECH CO LTD
Filing Date
2022-12-07
Publication Date
2026-07-03

Smart Images

  • Figure CN116203582B_ABST
    Figure CN116203582B_ABST
Patent Text Reader

Abstract

This application provides a road edge detection method, device, processor, and vehicle based on LiDAR. The method involves acquiring a target point cloud and determining its planar and non-planar point cloud sets. Based on the target point cloud, a grid map is constructed, and further divided into a ground grid map and a non-ground grid map based on the planar and non-planar point cloud sets. An eight-neighborhood search method is used to traverse each grid cell in the non-ground grid map to identify multiple target grid cells corresponding to the road edge. Finally, the road edge is determined based on these multiple target grid cells. This method solves the technical problems of significant bias and slow computation speed in related technologies for road edge detection.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of autonomous driving, and more specifically, to a method and device for roadside detection based on LiDAR, a processor, and a vehicle. Background Technology

[0002] Environmental perception is a core technology in autonomous driving. Among these technologies, the perception of road edges enables the system to effectively extract regions of interest without relying on high-precision maps, narrowing the scope of obstacle detection and tracking, and improving obstacle detection speed and accuracy. Simultaneously, road edge detection can provide environmental reference information in scenarios with poor localization signals, thereby assisting in localization.

[0003] Currently, road edge detection primarily utilizes vision and LiDAR. Vision-based road edge detection performs poorly because the color information of the road edge is very similar to that of the road surface, making it difficult to accurately and effectively extract from images, resulting in poor detection performance. Furthermore, image detection methods are highly susceptible to lighting and weather conditions. LiDAR-based road edge detection mainly involves extracting road edge points from large-scale point cloud data using certain methods, and then fitting a curve equation based on these points. However, noise is easily introduced during the extraction of road edge points, affecting curve fitting and causing significant deviations in the fitted road edge curve. In addition, the extraction process requires traversing the point cloud one by one, increasing computational time and making it difficult to meet real-time requirements. Therefore, existing technologies for road edge detection suffer from significant bias and slow computation speed.

[0004] No effective solutions have yet been proposed to address the aforementioned problems in the relevant technologies. Summary of the Invention

[0005] The main objective of this application is to provide a road edge detection method, device, processor, and vehicle based on lidar, in order to solve the technical problems of large deviations and slow calculation speed in the detection of road edges in related technologies.

[0006] To achieve the above objectives, according to one aspect of this application, a road edge detection method based on lidar is provided, comprising: acquiring a target point cloud, and determining a planar point cloud set and a non-planar point cloud set in the target point cloud, wherein the planar point cloud set is a point cloud set composed of target point clouds corresponding to a first object in the current scene, and the non-planar point cloud set is a point cloud set composed of target point clouds corresponding to a second object in the current scene, the first object being an object with a planar surface, and the second object being an object without a planar surface; establishing a grid map based on the target point cloud, and dividing the grid map into a ground grid map and a non-ground grid map based on the planar point cloud set and the non-planar point cloud set; traversing each grid in the non-ground grid map using an eight-neighbor search method to determine multiple target grids corresponding to the road edge; and determining the road edge based on the multiple target grids.

[0007] Further, acquiring the target point cloud includes: acquiring the original point cloud; performing preprocessing operations on the original point cloud to obtain a preprocessed point cloud; and processing the preprocessed point cloud by voxel downsampling to obtain the target point cloud.

[0008] Further, the original point cloud is preprocessed to obtain a preprocessed point cloud, including: determining whether there is a NaN value in the original point cloud; if there is a NaN value in the original point cloud, removing the NaN value to obtain a first point cloud; projecting the first point cloud into a three-dimensional coordinate system to obtain multiple three-dimensional coordinates corresponding to multiple first point clouds; and determining the preprocessed point cloud based on the multiple three-dimensional coordinates.

[0009] Further, based on multiple three-dimensional coordinates, the preprocessed point cloud is determined, including: determining the origin coordinates of the three-dimensional coordinate system; determining the distance between each first point cloud and the origin of the coordinate system based on the origin coordinates and multiple three-dimensional coordinates to obtain multiple distances; determining a first preset distance, determining the first point cloud corresponding to the distance greater than the first preset distance among the multiple distances, and discarding the first point cloud to obtain a second point cloud; determining a first height threshold, and determining the second point cloud whose vertical axis coordinate value is greater than the first height threshold, and discarding the second point cloud to obtain the preprocessed point cloud.

[0010] Furthermore, the preprocessed point cloud is processed by voxel downsampling to obtain the target point cloud, including: dividing the preprocessed point cloud into multiple grids; determining all preprocessed point clouds contained in each grid; calculating the centroid value corresponding to each grid based on all preprocessed point clouds; and replacing all preprocessed point clouds contained in each grid with the centroid value corresponding to the grid to obtain the target point cloud.

[0011] Further, determining the planar point cloud set and the non-planar point cloud set in the target point cloud includes: determining the maximum number of iterations corresponding to the random sampling consensus algorithm and multiple second preset distances, wherein each second preset distance is less than the second preset distance corresponding to the previous iteration process, and one iteration process corresponds to one second preset distance; processing the target point cloud and extracting planar feature points contained in the target point cloud based on the first second preset distance; dividing the target point cloud into a first planar point cloud set and a first non-planar point cloud set based on the planar feature points; processing the first non-planar point cloud set to extract planar feature points in the non-planar point cloud set based on the second preset distance; processing the non-planar point cloud set obtained in the previous iteration process multiple times based on the multiple second preset distances corresponding to the multiple iteration processes to obtain an initial planar point cloud set and an initial non-planar point cloud set; and determining the planar point cloud set and the non-planar point cloud set based on the initial planar point cloud set and the initial non-planar point cloud set.

[0012] Further, based on the initial planar point cloud set and the initial non-planar point cloud set, the planar point cloud set and the non-planar point cloud set are determined, including: fitting the initial planar point cloud set into a plane; traversing each initial non-planar point cloud and determining the distance between each initial non-planar point cloud and the plane to obtain multiple distances; determining a third preset distance, and determining the initial non-planar point cloud corresponding to the distance less than the third preset distance among the multiple distances, and dividing the initial non-planar point cloud into the set of target point clouds to determine the planar point cloud set and the non-planar point cloud set.

[0013] Furthermore, based on the target point cloud, a raster map is established, including: determining the size of each raster in the raster map; determining the number of rows and columns of the raster map; and constructing the raster map based on the target point cloud, raster size, number of rows, and number of columns. Each raster in the raster map corresponds to a set of raster indexes, which include row indexes and column indexes.

[0014] Furthermore, based on the planar point cloud set and the non-planar point cloud set, the raster map is divided into a ground raster map and a non-ground raster map, including: initializing the attributes of all rasters contained in the raster map as the first attribute; if it is determined that the target point cloud contained in the raster in the raster map belongs to the planar point cloud set, the raster is determined to be a ground raster map and the attribute of the raster is determined to be the second attribute; if it is determined that the target point cloud contained in the raster belongs to the non-planar point cloud set, the raster is determined to be a non-ground raster map and the attribute of the raster is determined to be the third attribute.

[0015] Furthermore, by using the eight-neighbor search method, each grid in the non-ground grid map is traversed to determine multiple target grids corresponding to the road edge, including: by using the eight-neighbor search, determining whether there is a grid that meets the preset conditions in the eight neighbor grids corresponding to the first grid, where the first grid is any grid in the non-ground grid map; if there is a grid that meets the preset conditions, the first grid is determined as the target grid.

[0016] Furthermore, the initial attribute of all graticles in the raster map is the first attribute, the attribute of graticles in the ground raster map is the second attribute, and the attribute of graticles in the non-ground raster map is the third attribute. Through eight-neighbor search, it is determined whether there are graticles that meet preset conditions in the eight-neighbor area corresponding to the first graticle, including: determining the target distance between the first graticle and the origin of the three-dimensional coordinate system, where the three-dimensional coordinate system is the coordinate system corresponding to the target point cloud projection; if there is a graticle with the second attribute in the eight-neighbor area corresponding to the first graticle, it is determined that there are graticles that meet preset conditions in the eight-neighbor area; or, if there is a graticle with the first attribute in the eight-neighbor area corresponding to the first graticle and the target distance is greater than a distance threshold, it is determined that there are graticles that meet preset conditions in the eight-neighbor area.

[0017] Further, based on multiple target rasters, the road edge is determined, including: determining multiple raster indices corresponding to each target raster, wherein the raster index contains a row index and a column index, the raster index is used to locate the target raster, and the raster index corresponds one-to-one with the target raster; storing the multiple raster indices in a target queue, and clustering the multiple target rasters in the target queue using the DBSCAN algorithm to obtain multiple clusters; fitting the coordinates of all rasteres contained in the multiple clusters using a random sampling consensus algorithm combined with the least squares method to obtain the target curve; determining the shape corresponding to the target curve as the shape corresponding to the road edge to obtain the road edge.

[0018] Furthermore, multiple target rasters in the target queue are clustered using a random sampling consensus algorithm to obtain multiple clusters, including: determining the cluster radius and the preset number of cluster members; using the DBSCAN algorithm to cluster the target queue according to the cluster radius to obtain multiple initial clusters; determining the number of target rasters contained in each initial cluster; and removing initial clusters with fewer than the preset number of cluster members to obtain multiple clusters.

[0019] Furthermore, by combining the random sampling consensus algorithm with the least squares method, the grid coordinates contained in multiple clusters are fitted to obtain the target curve, including: determining multiple sample target point clouds contained in the clusters; determining multiple sets of parameters based on the sample target point clouds, wherein the multiple sets of parameters are the multiple sets of parameters corresponding to the fitting curve equation of the least squares method; determining multiple fitting curves based on the multiple sets of parameters and the fitting curve equation; and determining the fitting curve that meets the fitting conditions as the target curve.

[0020] Furthermore, the fitting condition is that the fitted curve has the most inliers, and the inliers are the target point clouds whose distance from the fitted curve is less than or equal to a distance threshold.

[0021] To achieve the above objectives, according to one aspect of this application, a road edge detection device based on lidar is provided. The device includes: a first acquisition unit, configured to acquire a target point cloud and determine a planar point cloud set and a non-planar point cloud set within the target point cloud, wherein the planar point cloud set is a point cloud set composed of target point clouds corresponding to a first object in the current scene, and the non-planar point cloud set is a point cloud set composed of target point clouds corresponding to a second object in the current scene; the first object is an object with a planar surface, and the second object is an object without a planar surface; a first establishment unit, configured to establish a grid map based on the target point cloud and divide the grid map into a ground grid map and a non-ground grid map based on the planar point cloud set and the non-planar point cloud set; a first determination unit, configured to traverse each grid in the non-ground grid map using an eight-neighborhood search method to determine multiple target grids corresponding to the road edge; and a second determination unit, configured to determine the road edge based on the multiple target grids.

[0022] According to another aspect of this application, a computer-readable storage medium is provided, characterized in that the computer-readable storage medium includes a stored program, wherein the program executes a lidar-based curb detection method.

[0023] According to another aspect of this application, a processor is provided, characterized in that the processor is used to run a program, wherein the program executes a roadside detection method based on lidar during runtime.

[0024] According to another aspect of this application, an electronic device is provided, characterized in that it includes: one or more processors, a memory, and one or more programs, wherein the one or more programs are stored in the memory and configured to be executed by the one or more processors, and the one or more programs include methods for performing a lidar-based curb detection method.

[0025] According to another aspect of this application, a vehicle is provided, characterized in that it includes: a lidar and a lidar-based curb detection device, the lidar-based curb detection device being used to perform a lidar-based curb detection method.

[0026] By applying the technical solution of this application, a target point cloud is acquired, and a set of planar point clouds and a set of non-planar point clouds are determined within the target point cloud. The planar point cloud set is the set of point clouds formed by the target point clouds corresponding to the first object in the current scene, and the non-planar point cloud set is the set of point clouds formed by the target point clouds corresponding to the second object in the current scene. The first object is an object with a planar surface, and the second object is an object without a planar surface. Based on the target point cloud, a raster map is established, and based on the planar and non-planar point cloud sets, the raster map is divided into a ground raster map and a non-ground raster map. An eight-neighborhood search method is used to traverse each grid cell in the non-ground raster map to determine multiple target grid cells corresponding to the road edge. Based on these multiple target grid cells, the road edge is determined. This solves the technical problems of large deviations and slow calculation speed in related technologies for road edge detection, achieving a technical effect that effectively overcomes the influence of lighting changes and shadow occlusion compared to visual road edge detection. Attached Figure Description

[0027] The accompanying drawings, which form part of this application, are used to provide a further understanding of this application. The illustrative embodiments and descriptions of this application are used to explain this application and do not constitute an undue limitation of this application. In the drawings:

[0028] Figure 1 This is a flowchart illustrating a road edge detection method based on lidar according to an embodiment of this application; and

[0029] Figure 2 This is a schematic diagram of laser point cloud planar feature extraction provided in this application;

[0030] Figure 3 A schematic diagram illustrating the division of the raster map provided in this application;

[0031] Figure 4 This is a schematic diagram of the eight-neighbor search provided in this application;

[0032] Figure 5 A schematic diagram of the candidate curb grid obtained after clustering provided in this application;

[0033] Figure 6 A schematic diagram of the road edge fitting results provided for this application;

[0034] Figure 7 This is a schematic diagram of a curb detection device based on lidar according to an embodiment of this application. Detailed Implementation

[0035] It should be noted that the following detailed descriptions are illustrative and intended to provide further explanation of this application. Unless otherwise specified, 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 pertains.

[0036] It should be noted that the terminology used herein is for the purpose of describing particular embodiments only and is not intended to limit the exemplary embodiments according to this application. As used herein, the singular form is intended to include the plural form as well, unless the context clearly indicates otherwise. Furthermore, it should be understood that when the terms "comprising" and / or "including" are used in this specification, they indicate the presence of features, steps, operations, devices, components, and / or combinations thereof.

[0037] It should be understood that when an element (such as a layer, film, region, or substrate) is described as being "on" another element, the element may be directly on the other element, or there may be an intermediate element present. Furthermore, in the specification and claims, when an element is described as being "connected" to another element, the element may be "directly connected" to the other element, or "connected" to the other element via a third element.

[0038] As described in the background section, existing technologies for detecting road edges suffer from significant deviations and slow computation speeds. To address these issues, this application proposes a road edge detection method based on lidar.

[0039] According to an embodiment of this application, a roadside detection method based on lidar is provided.

[0040] Figure 1 This is a flowchart illustrating a roadside detection method based on lidar, according to an embodiment of this application. Figure 1 As shown, the method includes the following steps:

[0041] Step S101: Obtain the target point cloud and determine the planar point cloud set and the non-planar point cloud set in the target point cloud. The planar point cloud set is the point cloud set formed by the target point cloud corresponding to the first object in the current scene, and the non-planar point cloud set is the point cloud set formed by the target point cloud corresponding to the second object in the current scene. The first object is an object with a planar surface, and the second object is an object without a planar surface.

[0042] Step S102: Based on the target point cloud, a raster map is established, and based on the planar point cloud set and the non-planar point cloud set, the raster map is divided into a ground raster map and a non-ground raster map.

[0043] Step S103: Using the eight-neighborhood search method, traverse each grid in the non-ground grid map to determine multiple target grids corresponding to the road edge;

[0044] Step S104: Determine the road edge based on multiple target grids.

[0045] As described above, this application, by acquiring the point cloud features of the target point cloud, divides point clouds with different characteristics into planar point cloud sets and non-planar point cloud sets. Based on the planar and non-planar point clouds, it innovatively divides the raster map into ground raster and non-ground raster. Then, it obtains the boundary information of the raster map through an eight-neighborhood search method, thereby obtaining candidate roadside points. The roadside curve equation is obtained by combining the least squares method with random sampling consistency, and the road edge is determined based on the curve equation. Therefore, this invention innovatively transforms the roadside detection problem of laser point clouds into a boundary search problem based on a raster map, reducing the computational load. Furthermore, it does not require the prior collection of large amounts of data for supervised learning, and has strong versatility.

[0046] Furthermore, by employing an eight-neighborhood road edge detection method based on a raster map, the point cloud-based road edge extraction process is transformed into a raster map-based boundary search process, effectively reducing the computational power consumption caused by processing massive amounts of point clouds. Compared to existing technologies where visual detection of road boundaries on an image requires converting pixel coordinates into 3D coordinates in the physical world based on calibration relationships, this conversion often introduces significant errors. The laser detection proposed in this application is applicable in all weather conditions and scenarios, unaffected by factors such as lighting and weather. Simultaneously, the laser ranging accuracy reaches the centimeter level, ensuring high precision in detecting road boundaries.

[0047] In one optional embodiment, acquiring a target point cloud includes: acquiring an original point cloud; performing preprocessing operations on the original point cloud to obtain a preprocessed point cloud; and processing the preprocessed point cloud by voxel downsampling to obtain the target point cloud. Performing preprocessing operations on the original point cloud to obtain the preprocessed point cloud includes: determining whether NaN values ​​exist in the original point cloud; if NaN values ​​exist, removing the NaN values ​​to obtain a first point cloud; projecting the first point cloud onto a three-dimensional coordinate system to obtain multiple three-dimensional coordinates corresponding to multiple first point clouds; and determining the preprocessed point cloud based on the multiple three-dimensional coordinates. In this application, after obtaining the point cloud acquired by the lidar, the point cloud is preprocessed to remove outliers and excessively high-resolution points. If NaN values ​​exist in the point cloud, they are removed. This point cloud denoising method can effectively remove noise and outliers from candidate points for boundary fitting, improving the curve fitting accuracy of the roadside.

[0048] Further, based on multiple three-dimensional coordinates, the preprocessed point cloud is determined, including: determining the origin coordinates of the three-dimensional coordinate system; determining the distance between each first point cloud and the origin of the coordinate system based on the origin coordinates and multiple three-dimensional coordinates to obtain multiple distances; determining a first preset distance, identifying the first point cloud corresponding to the distance greater than the first preset distance among the multiple distances, and discarding the first point cloud to obtain a second point cloud; determining a first height threshold, identifying the second point cloud whose vertical axis coordinate value is greater than the first height threshold, and discarding the second point cloud to obtain the preprocessed point cloud. The point cloud is projected onto the three-dimensional coordinate system to obtain the three-dimensional spatial coordinates (x, y, z) of the point cloud in the coordinate system, and the first preset distance d is set. thre and the first height threshold Z thre If the distance between the point cloud and the origin of the coordinate system is greater than d thre, The point cloud is discarded. Typically, the origin of the coordinate system is the location where the LiDAR is set. Therefore, the distance from the point cloud to the LiDAR is calculated. Preferably, the first preset distance is 100 meters, which is the distance of interest in this application; distances beyond this are not meaningful. If the vertical axis coordinate value of the point cloud is greater than a first height threshold, such point clouds are also discarded. By setting the first preset distance and the first height threshold, the distance within the range of interest in this application is obtained. The method proposed in this application does not require the prior collection of massive amounts of data for annotation and training, greatly saving time and manpower costs. Simultaneously, it does not require simultaneous collection of GPS and gyroscope data; only the LiDAR needs to be mounted on the back of the vehicle for calibration, and the point cloud coordinates need to be transformed according to the calibration parameters.

[0049] Furthermore, the preprocessed point cloud is processed by voxel downsampling to obtain the target point cloud. This includes: dividing the preprocessed point cloud into multiple grids; identifying all preprocessed point clouds contained in each grid; calculating the centroid value corresponding to each grid based on all preprocessed point clouds; and replacing all preprocessed point clouds in each grid with the corresponding centroid value to obtain the target point cloud. By performing voxel downsampling on the preprocessed point cloud and setting the size of each small cube, point clouds with different sparsity can be obtained, ensuring accuracy while reducing the number of point clouds, thereby reducing computation time.

[0050] In one optional embodiment, determining the planar point cloud set and the non-planar point cloud set in the target point cloud includes: determining the maximum number of iterations corresponding to the random sampling consensus algorithm and multiple second preset distances, wherein each second preset distance is less than the second preset distance corresponding to the previous iteration process, and one iteration process corresponds to one second preset distance; processing the target point cloud and extracting planar feature points contained in the target point cloud based on the first second preset distance; dividing the target point cloud into a first planar point cloud set and a first non-planar point cloud set based on the planar feature points; processing the first non-planar point cloud set to extract planar feature points in the non-planar point cloud set based on the second preset distance; processing the non-planar point cloud set obtained in the previous iteration process multiple times based on the multiple second preset distances corresponding to the multiple iteration processes to obtain an initial planar point cloud set and an initial non-planar point cloud set; determining the planar point cloud set and the non-planar point cloud set based on the initial planar point cloud set and the initial non-planar point cloud set, wherein... Figure 2 This is a schematic diagram of planar feature extraction from laser point clouds.

[0051] As described above, the random sampling consensus algorithm is used to extract features from the point cloud. The maximum number of iterations for this algorithm and the second preset distance corresponding to each iteration are set. Based on the initially set second preset distance d... thre1, Extract planar feature points from the target point cloud and divide the target point cloud into a planar point cloud set `ground_pc` and a non-planar point cloud set `not_ground_pc`. Set a second preset distance `d`. thre2 d thre2 Compared to d thre1 Small, again based on d thre2 The process involves extracting planar feature points from `not_ground_pc`, further dividing `not_ground_pc` into planar point clouds and non-planar point clouds, and repeating this process multiple times. Planar feature points are extracted from the non-planar point set obtained in the previous iteration until the final number of remaining non-planar point clouds is less than a set threshold, or the number of planar feature extractions exceeds a set threshold. At this point, the initial set of planar point clouds and the set of non-planar point clouds are obtained. In summary, this application uses a random sampling consensus algorithm to extract feature points, replacing the traditional laser point cloud ground detection method. This avoids the impact of uneven ground on road surface detection, thereby improving the accuracy of curb detection.

[0052] Further, based on the initial planar point cloud set and the initial non-planar point cloud set, the planar point cloud set and the non-planar point cloud set are determined, including: fitting the initial planar point cloud set into a plane; traversing each initial non-planar point cloud and determining the distance between each initial non-planar point cloud and the plane to obtain multiple distances; determining a third preset distance, and identifying the initial non-planar point clouds corresponding to distances smaller than the third preset distance among the multiple distances, and classifying the initial non-planar point clouds into the target point cloud set to determine the planar point cloud set and the non-planar point cloud set. The plane equation fitted from the initial planar point cloud set is as follows: Iterate through each point (x0, y0, z0) in the initial non-planar point cloud set, and calculate the distance from each point in the non-planar set to the fitted plane, i.e. If the distance from a point in the non-planar point set to the fitted plane is less than a third preset distance, then the point is finally determined to be a planar point and added to the planar point set to obtain the final planar point set and non-planar point set.

[0053] In one optional embodiment, a raster map is established based on the target point cloud, including: determining the raster size corresponding to each raster in the raster map; determining the number of rows and columns of the raster map; constructing the raster map based on the target point cloud, raster size, number of rows, and number of columns, wherein each raster in the raster map corresponds to a set of raster indices, and the raster indices include row indices and column indices. Based on the planar point cloud set and the non-planar point cloud set, the raster map is divided into a ground raster map and a non-ground raster map, including: initializing the attributes of all raster cells in the raster map to a first attribute; if it is determined that the target point cloud contained in a raster cell belongs to the planar point cloud set, the raster is determined to be a ground raster map, and the raster's attribute is determined to be a second attribute; if it is determined that the target point cloud contained in a raster cell belongs to the non-planar point cloud set, the raster is determined to be a non-ground raster map, and the raster's attribute is determined to be a third attribute, wherein the raster map division diagram is shown below. Figure 3 As shown, the raster map is divided into non-ground raster maps and ground raster maps.

[0054] As described above, the number of rows and columns of the raster are set, and the raster size is set to `grid_size`. First, the attributes corresponding to all grids in the raster map are initialized to 0, with 0 being the first attribute. The grid attribute `is_groud` is set to determine whether a grid belongs to the ground grid, and the grid to which a point belongs is determined based on the coordinates of a point in the point cloud. If the row index of the grid is `i`, the column index is `j`, and... Then the grid index corresponding to that point is obtained. If the point does not belong to the planar point, its grid attribute `is_groud` is set to -1; otherwise, it is set to 1. Simultaneously, the maximum value Z in the height direction of the point cloud falling within each grid is recorded. max With minimum value Z min In this way, the point cloud is represented in a raster form.

[0055] In one optional embodiment, an eight-neighbor search method is used to traverse each grid in the non-ground grid map to determine multiple target grids corresponding to the road edge. This includes: determining whether there is a grid that meets preset conditions among the eight neighbor grids corresponding to the first grid, where the first grid is any grid in the non-ground grid map; if there is a grid that meets the preset conditions, the first grid is determined as the target grid. The initial attribute of all graticles in the raster map is the first attribute, the attribute of graticles in the ground raster map is the second attribute, and the attribute of graticles in the non-ground raster map is the third attribute. An eight-neighborhood search is used to determine whether there exists a graticle that meets preset conditions in the eight-neighborhood corresponding to the first graticle. This includes: determining the target distance between the first graticle and the origin of the 3D coordinate system, where the 3D coordinate system is the coordinate system corresponding to the target point cloud projection; if there is a graticle with the second attribute in the eight-neighborhood corresponding to the first graticle, then there exists a graticle that meets preset conditions in the eight-neighborhood; or, if there is a graticle with the first attribute in the eight-neighborhood corresponding to the first graticle and the target distance is greater than a distance threshold, then there exists a graticle that meets preset conditions in the eight-neighborhood.

[0056] The above describes the process of scanning each row and column of the raster map. The distance *d* from the raster to the origin of the 3D coordinate system is calculated based on the index and raster size. The attributes of the current raster are determined. If the current raster's attribute *is_groud* equals -1, meaning the current raster does not belong to the ground, a search is performed within its eight neighborhoods. If one of the eight neighborhoods contains a raster with an attribute *is_groud* equal to 1, or *is_groud* equal to 0 (default is 0), and the distance *d* from the raster to the origin is greater than a set threshold, the current raster is considered a road boundary, and its center point is used as the coordinate point. The raster index is saved to the queue storing road boundaries, and the raster is marked as having been searched. Figure 4 This is a diagram illustrating an eight-neighbor search, as shown below. Figure 4 As shown.

[0057] It should be noted that, under normal circumstances, the origin of the three-dimensional coordinate system is the installation location of the lidar.

[0058] During the aforementioned raster traversal process, if a raster has already been marked as searched, it will not be repeatedly evaluated during the eight-neighbor search, thus effectively reducing computational load. The point cloud rasterization method proposed in this application innovatively transforms the road edge detection problem of point clouds into a boundary search problem based on a raster map by performing an eight-neighbor search on the raster. This effectively reduces computational load. Furthermore, unlike related technologies that can only detect the left and right road edges, the method proposed in this invention can detect all road boundaries in the current environment.

[0059] In one optional embodiment, determining the road edge based on multiple target gratings includes: determining multiple grating indices corresponding to each target grating, wherein the grating index includes a row index and a column index, the grating index is used to locate the target grating, and the grating index corresponds one-to-one with the target grating; storing the multiple grating indices in a target queue, and clustering the multiple target gratings in the target queue using the DBSCAN algorithm to obtain multiple clusters; fitting the coordinates of all gratings contained in the multiple clusters using a random sampling consensus algorithm combined with the least squares method to obtain a target curve; determining the shape corresponding to the target curve as the shape corresponding to the road edge to obtain the road edge. After an eight-neighborhood search, all road edge grating indices are stored in a queue, and the DBSCAN algorithm is used to cluster the grating points in the queue. The clustering radius R and the minimum number of cluster members N are set to obtain multiple clusters, such as... Figure 5 As shown, Figure 5 This is a schematic diagram of the candidate roadside grids obtained after clustering. If the number of members in a cluster is less than a set threshold N, the cluster is considered to be laser noise or a non-roadside point, and curve fitting is not performed. Figure 5 In this context, the cluster containing cluster member 3 can be considered as the cluster corresponding to the non-road edge.

[0060] Furthermore, multiple target rasters in the target queue are clustered using a random sample consensus algorithm to obtain multiple clusters. This includes: determining the cluster radius and the preset number of cluster members; using the DBSCAN algorithm, clustering the target queue according to the cluster radius to obtain multiple initial clusters; determining the number of target rasters contained in each initial cluster; and removing initial clusters with fewer rasters than the preset number of cluster members to obtain multiple clusters. The target curve is obtained by fitting the coordinates of all rasters contained in the multiple clusters using a combination of the random sample consensus algorithm and the least squares method. This includes: determining multiple sample target point clouds contained in the clusters; determining multiple sets of parameters based on the sample target point clouds, where these multiple sets of parameters are the parameters corresponding to the fitting curve equation of the least squares method; determining multiple fitting curves based on the multiple sets of parameters and the fitting curve equation; and determining the fitting curve that meets the fitting conditions as the target curve.

[0061] As mentioned above, the fitting condition is that the fitted curve corresponds to the most inliers, and inliers are point clouds whose distance from the fitted curve is less than or equal to a threshold distance. A method combining Random Sample Consensus (RANSAC) and least squares is used to perform cubic curve fitting on all grid coordinates in the cluster. Specifically, four point clouds from the cluster are selected, and a curve is fitted using these four points. The distances of all other point clouds from the fitted curve are calculated. If a point cloud's distance from the fitted curve is less than or equal to the threshold distance, it is determined to be an inlier; otherwise, it is an outlier.

[0062] Specifically, the maximum number of iterations N in the random sample consensus algorithm is set. max And the distance threshold sigma, to determine the equation y=ax of the fitted curve. 3 +bx 2 Therefore, before determining the curve, four parameters (abcd) are needed. N sample points are selected, and the least squares method is used to determine the four parameters (abcd) required for the fitting equation. Based on the curve model parameters and the distance threshold sigma, the interior and exterior points of the curve model are calculated. This process is repeated until the number of iterations reaches a set threshold. The curve model with the most interior points during the iteration process is determined as the equation corresponding to the final fitted curve, and the fitting result is determined as the target curve. This target curve is the shape curve corresponding to the road edge, specifically as follows: Figure 6 As shown, Figure 6 This diagram illustrates the road edge fitting results provided in this application, clearly showing the road edge. This method effectively eliminates the influence of outliers on the fitting equation, improving the accuracy of curve fitting.

[0063] This application provides a road edge detection method based on LiDAR, which eliminates the need for prior collection of massive amounts of data for manual annotation and training, thus broadening its application scope and reducing computational requirements. Furthermore, compared to visual road edge detection, it effectively overcomes the influence of lighting variations and shadow occlusion. While visual detection, after identifying road boundaries in an image, requires converting pixel coordinates into 3D coordinates in the physical world based on calibration relationships, this conversion often introduces significant errors. LiDAR detection, however, is applicable in all weather conditions and scenarios, unaffected by lighting or weather factors. Moreover, LiDAR ranging accuracy reaches the centimeter level, ensuring high precision in detecting road boundaries. The proposed eight-neighborhood road edge detection method based on a raster map transforms the point cloud-based road edge extraction process into a raster map-based boundary search process, effectively reducing the computational consumption caused by processing large amounts of point cloud data. The DBSCAN method is used to cluster candidate road edge points, separating multiple road edges in the current environment from the candidate points. It also effectively removes outliers, which may be laser noise or non-critical points that affect curve accuracy. By using Random Sample Consensus (RANSAC) combined with the least squares method to perform curve fitting on each cluster member, the influence of outliers can be further reduced and the accuracy of curve fitting can be improved.

[0064] It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions, and although a logical order is shown in the flowchart, in some cases the steps shown or described may be executed in a different order than that shown here.

[0065] This application also provides a LiDAR-based curb detection device. It should be noted that this LiDAR-based curb detection device can be used to execute the LiDAR-based curb detection method provided in this application. The following describes the LiDAR-based curb detection device provided in this application.

[0066] Figure 7 This is a schematic diagram of a curb detection device based on lidar according to an embodiment of this application. Figure 7As shown, the device includes: a first acquisition unit 701, used to acquire a target point cloud and determine a set of planar point clouds and a set of non-planar point clouds in the target point cloud, wherein the set of planar point clouds is the set of point clouds formed by the target point clouds corresponding to a first object in the current scene, and the set of non-planar point clouds is the set of point clouds formed by the target point clouds corresponding to a second object in the current scene, the first object is an object with a planar surface, and the second object is an object without a planar surface; a first establishment unit 702, used to establish a raster map based on the target point cloud and divide the raster map into a ground raster map and a non-ground raster map based on the set of planar point clouds and the set of non-planar point clouds; a first determination unit 703, used to traverse each grid in the non-ground raster map using an eight-neighbor search method to determine multiple target grids corresponding to the road edge; and a second determination unit 704, used to determine the road edge based on the multiple target grids.

[0067] Optionally, the first acquisition unit 701 includes: a first acquisition subunit for acquiring the original point cloud; a first preprocessing operation unit for performing preprocessing operations on the original point cloud to obtain a preprocessed point cloud; and a second preprocessing operation unit for processing the preprocessed point cloud by downsampling the point cloud voxels to obtain a target point cloud.

[0068] Optionally, the first preprocessing operation unit includes: a first determining subunit, used to determine whether there is a NaN value in the original point cloud, and if there is a NaN value in the original point cloud, to remove the NaN value to obtain a first point cloud; a projection subunit, used to project the first point cloud onto a three-dimensional coordinate system to obtain multiple three-dimensional coordinates corresponding to multiple first point clouds; and a second determining subunit, used to determine the preprocessed point cloud based on the multiple three-dimensional coordinates.

[0069] Optionally, the second determining subunit includes: a first determining module for determining the origin coordinates of the three-dimensional coordinate system; a second determining module for determining the distance between each first point cloud and the origin of the coordinate system based on the origin coordinates and multiple three-dimensional coordinates, to obtain multiple distances; a third determining module for determining a first preset distance, determining the first point cloud corresponding to the distance greater than the first preset distance among the multiple distances, and discarding the first point cloud to obtain a second point cloud; and a first discarding subunit for determining a first height threshold, determining the second point cloud whose vertical axis coordinate value is greater than the first height threshold, and discarding the second point cloud to obtain a preprocessed point cloud.

[0070] Optionally, the second preprocessing operation unit includes: a first processing subunit for dividing the preprocessed point cloud into multiple grids; a calculation subunit for determining all preprocessed point clouds contained in each grid and calculating the centroid value corresponding to each grid based on all preprocessed point clouds; and a replacement subunit for replacing all preprocessed point clouds contained in each grid with the centroid value corresponding to the grid to obtain the target point cloud.

[0071] Optionally, the first acquisition unit 701 includes: a third determining subunit, used to determine the maximum number of iterations corresponding to the random sampling consensus algorithm and multiple second preset distances, wherein each second preset distance is less than the second preset distance corresponding to the previous iteration process, and one iteration process corresponds to one second preset distance; a first extraction subunit, used to process the target point cloud and extract planar feature points contained in the target point cloud based on the first second preset distance; a division subunit, used to divide the target point cloud into a first planar point cloud set and a first non-planar point cloud set based on the planar feature points; a second extraction subunit, used to process the first non-planar point cloud set to extract planar feature points in the non-planar point cloud set based on the second preset distance; a processing subunit, used to process the non-planar point cloud set obtained in the previous iteration process multiple times based on the multiple second preset distances corresponding to the multiple iteration processes to obtain an initial planar point cloud set and an initial non-planar point cloud set; and a fourth determining subunit, used to determine the initial planar point cloud set and the initial non-planar point cloud set based on planar features.

[0072] Optionally, the fourth determining subunit includes: a fitting module for fitting the initial planar point cloud set into a plane; a fourth determining module for traversing each initial non-planar point cloud and determining the distance between each initial non-planar point cloud and the plane to obtain multiple distances; and a fifth determining module for determining a third preset distance, determining the initial non-planar point cloud corresponding to the distance less than the third preset distance among the multiple distances, and dividing the initial non-planar point cloud into the set of target point clouds to determine the planar point cloud set and the non-planar point cloud set.

[0073] Optionally, the first establishing unit 702 includes: a fifth determining subunit, used to determine the grid size corresponding to each grid in the grid map; a sixth determining subunit, used to determine the number of rows and columns of the grids contained in the grid map; and a constructing subunit, used to construct the grid map based on the target point cloud, grid size, number of rows and number of columns, wherein each grid in the grid map corresponds to a set of grid indices, and the grid indices include row indices and column indices.

[0074] Optionally, the first establishment unit 702 includes: an initialization subunit, used to initialize the attributes of all grates contained in the raster map as first attributes; a seventh determination subunit, used to determine that the raster is a ground raster map and determine the attributes of the raster as second attributes when the target point cloud contained in the raster in the raster map belongs to a set of planar point clouds; and an eighth determination subunit, used to determine that the raster is a non-ground raster map and determine the attributes of the raster as third attributes when the target point cloud contained in the raster belongs to a set of non-planar point clouds.

[0075] Optionally, the first determining unit 703 includes: a ninth determining subunit, used to determine whether there is a grid that meets preset conditions among the eight neighboring grids corresponding to the first grid through an eight-neighbor search, wherein the first grid is any grid in a non-ground grid map; and a tenth determining subunit, used to determine the first grid as the target grid if there is a grid that meets the preset conditions.

[0076] Optionally, the initial attribute of all grates in the raster map is the first attribute, the attribute of grates in the ground raster map is the second attribute, and the attribute of grates in the non-ground raster map is the third attribute. The ninth determining sub-unit includes: an eleventh determining sub-unit, used to determine the target distance between the first grate and the origin of the three-dimensional coordinate system, wherein the three-dimensional coordinate system is the coordinate system corresponding to the target point cloud projection; a twelfth determining sub-unit, used to determine that there is a grate in the eight neighboring grates that meets the preset conditions if there is a grate with the second attribute in the eight neighboring grates corresponding to the first grate; or, a thirteenth determining sub-unit, used to determine that there is a grate in the eight neighboring grates that meets the preset conditions if there is a grate with the first attribute in the eight neighboring grates corresponding to the first grate and the target distance is greater than the distance threshold.

[0077] Optionally, the second determining unit 704 includes: a fourteenth determining subunit, used to determine multiple raster indices corresponding to each target raster, wherein the raster index includes a row index and a column index, the raster index is used to locate the target raster, and the raster index corresponds one-to-one with the target raster; a storage subunit, used to store the multiple raster indices in a target queue, and to cluster the multiple target rasteres in the target queue using the DBSCAN algorithm to obtain multiple clusters; a fitting subunit, used to fit the coordinates of all rasteres contained in the multiple clusters using a random sampling consensus algorithm combined with the least squares method to obtain the target curve; and a fifteenth determining subunit, used to determine the shape corresponding to the target curve as the shape corresponding to the road edge, so as to obtain the road edge.

[0078] Optionally, the storage subunit includes: a sixteenth determining subunit, used to determine the clustering radius and the preset number of cluster members; a clustering subunit, used to cluster the target queue according to the clustering radius using the DBSCAN algorithm to obtain multiple initial clusters; a seventeenth determining subunit, used to determine the number of target grids contained in each initial cluster; and a second elimination subunit, used to eliminate initial clusters with fewer grids than the preset number of cluster members to obtain multiple clusters.

[0079] Optionally, the fitting subunit includes: an eighteenth determining subunit for determining multiple sample target point clouds contained in the cluster; a nineteenth determining subunit for determining multiple sets of parameters based on the sample target point clouds, wherein the multiple sets of parameters are multiple sets of parameters corresponding to the fitting curve equation of the least squares method; a twentieth determining subunit for determining multiple fitting curves based on the multiple sets of parameters and the fitting curve equation; and a twenty-first determining subunit for determining the fitting curve that meets the fitting conditions, which is the target curve.

[0080] Optionally, the fitting condition is that the fitted curve has the most inliers, and the inliers are the target point clouds whose distance from the fitted curve is less than or equal to a distance threshold.

[0081] A curb detection device based on lidar includes a processor and a memory. The aforementioned first acquisition unit 701 and others are stored in the memory as program units, and the processor executes the aforementioned program units stored in the memory to realize the corresponding functions.

[0082] The processor contains a kernel, which retrieves the corresponding program unit from memory. One or more kernels can be configured, and adjusting kernel parameters can address the technical problems of significant deviations and slow computation speed in road edge detection in related technologies.

[0083] The memory may include non-permanent memory in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM, and the memory includes at least one memory chip.

[0084] This invention provides a computer-readable storage medium storing a program that, when executed by a processor, implements a roadside detection method based on lidar.

[0085] This invention provides a processor for running a program, wherein the program executes a roadside detection method based on lidar.

[0086] This invention provides a vehicle comprising a lidar and a lidar-based curb detection device, the lidar-based curb detection device being used to perform a lidar-based curb detection method.

[0087] This invention provides a device including a processor, a memory, and a program stored in the memory and executable on the processor. When the processor executes the program, it performs at least the following steps: acquiring a target point cloud and determining a set of planar point clouds and a set of non-planar point clouds within the target point cloud, wherein the set of planar point clouds is the point cloud set composed of target point clouds corresponding to a first object in the current scene, and the set of non-planar point clouds is the point cloud set composed of target point clouds corresponding to a second object in the current scene; the first object is an object with a planar surface, and the second object is an object without a planar surface; establishing a raster map based on the target point cloud, and dividing the raster map into a ground raster map and a non-ground raster map based on the set of planar point clouds and the set of non-planar point clouds; traversing each grid cell in the non-ground raster map using an eight-neighborhood search method to determine multiple target grid cells corresponding to a road edge; and determining the road edge based on the multiple target grid cells.

[0088] Optionally, acquiring the target point cloud includes: acquiring the original point cloud; performing preprocessing operations on the original point cloud to obtain a preprocessed point cloud; and processing the preprocessed point cloud by voxel downsampling to obtain the target point cloud.

[0089] Optionally, a preprocessing operation is performed on the original point cloud to obtain a preprocessed point cloud, including: determining whether there is a NaN value in the original point cloud; if there is a NaN value in the original point cloud, removing the NaN value to obtain a first point cloud; projecting the first point cloud onto a three-dimensional coordinate system to obtain multiple three-dimensional coordinates corresponding to multiple first point clouds; and determining the preprocessed point cloud based on the multiple three-dimensional coordinates.

[0090] Optionally, the preprocessed point cloud is determined based on multiple three-dimensional coordinates, including: determining the origin coordinates of the three-dimensional coordinate system; determining the distance between each first point cloud and the origin of the coordinate system based on the origin coordinates and multiple three-dimensional coordinates to obtain multiple distances; determining a first preset distance, determining the first point cloud corresponding to the distance greater than the first preset distance among the multiple distances, and discarding the first point cloud to obtain a second point cloud; determining a first height threshold, and determining the second point cloud whose vertical axis coordinate value is greater than the first height threshold, and discarding the second point cloud to obtain the preprocessed point cloud.

[0091] Optionally, the preprocessed point cloud is processed by voxel downsampling to obtain the target point cloud, including: dividing the preprocessed point cloud into multiple grids; determining all preprocessed point clouds contained in each grid; calculating the centroid value corresponding to each grid based on all preprocessed point clouds; and replacing all preprocessed point clouds contained in each grid with the centroid value corresponding to the grid to obtain the target point cloud.

[0092] Optionally, determining the planar point cloud set and the non-planar point cloud set in the target point cloud includes: determining the maximum number of iterations corresponding to the random sampling consensus algorithm and multiple second preset distances, wherein each second preset distance is less than the second preset distance corresponding to the previous iteration process, and one iteration process corresponds to one second preset distance; processing the target point cloud and extracting planar feature points contained in the target point cloud based on the first second preset distance; dividing the target point cloud into a first planar point cloud set and a first non-planar point cloud set based on the planar feature points; processing the first non-planar point cloud set to extract planar feature points in the non-planar point cloud set based on the second preset distance; processing the non-planar point cloud set obtained in the previous iteration process multiple times based on the multiple second preset distances corresponding to the multiple iteration processes to obtain an initial planar point cloud set and an initial non-planar point cloud set; and determining the planar point cloud set and the non-planar point cloud set based on the initial planar point cloud set and the initial non-planar point cloud set.

[0093] Optionally, determining the planar point cloud set and the non-planar point cloud set based on the initial planar point cloud set and the initial non-planar point cloud set includes: fitting the initial planar point cloud set into a plane; traversing each initial non-planar point cloud and determining the distance between each initial non-planar point cloud and the plane to obtain multiple distances; determining a third preset distance, and determining the initial non-planar point cloud corresponding to the distance less than the third preset distance among the multiple distances, and dividing the initial non-planar point cloud into the set of target point clouds to determine the planar point cloud set and the non-planar point cloud set.

[0094] Optionally, a raster map is established based on the target point cloud, including: determining the size of each raster in the raster map; determining the number of rows and columns of the raster map; and constructing the raster map based on the target point cloud, the raster size, the number of rows and columns, wherein each raster in the raster map corresponds to a set of raster indexes, and the raster indexes include row indexes and column indexes.

[0095] Optionally, based on the planar point cloud set and the non-planar point cloud set, the raster map is divided into a ground raster map and a non-ground raster map, including: initializing the attributes of all grates contained in the raster map as the first attribute; if it is determined that the target point cloud contained in the raster in the raster map belongs to the planar point cloud set, the raster is determined to be a ground raster map and the attribute of the raster is determined to be the second attribute; if it is determined that the target point cloud contained in the raster belongs to the non-planar point cloud set, the raster is determined to be a non-ground raster map and the attribute of the raster is determined to be the third attribute.

[0096] Optionally, the eight-neighbor search method is used to traverse each grid in the non-ground grid map to determine multiple target grids corresponding to the road edge. This includes: determining whether there is a grid that meets preset conditions in the eight neighbor grids corresponding to the first grid, where the first grid is any grid in the non-ground grid map; if there is a grid that meets the preset conditions, the first grid is determined as the target grid.

[0097] Optionally, the initial attribute of all graticles in the raster map is the first attribute, the attribute of graticles in the ground raster map is the second attribute, and the attribute of graticles in the non-ground raster map is the third attribute. An eight-neighborhood search is used to determine whether there exists a graticle that meets preset conditions in the eight-neighborhood corresponding to the first graticle. This includes: determining the target distance between the first graticle and the origin of the three-dimensional coordinate system, where the three-dimensional coordinate system is the coordinate system corresponding to the target point cloud projection; if there is a graticle with the second attribute in the eight-neighborhood graticles corresponding to the first graticle, then the existence of a graticle that meets preset conditions in the eight-neighborhood graticles is determined; or, if there is a graticle with the first attribute in the eight-neighborhood graticles corresponding to the first graticle and the target distance is greater than a distance threshold, then the existence of a graticle that meets preset conditions in the eight-neighborhood graticles is determined.

[0098] Optionally, determining the road edge based on multiple target rasters includes: determining multiple raster indices corresponding to each target raster, wherein the raster index includes a row index and a column index, the raster index is used to locate the target raster, and the raster index corresponds one-to-one with the target raster; storing the multiple raster indices in a target queue, and clustering the multiple target rasters in the target queue using the DBSCAN algorithm to obtain multiple clusters; fitting the coordinates of all rasteres contained in the multiple clusters using a random sampling consensus algorithm combined with the least squares method to obtain the target curve; and determining the shape corresponding to the target curve as the shape corresponding to the road edge to obtain the road edge.

[0099] Optionally, multiple target rasters in the target queue are clustered using a random sampling consensus algorithm to obtain multiple clusters, including: determining the cluster radius and the preset number of cluster members; using the DBSCAN algorithm to cluster the target queue according to the cluster radius to obtain multiple initial clusters; determining the number of target rasters contained in each initial cluster; and removing initial clusters with fewer than the preset number of cluster members to obtain multiple clusters.

[0100] Optionally, the target curve is obtained by fitting all grid coordinates contained in multiple clusters using a random sampling consensus algorithm combined with the least squares method. This includes: determining multiple sample target point clouds contained in the clusters; determining multiple sets of parameters based on the sample target point clouds, wherein the multiple sets of parameters are the multiple sets of parameters corresponding to the fitting curve equation of the least squares method; determining multiple fitting curves based on the multiple sets of parameters and the fitting curve equation; and determining the fitting curve that meets the fitting conditions as the target curve.

[0101] Optionally, the fitting condition is that the fitted curve has the most inliers, where inliers are target point clouds whose distance from the fitted curve is less than or equal to a distance threshold. The devices mentioned in this paper can be servers, PCs, tablets, mobile phones, etc.

[0102] This application also provides a computer program product, which, when executed on a data processing device, is suitable for executing an initialization program having at least the following method steps: acquiring a target point cloud, and determining a set of planar point clouds and a set of non-planar point clouds in the target point cloud, wherein the set of planar point clouds is the point cloud set composed of the target point clouds corresponding to a first object in the current scene, and the set of non-planar point clouds is the point cloud set composed of the target point clouds corresponding to a second object in the current scene, the first object being an object with a planar surface, and the second object being an object without a planar surface; establishing a raster map based on the target point cloud, and dividing the raster map into a ground raster map and a non-ground raster map based on the set of planar point clouds and the set of non-planar point clouds; traversing each grid in the non-ground raster map using an eight-neighborhood search method to determine multiple target grids corresponding to the road edge; and determining the road edge based on the multiple target grids.

[0103] Optionally, acquiring the target point cloud includes: acquiring the original point cloud; performing preprocessing operations on the original point cloud to obtain a preprocessed point cloud; and processing the preprocessed point cloud by voxel downsampling to obtain the target point cloud.

[0104] Optionally, a preprocessing operation is performed on the original point cloud to obtain a preprocessed point cloud, including: determining whether there is a NaN value in the original point cloud; if there is a NaN value in the original point cloud, removing the NaN value to obtain a first point cloud; projecting the first point cloud onto a three-dimensional coordinate system to obtain multiple three-dimensional coordinates corresponding to multiple first point clouds; and determining the preprocessed point cloud based on the multiple three-dimensional coordinates.

[0105] Optionally, the preprocessed point cloud is determined based on multiple three-dimensional coordinates, including: determining the origin coordinates of the three-dimensional coordinate system; determining the distance between each first point cloud and the origin of the coordinate system based on the origin coordinates and multiple three-dimensional coordinates to obtain multiple distances; determining a first preset distance, determining the first point cloud corresponding to the distance greater than the first preset distance among the multiple distances, and discarding the first point cloud to obtain a second point cloud; determining a first height threshold, and determining the second point cloud whose vertical axis coordinate value is greater than the first height threshold, and discarding the second point cloud to obtain the preprocessed point cloud.

[0106] Optionally, the preprocessed point cloud is processed by voxel downsampling to obtain the target point cloud, including: dividing the preprocessed point cloud into multiple grids; determining all preprocessed point clouds contained in each grid; calculating the centroid value corresponding to each grid based on all preprocessed point clouds; and replacing all preprocessed point clouds contained in each grid with the centroid value corresponding to the grid to obtain the target point cloud.

[0107] Optionally, determining the planar point cloud set and the non-planar point cloud set in the target point cloud includes: determining the maximum number of iterations corresponding to the random sampling consensus algorithm and multiple second preset distances, wherein each second preset distance is less than the second preset distance corresponding to the previous iteration process, and one iteration process corresponds to one second preset distance; processing the target point cloud and extracting planar feature points contained in the target point cloud based on the first second preset distance; dividing the target point cloud into a first planar point cloud set and a first non-planar point cloud set based on the planar feature points; processing the first non-planar point cloud set to extract planar feature points in the non-planar point cloud set based on the second preset distance; processing the non-planar point cloud set obtained in the previous iteration process multiple times based on the multiple second preset distances corresponding to the multiple iteration processes to obtain an initial planar point cloud set and an initial non-planar point cloud set; and determining the planar point cloud set and the non-planar point cloud set based on the initial planar point cloud set and the initial non-planar point cloud set.

[0108] Optionally, determining the planar point cloud set and the non-planar point cloud set based on the initial planar point cloud set and the initial non-planar point cloud set includes: fitting the initial planar point cloud set into a plane; traversing each initial non-planar point cloud and determining the distance between each initial non-planar point cloud and the plane to obtain multiple distances; determining a third preset distance, and determining the initial non-planar point cloud corresponding to the distance less than the third preset distance among the multiple distances, and dividing the initial non-planar point cloud into the set of target point clouds to determine the planar point cloud set and the non-planar point cloud set.

[0109] Optionally, a raster map is established based on the target point cloud, including: determining the size of each raster in the raster map; determining the number of rows and columns of the raster map; and constructing the raster map based on the target point cloud, the raster size, the number of rows and columns, wherein each raster in the raster map corresponds to a set of raster indexes, and the raster indexes include row indexes and column indexes.

[0110] Optionally, based on the planar point cloud set and the non-planar point cloud set, the raster map is divided into a ground raster map and a non-ground raster map, including: initializing the attributes of all grates contained in the raster map as the first attribute; if it is determined that the target point cloud contained in the raster in the raster map belongs to the planar point cloud set, the raster is determined to be a ground raster map and the attribute of the raster is determined to be the second attribute; if it is determined that the target point cloud contained in the raster belongs to the non-planar point cloud set, the raster is determined to be a non-ground raster map and the attribute of the raster is determined to be the third attribute.

[0111] Optionally, the eight-neighbor search method is used to traverse each grid in the non-ground grid map to determine multiple target grids corresponding to the road edge. This includes: determining whether there is a grid that meets preset conditions in the eight neighbor grids corresponding to the first grid, where the first grid is any grid in the non-ground grid map; if there is a grid that meets the preset conditions, the first grid is determined as the target grid.

[0112] Optionally, the initial attribute of all graticles in the raster map is the first attribute, the attribute of graticles in the ground raster map is the second attribute, and the attribute of graticles in the non-ground raster map is the third attribute. An eight-neighborhood search is used to determine whether there exists a graticle that meets preset conditions in the eight-neighborhood corresponding to the first graticle. This includes: determining the target distance between the first graticle and the origin of the three-dimensional coordinate system, where the three-dimensional coordinate system is the coordinate system corresponding to the target point cloud projection; if there is a graticle with the second attribute in the eight-neighborhood graticles corresponding to the first graticle, then the existence of a graticle that meets preset conditions in the eight-neighborhood graticles is determined; or, if there is a graticle with the first attribute in the eight-neighborhood graticles corresponding to the first graticle and the target distance is greater than a distance threshold, then the existence of a graticle that meets preset conditions in the eight-neighborhood graticles is determined.

[0113] Optionally, determining the road edge based on multiple target rasters includes: determining multiple raster indices corresponding to each target raster, wherein the raster index includes a row index and a column index, the raster index is used to locate the target raster, and the raster index corresponds one-to-one with the target raster; storing the multiple raster indices in a target queue, and clustering the multiple target rasters in the target queue using the DBSCAN algorithm to obtain multiple clusters; fitting the coordinates of all rasteres contained in the multiple clusters using a random sampling consensus algorithm combined with the least squares method to obtain the target curve; and determining the shape corresponding to the target curve as the shape corresponding to the road edge to obtain the road edge.

[0114] Optionally, multiple target rasters in the target queue are clustered using a random sampling consensus algorithm to obtain multiple clusters, including: determining the cluster radius and the preset number of cluster members; using the DBSCAN algorithm to cluster the target queue according to the cluster radius to obtain multiple initial clusters; determining the number of target rasters contained in each initial cluster; and removing initial clusters with fewer than the preset number of cluster members to obtain multiple clusters.

[0115] Optionally, the target curve is obtained by fitting all grid coordinates contained in multiple clusters using a random sampling consensus algorithm combined with the least squares method. This includes: determining multiple sample target point clouds contained in the clusters; determining multiple sets of parameters based on the sample target point clouds, wherein the multiple sets of parameters are the multiple sets of parameters corresponding to the fitting curve equation of the least squares method; determining multiple fitting curves based on the multiple sets of parameters and the fitting curve equation; and determining the fitting curve that meets the fitting conditions as the target curve.

[0116] Optionally, the fitting condition is that the fitted curve has the most inliers, and the inliers are the target point clouds whose distance from the fitted curve is less than or equal to a distance threshold.

[0117] In the above embodiments of the present invention, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions of other embodiments.

[0118] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. The device embodiments described above are merely illustrative; for example, the division of units can be a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the displayed or discussed mutual couplings, direct couplings, or communication connections may be through some interfaces; indirect couplings or communication connections between units or modules may be electrical or other forms.

[0119] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0120] Furthermore, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.

[0121] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, read-only memory (ROM), random access memory (RAM), portable hard drives, magnetic disks, or optical disks.

[0122] As can be seen from the above description, the embodiments of this application achieve the following technical effects:

[0123] 1) The method provided in this application does not require prior collection of massive amounts of data for manual annotation and training, making it more widely applicable and requiring less computing power. Furthermore, compared to visual road edge detection, it effectively overcomes the effects of lighting changes and shadow occlusion. Additionally, after detecting road boundaries in an image, visual detection requires converting pixel coordinates into three-dimensional coordinates in the physical world based on calibration relationships; this conversion often introduces significant errors. Laser detection, on the other hand, is applicable in all weather conditions and scenarios, unaffected by lighting or weather factors.

[0124] 2) Laser ranging accuracy reaches the centimeter level, ensuring high precision in detecting road boundaries. The proposed eight-neighborhood road edge detection method based on a raster map transforms the point cloud-based road edge extraction process into a raster map-based boundary search process, effectively reducing the computational cost of processing large amounts of point cloud data. The DBSCAN method is used to cluster candidate road edge points, separating multiple road edges in the current environment from the candidate point set. Outliers, which may be laser noise or non-critical points, can effectively be removed, affecting curve fitting. Random Sample Consensus (RANSAC) combined with the least squares method is used for curve fitting of each cluster member, further reducing the influence of outliers and improving curve fitting accuracy.

[0125] The above description is merely a preferred embodiment of this application and is not intended to limit this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the protection scope of this application.

Claims

1. A road edge detection method based on lidar, characterized in that, include: Obtain the target point cloud and determine the planar point cloud set and the non-planar point cloud set in the target point cloud, wherein the planar point cloud set is the point cloud set formed by the target point cloud corresponding to the first object in the current scene, and the non-planar point cloud set is the point cloud set formed by the target point cloud corresponding to the second object in the current scene, wherein the first object is an object with a planar surface, and the second object is an object without a planar surface; Based on the target point cloud, a raster map is established, and based on the planar point cloud set and the non-planar point cloud set, the raster map is divided into a ground raster map and a non-ground raster map. The eight-neighbor search method is used to traverse each grid in the non-ground grid map to determine multiple target grids corresponding to the road edge; The road edge is determined based on multiple target grids; Determining the planar point cloud set and the non-planar point cloud set in the target point cloud includes: determining the maximum number of iterations corresponding to the random sampling consensus algorithm and multiple second preset distances, wherein each second preset distance is less than the second preset distance corresponding to the previous iteration process, and one iteration process corresponds to one second preset distance; processing the target point cloud and extracting planar feature points contained in the target point cloud based on the first second preset distance; dividing the target point cloud into a first planar point cloud set and a first non-planar point cloud set based on the planar feature points; processing the first non-planar point cloud set to extract the planar feature points in the non-planar point cloud set based on the second preset distance; processing the non-planar point cloud set obtained in the previous iteration process multiple times based on the multiple second preset distances corresponding to the multiple iteration processes to obtain an initial planar point cloud set and an initial non-planar point cloud set; and determining the planar point cloud set and the non-planar point cloud set based on the initial planar point cloud set and the initial non-planar point cloud set.

2. The method according to claim 1, characterized in that, Obtain the target point cloud, including: Obtain the original point cloud; The original point cloud is preprocessed to obtain a preprocessed point cloud; The preprocessed point cloud is processed by voxel downsampling to obtain the target point cloud.

3. The method according to claim 2, characterized in that, Preprocessing the original point cloud to obtain a preprocessed point cloud includes: Determine whether there is a NaN value in the original point cloud. If the NaN value exists in the original point cloud, remove the NaN value to obtain the first point cloud. The first point cloud is projected onto a three-dimensional coordinate system to obtain multiple three-dimensional coordinates corresponding to the first point cloud; The preprocessed point cloud is determined based on multiple three-dimensional coordinates.

4. The method according to claim 3, characterized in that, Determining the preprocessed point cloud based on multiple three-dimensional coordinates includes: Determine the coordinates of the origin of the three-dimensional coordinate system; Based on the origin coordinates and multiple three-dimensional coordinates, the distance between each first point cloud and the origin of the coordinate system is determined to obtain multiple distances; A first preset distance is determined, and the first point cloud corresponding to the distance greater than the first preset distance among the plurality of distances is determined and the first point cloud is removed to obtain a second point cloud; A first height threshold is determined, and a second point cloud with a vertical axis coordinate value greater than the first height threshold is identified. The second point cloud is then discarded to obtain the preprocessed point cloud.

5. The method according to claim 2, characterized in that, The preprocessed point cloud is processed by voxel downsampling to obtain the target point cloud, including: The preprocessed point cloud is divided into multiple grids; Determine all the preprocessed point clouds contained in each grid, and calculate the centroid value corresponding to each grid based on all the preprocessed point clouds; The preprocessed point cloud contained in each grid is replaced with the centroid value corresponding to the grid to obtain the target point cloud.

6. The method according to claim 5, characterized in that, Determining the planar point cloud set and the non-planar point cloud set based on the initial planar point cloud set includes: Fit the initial set of planar point clouds into a plane; Traverse each of the initial non-planar point clouds and determine the distance between each of the initial non-planar point clouds and the plane to obtain multiple distances; A third preset distance is determined, and the initial non-planar point cloud corresponding to the distances smaller than the third preset distance among a plurality of distances is determined. The initial non-planar point cloud is then divided into the set of the target point cloud to determine the planar point cloud set and the non-planar point cloud set.

7. The method according to claim 1, characterized in that, Based on the target point cloud, a raster map is constructed, including: Determine the grid size corresponding to each grid in the grid map; Determine the number of rows and columns of the grid cells contained in the grid map; Based on the target point cloud, the grid size, the number of rows, and the number of columns, a grid map is constructed, wherein each grid in the grid map corresponds to a set of grid indices, and the grid indices include row indices and column indices.

8. The method according to claim 7, characterized in that, Based on the planar point cloud set and the non-planar point cloud set, the raster map is divided into a ground raster map and a non-ground raster map, including: Initialize the attributes of all the graticles contained in the raster map to the first attribute; If it is determined that the target point cloud contained in the grid in the grid map belongs to the planar point cloud set, the grid is determined to be the ground grid map, and the attribute of the grid is determined as the second attribute; If it is determined that the target point cloud contained in the grid belongs to the non-planar point cloud set, the grid is determined to be the non-terrestrial grid map, and the attribute of the grid is determined to be the third attribute.

9. The method according to claim 1, characterized in that, Using an eight-neighbor search method, each grid cell in the non-ground grid map is traversed to determine multiple target grid cells corresponding to the road edge, including: The eight-neighbor search determines whether there is a grid that meets the preset conditions in the eight neighbor grids corresponding to the first grid, where the first grid is any grid in the non-ground grid map. If a grid that meets the preset conditions exists, the first grid is determined to be the target grid.

10. The method according to claim 9, characterized in that, The initial attribute of all graticles in the raster map is a first attribute, the attribute of graticles in the ground raster map is a second attribute, and the attribute of graticles in the non-ground raster map is a third attribute. The eight-neighbor search determines whether there exists a graticle that meets preset conditions in the eight-neighbor area corresponding to the first graticle, including: Determine the target distance between the first grid and the origin of the three-dimensional coordinate system, wherein the three-dimensional coordinate system is the coordinate system corresponding to the projection of the target point cloud; If, in the eight neighboring grids corresponding to the first grid, there exists a grid with the attribute of the second attribute, then it is determined that there exists a grid in the eight neighboring grids that meets the preset condition; or, If, among the eight neighboring grids corresponding to the first grid, there exists a grid with the attribute being the first attribute and the target distance being greater than a distance threshold, it is determined that there exists a grid in the eight neighboring grids that meets the preset conditions.

11. The method according to claim 1, characterized in that, Determining the road edge based on multiple target grids includes: Determine multiple raster indices corresponding to each target raster, wherein each raster index includes a row index and a column index, the raster index is used to locate the target raster, and the raster index corresponds one-to-one with the target raster; Multiple raster indexes are stored in a target queue, and the multiple target rasters in the target queue are clustered using the DBSCAN algorithm to obtain multiple clusters; The target curve is obtained by fitting all grid coordinates contained in multiple clusters using a random sampling consensus algorithm combined with the least squares method. The shape corresponding to the target curve is determined as the shape corresponding to the road edge, so as to obtain the road edge.

12. The method according to claim 11, characterized in that, The DBSCAN algorithm is used to cluster multiple target grids in the target queue to obtain multiple clusters, including: Determine the cluster radius and the preset number of cluster members; The target queue is clustered using the DBSCAN algorithm based on the clustering radius to obtain multiple initial clusters. Determine the number of target grid cells contained in each initial cluster; The initial clusters with fewer grid cells than the preset number of cluster members are removed to obtain multiple clusters.

13. The method according to claim 11, characterized in that, The target curve is obtained by fitting all grid coordinates contained in multiple clusters using a random sampling consensus algorithm combined with the least squares method, including: Determine the target point cloud of multiple samples contained in the cluster; Based on the sample target point cloud, multiple sets of parameters are determined, wherein the multiple sets of parameters are the multiple sets of parameters corresponding to the fitting curve equation of the least squares method; Based on the multiple sets of parameters and the fitted curve equations, multiple fitted curves are determined; The fitted curve that meets the fitting conditions is determined as the target curve.

14. The method according to claim 13, characterized in that, The fitting condition is that the fitted curve has the most inliers, and the inliers are the target point clouds whose distance from the fitted curve is less than or equal to a distance threshold.

15. A curb detection device based on lidar, characterized in that, include: The first acquisition unit is used to acquire a target point cloud and determine a set of planar point clouds and a set of non-planar point clouds in the target point cloud. The set of planar point clouds is the set of point clouds formed by the target point clouds corresponding to a first object in the current scene, and the set of non-planar point clouds is the set of point clouds formed by the target point clouds corresponding to a second object in the current scene. The first object is an object with a planar surface, and the second object is an object without a planar surface. The first establishing unit is used to establish a raster map based on the target point cloud, and to divide the raster map into a ground raster map and a non-ground raster map based on the planar point cloud set and the non-planar point cloud set. The first determining unit is used to traverse each grid in the non-ground grid map using an eight-neighbor search method to determine multiple target grids corresponding to the road edge. The second determining unit is used to determine the road edge based on the plurality of target grids; The first acquisition unit includes: a third determining subunit, configured to determine the maximum number of iterations corresponding to the random sampling consensus algorithm and multiple second preset distances, wherein each second preset distance is less than the second preset distance corresponding to the previous iteration process, and one iteration process corresponds to one second preset distance; a first extraction subunit, configured to process the target point cloud and extract planar feature points contained in the target point cloud based on the first second preset distance; a partitioning subunit, configured to divide the target point cloud into a first planar point cloud set and a first non-planar point cloud set based on the planar feature points; a second extraction subunit, configured to process the first non-planar point cloud set to extract the planar feature points in the non-planar point cloud set based on the second preset distance; a processing subunit, configured to process the non-planar point cloud set obtained in the previous iteration process multiple times based on the multiple second preset distances corresponding to the multiple iteration processes to obtain an initial planar point cloud set and an initial non-planar point cloud set; and a fourth determining subunit, configured to determine the planar point cloud set and the non-planar point cloud set based on the initial planar point cloud set and the initial non-planar point cloud set.

16. A computer-readable storage medium, characterized in that, The computer-readable storage medium includes a stored program, wherein the program executes a roadside detection method based on lidar as described in any one of claims 1 to 14.

17. A processor, characterized in that, The processor is used to run a program, wherein the program executes a roadside detection method based on lidar as described in any one of claims 1 to 14.

18. An electronic device, characterized in that, include: One or more processors, a memory, and one or more programs, wherein the one or more programs are stored in the memory and configured to be executed by the one or more processors, the one or more programs including methods for performing a lidar-based curb detection method according to any one of claims 1 to 14.

19. A vehicle, characterized in that, include: A lidar and a lidar-based curb detection device, the lidar-based curb detection device being used to perform a lidar-based curb detection method according to any one of claims 1 to 14.