A point cloud clustering GPU optimization method and device based on graph structure
By introducing GPU acceleration and graph structure optimization into the point cloud classification algorithm, constructing a point cloud mask graph and a search range structure graph, the problem of low efficiency of point cloud classification in the existing technology is solved, and efficient point cloud data processing and clustering are achieved.
Patent Information
- Application Number
- CN202111643852.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-29
- Publication Date
- 2025-09-30
- Estimated Expiration
- 2041-12-29
AI Technical Summary
The existing density-based point cloud classification algorithm has low processing efficiency due to its serial characteristics and needs to be accelerated and optimized.
GPU acceleration technology is adopted and graph structure data structure is introduced. By constructing a point cloud mask graph and search range structure graph based on spatial grid, CUDA parallel programming and graph theory methods are used to optimize the point cloud classification algorithm, including constructing a two-dimensional node table and edge structure table, and performing breadth-first search clustering.
It improves the efficiency of point cloud classification, realizes the rapid processing and clustering of point cloud data, reduces memory access latency, and is suitable for the production of high-precision maps for autonomous driving.
Smart Images

Figure CN114240729B_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present invention relate to the field of computer technology, and in particular to a method and device for GPU optimization of point cloud clustering based on a graph structure. Background Art
[0002] Point cloud classification is essential for processing the massive amount of point clouds required to create high-precision maps for autonomous driving. For massive amounts of point cloud data, efficient point cloud classification is crucial. There are many methods for point cloud classification, and one of the most effective methods is based on point cloud density. While density-based point cloud classification methods are effective, they suffer from low processing efficiency due to the inherent serial nature of the algorithm. To improve point cloud classification efficiency, accelerated optimization of the classification algorithm is necessary. Summary of the Invention
[0003] The present invention aims to solve the technical problems existing in the prior art and provides a point cloud clustering GPU optimization method and device based on a graph structure.
[0004] To solve the above technical problems, in a first aspect, an embodiment of the present invention provides a point cloud clustering GPU optimization method based on a graph structure, comprising:
[0005] Obtain point cloud data, build a point cloud mask based on the spatial grid using the GPU, and a search range structure diagram of the spatial grid corresponding to the point cloud data to obtain a point cloud structure diagram;
[0006] Search for neighboring points of the current point and determine the neighboring node table of the current point;
[0007] Point cloud search and clustering are performed based on the point cloud graph structure and the neighborhood node table, and the clustered point cloud is downloaded from the GPU to the CPU.
[0008] Preferably, acquiring point cloud data, projecting the point cloud data onto one-dimensional coordinates in a spatial grid based on a GPU, and storing the coordinates to construct a point cloud graph structure specifically includes:
[0009] Construct the one-dimensional coordinates of point cloud data projected into the spatial grid and store them;
[0010] Constructing a point cloud mask based on a spatial grid to indicate whether point cloud data exists in the spatial grid;
[0011] Constructing a search range structure diagram of the point cloud data corresponding to the spatial grid;
[0012] A continuous index table for one-dimensional storage of point cloud data is constructed based on the one-dimensional coordinates and the search range structure diagram.
[0013] Preferably, searching for neighboring points of the current point specifically includes:
[0014] Determine the current spatial grid where the current point is located based on the parameters of the current point, and search for neighboring spatial grids based on the current spatial grid;
[0015] Traverse the continuous index table of the neighborhood space grid to calculate the distance between each point in the neighborhood space grid and the current point to determine whether it is a neighborhood point of the current point.
[0016] As a preference, it also includes:
[0017] Construct a two-dimensional node table, wherein the first dimension of each node in the two-dimensional node table is used to store the number of neighboring points of the current node, and the second dimension is used to store the starting position index in the corresponding edge structure;
[0018] An edge structure table is constructed, where the edge structure table is used to store point indexes of the neighborhood of each node.
[0019] Preferably, the point cloud search clustering method is a breadth-first search method.
[0020] Preferably, constructing a two-dimensional node table specifically includes:
[0021] Inter-thread register data is accessed based on a CUDA shuffle instruction to construct a two-dimensional node table, and a variable structure table is constructed according to the two-dimensional node table.
[0022] In a second aspect, an embodiment of the present invention provides a point cloud clustering GPU optimization device based on a graph structure, comprising:
[0023] The structure diagram construction module obtains point cloud data and constructs a point cloud mask map based on the spatial grid and a search range structure map of the spatial grid corresponding to the point cloud data based on the GPU to obtain a point cloud structure map;
[0024] Neighborhood search module, searches for neighboring points of the current point and determines the neighboring node table of the current point;
[0025] The clustering module performs point cloud search and clustering based on the point cloud graph structure and the neighborhood node table, and downloads the clustered point cloud from the GPU to the CPU.
[0026] Preferably, the structure diagram construction module is specifically used to construct and store one-dimensional coordinates of the point cloud data projected into the spatial grid;
[0027] Constructing a point cloud mask based on a spatial grid to indicate whether point cloud data exists in the spatial grid;
[0028] Constructing a search range structure diagram of the point cloud data corresponding to the spatial grid;
[0029] A continuous index table for one-dimensional storage of point cloud data is constructed based on the one-dimensional coordinates and the search range structure diagram.
[0030] In a third aspect, an embodiment of the present invention provides an electronic device comprising a memory, a processor, and a computer program stored in the memory and runnable on the processor. When the processor executes the program, the steps of the graph-based point cloud clustering GPU optimization method as described in the embodiment of the first aspect of the present invention are implemented.
[0031] In a fourth aspect, an embodiment of the present invention provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the graph-based point cloud clustering GPU optimization method as described in the embodiment of the first aspect of the present invention.
[0032] The beneficial effects of the present invention are: adopting a GPU accelerated optimization solution to optimize specific optimization details to achieve the purpose of accelerated optimization; in addition to using GPU acceleration technology, it also introduces data structures such as graph structures, and uses methods in fields such as graph theory to optimize technical details in the hope of achieving good results. BRIEF DESCRIPTION OF THE DRAWINGS
[0033] Figure 1 Flowchart of the graph-based point cloud clustering GPU optimization method provided by an embodiment of the present invention;
[0034] Figure 2 A flowchart of a point cloud clustering GPU optimization method based on a graph structure provided by an embodiment of the present invention;
[0035] Figure 3 A schematic diagram of a neighborhood node representation provided by an embodiment of the present invention;
[0036] Figure 4 A schematic diagram of an electronic device provided by an embodiment of the present invention;
[0037] Figure 5 Schematic diagram of a computer-readable storage medium provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0038] To make the objectives, technical solutions, and advantages of the embodiments of the present invention more clear, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. All other embodiments obtained by ordinary technicians in this field based on the embodiments of the present invention without making any creative efforts shall fall within the scope of protection of the present invention.
[0039] Density-based point cloud classification methods are effective, but their inherent serial nature leads to low processing efficiency. To improve point cloud classification efficiency, the classification algorithm needs to be accelerated. Algorithm acceleration can be categorized as CPU acceleration or GPU acceleration.
[0040] Therefore, embodiments of the present invention provide a graph-based point cloud clustering GPU optimization method and device. This method utilizes a GPU-accelerated optimization solution to optimize specific optimization details to achieve accelerated optimization. In addition to utilizing GPU acceleration technology, it also incorporates data structures such as graphs and utilizes methods from fields such as graph theory to optimize technical details in the hope of achieving excellent results. This will be explained and introduced below through multiple embodiments.
[0041] Figures 1 to 2 An embodiment of the present invention provides a point cloud clustering GPU optimization method based on a graph structure, comprising:
[0042] Step S1: acquiring point cloud data, constructing a point cloud mask map based on a spatial grid and a search range structure map of the point cloud data corresponding to the spatial grid based on a GPU, to obtain a point cloud structure map;
[0043] The point cloud data's memory graph structure is constructed primarily on the GPU, using CUDA parallel programming acceleration technology. This involves scheduling CUDA streams and accessing and using registers between GPU threads. GPU optimization reduces significant memory access latency during GPU computing by optimizing the data storage structure and storage methods.
[0044] The data memory structure for constructing the point cloud structure specifically includes:
[0045] Construct the one-dimensional coordinates of point cloud data projected into the spatial grid and store them;
[0046] Constructing a point cloud mask based on a spatial grid to indicate whether point cloud data exists in the spatial grid;
[0047] Constructing a search range structure diagram of the point cloud data corresponding to the spatial grid;
[0048] A continuous index table for one-dimensional storage of point cloud data is constructed based on the one-dimensional coordinates and the search range structure diagram.
[0049] Step S2: Search the neighboring points of the current point and determine the neighboring node table of the current point, such as Figure 3 As shown in ; the search for neighboring points in the point cloud that meet the given parameters is computationally intensive and is performed on the GPU, specifically including:
[0050] Determine the current spatial grid where the current point is located based on the parameters of the current point, and search for neighboring spatial grids based on the current spatial grid;
[0051] Traverse the continuous index table of the neighborhood space grid to calculate the distance between each point in the neighborhood space grid and the current point to determine whether it is a neighborhood point of the current point.
[0052] A more difficult problem in this process is that the number of neighboring points of each point is unknown. GPU-side storage needs to allocate memory space in advance to achieve higher efficiency. Therefore, determining the number of neighbors becomes a difficult problem. In this embodiment, a graph structure of nodes and edges is constructed in combination with the graph structure, and then the GPU shuffle instruction is used to efficiently calculate the number of neighboring points and store the neighboring point index. The specific solution is:
[0053] First, we need to build a two-dimensional node table. The first dimension of each node in the two-dimensional node table stores the number of neighboring points of the current node, and the second dimension stores the starting position index in the corresponding edge structure.
[0054] Next, we construct an edge structure table to store the point indices of each node's neighborhood, sorted by node order. During the construction of the neighborhood node table, we leverage CUDA shuffle instructions to efficiently access inter-thread register data, enabling rapid construction of the neighborhood node table. Furthermore, we can quickly and conveniently construct the edge structure table based on the neighborhood node table.
[0055] Step S3: Perform point cloud search and clustering based on the point cloud graph structure and the neighborhood node table, and download the clustered point cloud from the GPU to the CPU. The neighborhood node table for the point cloud has been calculated in steps S1 and S2 above. A common breadth-first search traversal method is used to quickly search the clustered point cloud on the GPU. The clustered point cloud data is then downloaded from the GPU to the CPU.
[0056] Considering that the amount of point cloud data may be too large to exceed the GPU memory limit, the CPU, GPU, and CUDA stream parallel method is used to hide the memory access latency.
[0057] An embodiment of the present invention further provides a graph-structure-based point cloud clustering GPU optimization device, which is based on the graph-structure-based point cloud clustering GPU optimization method in the above embodiment and includes:
[0058] A structure graph construction module acquires point cloud data and constructs a point cloud mask based on a spatial grid and a search range structure graph of the point cloud data corresponding to the spatial grid using a GPU to obtain a point cloud structure graph. Specifically, the module constructs and stores one-dimensional coordinates of the point cloud data projected onto the spatial grid; constructs a point cloud mask based on the spatial grid to indicate whether point cloud data exists in the spatial grid; constructs a search range structure graph of the point cloud data corresponding to the spatial grid; and constructs a continuous index table for one-dimensional storage of point cloud data based on the one-dimensional coordinates and the search range structure graph.
[0059] Neighborhood search module, searches for neighboring points of the current point and determines the neighboring node table of the current point;
[0060] The clustering module performs point cloud search and clustering based on the point cloud graph structure and the neighborhood node table, and downloads the clustered point cloud from the GPU to the CPU.
[0061] See also Figure 4 , Figure 4 Schematic diagram of an embodiment of an electronic device provided by an embodiment of the present invention. Figure 4 As shown, an embodiment of the present invention provides an electronic device 500, including a memory 510, a processor 520, and a computer program 511 stored in the memory 520 and executable on the processor 520. When the processor 520 executes the computer program 511, the following steps are implemented:
[0062] Obtain point cloud data, build a point cloud mask based on the spatial grid using the GPU, and a search range structure diagram of the spatial grid corresponding to the point cloud data to obtain a point cloud structure diagram;
[0063] Search for neighboring points of the current point and determine the neighboring node table of the current point;
[0064] Point cloud search and clustering are performed based on the point cloud graph structure and the neighborhood node table, and the clustered point cloud is downloaded from the GPU to the CPU.
[0065] See also Figure 5 , Figure 5 Schematic diagram of an embodiment of a computer-readable storage medium provided in an embodiment of the present invention. Figure 5 As shown, this embodiment provides a computer-readable storage medium 600 on which a computer program 611 is stored. When the computer program 611 is executed by a processor, the following steps are implemented:
[0066] Obtain point cloud data, build a point cloud mask based on the spatial grid using the GPU, and a search range structure diagram of the spatial grid corresponding to the point cloud data to obtain a point cloud structure diagram;
[0067] Search for neighboring points of the current point and determine the neighboring node table of the current point;
[0068] Point cloud search and clustering are performed based on the point cloud graph structure and the neighborhood node table, and the clustered point cloud is downloaded from the GPU to the CPU.
[0069] It should be noted that, in the above embodiments, the description of each embodiment has its own focus. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant description of other embodiments.
[0070] It will be understood by those skilled in the art that embodiments of the present invention may be provided as methods, systems, or computer program products. Thus, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware. Furthermore, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to magnetic disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0071] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowcharts and / or block diagrams, as well as combinations of processes and / or blocks in the flowcharts and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded computer, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowcharts and / or block diagrams. Figure 1 a process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0072] These computer program instructions may also be stored in a computer readable memory that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 a process or multiple processes and / or boxes Figure 1 The function specified in one or more boxes.
[0073] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing the instructions executed on the computer or other programmable device for implementing the process. Figure 1 a process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.
[0074] Although the preferred embodiments of the present invention have been described, those skilled in the art may make additional changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the present invention.
[0075] Obviously, those skilled in the art may make various changes and modifications to the present invention without departing from the spirit and scope of the present invention. Thus, if such changes and modifications fall within the scope of the claims and their equivalents, the present invention is intended to include such changes and modifications.
Claims
1. A point cloud clustering GPU optimization method based on graph structure, characterized in that: include: Obtain point cloud data, build a point cloud mask based on the spatial grid using the GPU, and a search range structure diagram of the spatial grid corresponding to the point cloud data to obtain a point cloud structure diagram; Search for neighboring points of the current point and determine the neighboring node table of the current point; Performing point cloud search and clustering based on the point cloud structure graph and the neighborhood node table, and downloading the clustered point cloud from the GPU to the CPU; Search for neighboring points of the current point, including: Determine the current spatial grid where the current point is located based on the parameters of the current point, and search for neighboring spatial grids based on the current spatial grid; Traverse the continuous index table of the neighborhood space grid to calculate the distance between each point in the neighborhood space grid and the current point to determine whether it is a neighborhood point of the current point; Construct a two-dimensional node table, wherein the first dimension of each node in the two-dimensional node table is used to store the number of neighboring points of the current node, and the second dimension is used to store the starting position index in the corresponding edge structure; An edge structure table is constructed, where the edge structure table is used to store point indexes of the neighborhood of each node.
2. The point cloud clustering GPU optimization method based on graph structure according to claim 1, characterized in that: Obtain point cloud data, build a point cloud mask based on the spatial grid using the GPU, and a search range structure diagram of the spatial grid corresponding to the point cloud data to obtain a point cloud structure diagram, specifically including: Construct the one-dimensional coordinates of point cloud data projected into the spatial grid and store them; Constructing a point cloud mask based on a spatial grid to indicate whether point cloud data exists in the spatial grid; Constructing a search range structure diagram of the point cloud data corresponding to the spatial grid; A continuous index table for one-dimensional storage of point cloud data is constructed based on the one-dimensional coordinates and the search range structure diagram.
3. The point cloud clustering GPU optimization method based on graph structure according to claim 1, characterized in that: The method used in the point cloud search clustering is a breadth-first search method.
4. The point cloud clustering GPU optimization method based on graph structure according to claim 1, characterized in that: Construct a two-dimensional node table, including: Inter-thread register data is accessed based on a CUDA shuffle instruction to construct a two-dimensional node table, and a variable structure table is constructed according to the two-dimensional node table.
5. A point cloud clustering GPU optimization device based on graph structure, characterized in that: include: The structure diagram construction module obtains point cloud data and constructs a point cloud mask map based on the spatial grid and a search range structure map of the spatial grid corresponding to the point cloud data based on the GPU to obtain a point cloud structure map; Neighborhood search module, searches for neighboring points of the current point and determines the neighboring node table of the current point; A clustering module performs point cloud search and clustering based on the point cloud structure graph and the neighborhood node table, and downloads the clustered point cloud from the GPU to the CPU; Search for neighboring points of the current point, including: Determine the current spatial grid where the current point is located based on the parameters of the current point, and search for neighboring spatial grids based on the current spatial grid; Traverse the continuous index table of the neighborhood space grid to calculate the distance between each point in the neighborhood space grid and the current point to determine whether it is a neighborhood point of the current point; Construct a two-dimensional node table, wherein the first dimension of each node in the two-dimensional node table is used to store the number of neighboring points of the current node, and the second dimension is used to store the starting position index in the corresponding edge structure; An edge structure table is constructed, where the edge structure table is used to store point indexes of the neighborhood of each node.
6. The point cloud clustering GPU optimization device based on graph structure according to claim 5, characterized in that: The structure diagram construction module is specifically used to construct and store one-dimensional coordinates of point cloud data projected into a spatial grid; Constructing a point cloud mask based on a spatial grid to indicate whether point cloud data exists in the spatial grid; Constructing a search range structure diagram of the point cloud data corresponding to the spatial grid; A continuous index table for one-dimensional storage of point cloud data is constructed based on the one-dimensional coordinates and the search range structure diagram.
7. An electronic device, characterized in that: include: Memory for storing computer software programs; A processor is used to read and execute the computer software program, thereby implementing the graph-based point cloud clustering GPU optimization method described in any one of claims 1 to 4.
8. A non-transitory computer-readable storage medium, characterized in that The storage medium stores a computer software program for implementing the graph-based point cloud clustering GPU optimization method according to any one of claims 1 to 4.
Citation Information
Patent Citations
Obstacle identification method and system based on 3D laser point cloud
CN113640826A
Method and device for point cloud processing and decoding, and storage medium
WO2021109153A1