A point cloud processing method based on hardware accelerated ray tracing

By adopting a point cloud processing method based on hardware-accelerated ray tracing, the problems of insufficient video memory and device limitations are solved, enabling efficient processing of large-scale point cloud data on multiple hardware platforms, improving the efficiency and accuracy of point cloud processing, and enhancing the quality and visual effects of point cloud data.

CN122492909APending Publication Date: 2026-07-31NORTHWEST UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
NORTHWEST UNIV
Filing Date
2025-01-29
Publication Date
2026-07-31

AI Technical Summary

Technical Problem

Existing point cloud processing methods suffer from insufficient video memory and device limitations. In particular, insufficient video memory becomes a bottleneck when processing large-scale point cloud data. Furthermore, hardware-accelerated ray tracing technology can only run on NVIDIA GPUs, which limits the software's versatility and accessibility.

Method used

A point cloud processing method based on hardware-accelerated ray tracing is adopted. An inverse neighborhood search formula is created by using the inverse query idea, which maps the neighborhood search to hardware-accelerated ray tracing. The neighborhood search is performed using the ray tracing acceleration structure and implemented in the computation shader. The results are stored in registers. The point cloud normal is calculated by principal component analysis and smoothing is achieved by moving least squares method.

Benefits of technology

It effectively alleviates the problem of insufficient video memory, enables efficient processing of large-scale point cloud data on multiple hardware platforms, solves device limitations, improves the efficiency and accuracy of point cloud processing, and enhances the quality and visual effects of point cloud data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122492909A_ABST
    Figure CN122492909A_ABST
Patent Text Reader

Abstract

This invention discloses a point cloud processing method based on hardware-accelerated ray tracing, comprising the following steps: S1, based on ray tracing and the inverse query concept, creating an inverse neighborhood search formula for hardware-accelerated ray tracing, mapping the neighborhood search to hardware-accelerated ray tracing; S2, creating a ray tracing acceleration structure based on point cloud data to provide data structure support for ray tracing; S3, using the inverse neighborhood search formula created in step S1, loading sample points and query points into the ray tracing acceleration structure created in step S2, designing a ray query algorithm, and implementing the neighborhood search based on hardware-accelerated ray tracing in the computation shader; S4, using registers to store the neighborhood search results from step S3, calculating the point cloud normals using principal component analysis, and using moving least squares to achieve point cloud smoothing. This invention effectively alleviates the problem of insufficient video memory and ensures efficient processing of large-scale point cloud data on various hardware platforms.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of point cloud processing technology, specifically relating to a point cloud processing method based on hardware-accelerated ray tracing. Background Technology

[0002] With the development of computer graphics and computer vision, 3D point clouds have become an important data format for describing complex scenes and objects. Compared to 2D images, 3D point clouds scan object surfaces, building structures, terrain, forests, and urban environments to form a dense, irregularly shaped point distribution pattern. This data format can more intuitively capture and represent the details of the real world. Point cloud data needs to record the coordinates of each point and may also include additional information such as normals, color, and reflectivity, making it extremely valuable in scientific research and engineering applications. Point cloud processing encompasses a series of technologies, including acquisition, filtering, segmentation, smoothing, registration, retrieval, feature extraction, recognition, tracking, surface reconstruction, and visualization. It has shown enormous application potential in fields such as computer vision, surveying, autonomous driving, robotics, human-computer interaction, and reverse engineering.

[0003] The core issue in point cloud processing is establishing topological relationships between discrete points to achieve neighborhood search. Neighborhood search is the foundation of point cloud processing, upon which various point cloud processing algorithms can be extended. Most neighborhood search algorithms obtain the local features of a central point by examining sample points within a given range. The efficiency of neighborhood search depends to some extent on the constructed spatial index structure, i.e., establishing a top-down, hierarchical tree-like spatial partition, such as a KD-tree or octree. This involves choosing different partitioning strategies and different construction criteria to adapt to different point cloud data. To further improve the efficiency of point cloud processing, some GPU-based methods have gradually emerged. For example, the GPU module in PCL uses Morton coding to sort point clouds and implements parallel search based on octrees on the GPU. However, GPU-based methods all suffer from excessive memory consumption, affecting the scale of the point cloud being processed and the scope of the neighborhood search. Moreover, since the CUDA technology commonly used in GPU computing is only available on NVIDIA GPUs, these methods are limited to running on NVIDIA GPUs.

[0004] Lauterbach et al. proposed a parallel method for sorting input primitives using space-filling curves, employing Morton coding for primitive sorting. Morton coding ensures that primitives close to each other in 3D space remain close in the BVH (Browser-Video Hashing), effectively organizing primitives, reducing the workload of building the index structure, and improving the efficiency of neighborhood queries.

[0005] Garanzha et al. proposed a method to generate nodes layer by layer, starting from the root node. This method processes nodes at each layer in parallel and uses binary search to partition primitives within a node, enumerating child nodes with atomic counters, further improving the efficiency of BVH construction. Furthermore, the Patricia tree proposed by Morrison achieves a compact representation by omitting nodes with only one child node; each internal node corresponds to the longest common prefix shared in the subtree, effectively organizing and retrieving data. Evanglelou et al. proposed an alternative formula for radius search operations, mapping the neighborhood search problem to OptiX ray tracing. Zhu et al. further proposed query scheduling and query optimization methods. Nagarajan et al. proposed an unrestricted ray tracing-accelerated neighborhood search method; however, these methods all suffer from excessive memory consumption, affecting the scalability of neighborhood search, and can only run on NVIDIA GPUs supporting CUDA, not on GPUs from other manufacturers.

[0006] The existing technology still has the following defects and shortcomings:

[0007] (1) Insufficient video memory space

[0008] In point cloud processing, neighborhood search is a crucial operation commonly used in various applications such as surface reconstruction, feature extraction, and object segmentation. Neighborhood search involves finding the set of spatially nearest points for each point in the point cloud, typically requiring extensive data comparison and storage operations. In GPU-accelerated point cloud processing practices, search results are usually stored in the GPU's global memory to achieve fast processing speeds. However, the GPU's global memory is limited relative to its processing power, especially when processing large-scale point cloud datasets. When the point cloud data volume is large or the search area is wide, the neighborhood set of each point can be enormous, causing the memory required to store this neighborhood information to far exceed the GPU's global memory capacity. In this case, insufficient GPU memory becomes a bottleneck limiting processing performance because the GPU needs to frequently exchange data between its internal memory and external storage, which not only slows down processing but may also lead to computational task failures. To address this issue, this paper stores the results in registers after the neighborhood search is completed and performs point cloud normal calculation and smoothing directly within the neighborhood search thread, eliminating the need to allocate additional GPU memory for each point in the point cloud to store the index of neighboring points.

[0009] (2) Equipment limitations

[0010] While hardware-accelerated ray tracing technology is revolutionary in graphics processing, its practical application is limited by CUDA technology, restricting its operation to NVIDIA GPUs. Because CUDA only supports NVIDIA GPUs, all applications and systems developed using CUDA can only run on devices equipped with NVIDIA GPUs. This is a significant disadvantage for users of other GPU brands (such as AMD or Intel). This dependency limits software versatility and accessibility, locking developers and end-users into the NVIDIA ecosystem. For enterprise and individual users who might prefer AMD or Intel GPUs, they cannot utilize CUDA-based applications unless they upgrade their hardware. This not only increases costs for users but also limits the technology's adoption rate. Summary of the Invention

[0011] The technical problem to be solved by the present invention is to provide a point cloud processing method based on hardware-accelerated ray tracing to address the shortcomings of the prior art, so as to effectively alleviate the problem of insufficient video memory and ensure efficient processing of large-scale point cloud data on multiple hardware platforms.

[0012] To solve the above-mentioned technical problems, the technical solution adopted by the present invention is: a point cloud processing method based on hardware-accelerated ray tracing, comprising the following steps:

[0013] Step S1: Based on ray tracing, and based on the reverse query idea, create a reverse neighborhood search formula based on hardware-accelerated ray tracing, and map the neighborhood search to hardware-accelerated ray tracing.

[0014] Step S2: Create a ray tracing acceleration structure based on point cloud data to provide data structure support for ray tracing;

[0015] Step S3: Using the reverse neighborhood search formula created in step S1, load the sample points and query points into the ray tracing acceleration structure created in step S2, design a ray query algorithm, and implement the neighborhood search based on hardware-accelerated ray tracing in the computation shader.

[0016] Step S4: Store the neighborhood search results from step S3 in a register, calculate the point cloud normal using principal component analysis, and smooth the point cloud using moving least squares.

[0017] The above-mentioned point cloud processing method based on hardware-accelerated ray tracing, in step S1, builds upon ray tracing by creating a reverse neighborhood search formula based on the reverse query idea, mapping the neighborhood search to hardware-accelerated ray tracing; the specific method is as follows:

[0018] Step S101: Determine the maximum neighborhood radius r of the query point in the neighborhood search. max , will r max As the dimensions of the AABB bezel box;

[0019] Step S102: Take each query point as the starting point of the ray, with arbitrary ray direction. Ray tracing performs a radius search of the query point based on BVH, according to the formula:

[0020]

[0021] Determine if the maximum neighborhood radius r is satisfied. max Then, determine which AABB bounding boxes each query point falls within in the BVH; where I q (s) indicates whether sample point s satisfies the query condition of query point q. q When (s) = 1, it means that sample point s satisfies the query condition of query point q; when I q When (s) = 0, it means that the sample point s does not meet the query conditions of the query point q; d(s,q) is the distance function, which is used to calculate the distance from the sample point s to the query point q.

[0022] The above-mentioned point cloud processing method based on hardware-accelerated ray tracing, in step S2, involves creating a ray tracing acceleration structure based on the point cloud data to provide data structure support for ray tracing; the specific process is as follows:

[0023] Step S201: Construct the underlying acceleration structure. Each instance of the underlying acceleration structure corresponds to a point cloud in the scene.

[0024] Step S202: Based on the indexing and instantiation of the underlying acceleration structure, construct the top-level acceleration structure.

[0025] The above-mentioned point cloud processing method based on hardware-accelerated ray tracing, specifically the process of constructing the underlying acceleration structure in step S201 is as follows:

[0026] Step S2011: Transfer the vertex data of the model from memory to video memory through the storage buffer;

[0027] Step S2012: Bind the vertex data to the vertex buffer of the underlying acceleration structure, and create a maximum neighborhood radius r centered on each point in the point cloud. max AABB bezel box for bezel box dimensions;

[0028] Step S2013: Transfer the information of the underlying acceleration structure to the top-level acceleration structure.

[0029] The above-mentioned point cloud processing method based on hardware-accelerated ray tracing, specifically the process of constructing the top-level acceleration structure based on the indexing and instantiation of the underlying acceleration structure in step S202, is as follows:

[0030] Step S2021: Each top-level acceleration structure instance references a different number of bottom-level acceleration structures, and describes the position and orientation of the bottom-level acceleration structure instance in the scene through a unique transformation matrix;

[0031] Step S2022: Convert the created low-level acceleration structure instance and its transformation information into the instance descriptor of the high-level acceleration structure, and complete the construction of the BVH space index structure of the entire scene.

[0032] The point cloud processing method based on hardware-accelerated ray tracing described above, the ray query algorithm designed in step S3 is as follows:

[0033] Step S301: Read the point cloud and construct an AABB bounding box;

[0034] Step S302: Construct an acceleration structure using AABB bounding boxes;

[0035] Step S303: Perform neighborhood search using ray tracing;

[0036] Step S304: Obtain the first AABB intersection point for each query point;

[0037] Step S305: Morton sort is used based on the intersection of AABB;

[0038] Step S306: Restart ray tracing;

[0039] Step S307: Perform a rejection operation;

[0040] Step S308: Obtain neighborhood points;

[0041] Step S309: Calculate the point cloud normals and perform smoothing.

[0042] The above-mentioned point cloud processing method based on hardware-accelerated ray tracing, specifically the process of performing neighborhood search using ray tracing in step S303, is as follows:

[0043] Step S3031: Globally call the index to obtain the ID of each point;

[0044] Step S3032: The ray initialization function initiates ray query;

[0045] Step S3033: Accelerated structure for ray query traversal.

[0046] The above-mentioned point cloud processing method based on hardware-accelerated ray tracing, specifically the process of calculating the point cloud normal using principal component analysis in step S4, is as follows:

[0047] Step S4A1: For each point in the point cloud, select all points within its neighborhood and calculate the barycenter coordinates. P :

[0048]

[0049] Among them, P i Let represent the coordinates of the i-th point, k be the number of neighboring points, and i be a natural number from 1 to k.

[0050] Step S4A2: Calculate the covariance matrix C of the points based on the obtained barycenter coordinates:

[0051]

[0052] Among them, P i Let i represent the coordinates of the i-th point, where i is a natural number from 1 to k.

[0053] Step S4A3: Solve for the eigenvalues ​​and eigenvectors of the covariance matrix C to capture the distribution characteristics of neighborhood points relative to the mean;

[0054] Step S4A4: Select the eigenvector corresponding to the smallest eigenvalue as the normal direction of that point.

[0055] The above-mentioned point cloud processing method based on hardware-accelerated ray tracing, specifically the process of smoothing the point cloud using the moving least squares method in step S4, is as follows:

[0056] Step S4B1: Calculate the weight w of the neighboring points corresponding to the query point. i :

[0057]

[0058] Among them, P i P represents the coordinates of the i-th neighboring point. j Represents the i-th neighborhood point P i The corresponding query point, σ is a parameter controlling the rate of weight descent; weight w ij This indicates a neighborhood point to the query point P. i Smoothing weights, w i The smaller the value, the less smooth the surface.

[0059] Step S4B2: With the query point as the center, and the normal of the plane formed by the query point and its neighboring points as the z-axis, define the normalized vector perpendicular to the normal as the y-axis vector v. Obtain the x-axis vector u through the cross product of the normal and the y-axis vector v, and construct the local coordinate system (u,v).

[0060] Step S4B3: Project the coordinates of the neighboring points from the point cloud coordinate system to the local coordinate system (u,v); for the i-th neighboring point P i Its x-coordinate in the local coordinate system i Represented as:

[0061] x i =(P i -P j )·u

[0062] Its y-coordinate in the local coordinate system i Represented as:

[0063] y i =(P i -P j )·v

[0064] Step S4B4: Construct the coefficient matrix f:

[0065]

[0066] Where m represents the number of neighboring points;

[0067] Step S4B5: Combine the local coordinates u and v of the neighboring points into matrix A:

[0068]

[0069] Where, x i λ x represents i The power of λ, where i takes the value of a natural number from 1 to m, and λ takes the value of a natural number from 1 to σ;

[0070] Step S4B6: Solve for the coefficient vector c using the least squares method:

[0071] min c =‖Ac-f|| 2

[0072] The coefficients of the polynomial fitting are obtained, and the coefficient vector is multiplied by the point cloud normal and coordinates to achieve point cloud smoothing.

[0073] Compared with the prior art, the present invention has the following advantages:

[0074] 1. This invention utilizes the ray tracing unit of modern GPUs to accelerate neighborhood search, and on this basis, realizes the calculation and smoothing of point cloud normals, solving the problems of high memory consumption and limitation to specific manufacturers' GPUs in existing GPU point cloud processing methods. It realizes GPU-independent operations and ensures efficient processing of large-scale point cloud data on multiple hardware platforms.

[0075] 2. After the neighborhood search is completed, the results are stored in a register. Point cloud normals are calculated and smoothed directly in the neighborhood search thread. There is no need to allocate additional video memory for each point in the point cloud to store the index of the neighboring points, which effectively alleviates the problem of insufficient video memory.

[0076] 3. This invention employs two ray tracing steps. In the computation shader, ray query is used to search for the neighborhood, reducing memory usage, preventing the thread control flow from diverging, and expanding the point cloud normals based on the neighborhood search results to achieve a smoothing effect.

[0077] The technical solution of the present invention will be further described in detail below with reference to the accompanying drawings and embodiments. Attached Figure Description

[0078] Figure 1 This is a flowchart of the point cloud processing method based on hardware-accelerated ray tracing of the present invention;

[0079] Figure 2 This is the AABB intersection diagram of the light rays and the query point in this invention;

[0080] Figure 3 This is a schematic diagram of the radius search principle based on hardware-accelerated ray tracing in this invention;

[0081] Figure 4 This is a diagram of the BVH acceleration structure of the present invention;

[0082] Figure 5 This is a spatial index structure diagram of the present invention;

[0083] Figure 6 This is a flowchart of the ray tracing process for a single thread in this invention;

[0084] Figure 7 This is a flowchart of the point cloud processing algorithm based on hardware-accelerated ray tracing of the present invention.

[0085] Figure 8 The calculation result of the Armadillo normal with a radius of 0.8 mm is shown in a specific embodiment of the present invention.

[0086] Figure 9 The calculation result of the Asian Dragon normal with a radius of 0.15mm is shown in a specific embodiment of the present invention.

[0087] Figure 10 The calculation result of the Lucy normal with a radius of 1.0 mm is shown in a specific embodiment of the present invention. Detailed Implementation

[0088] like Figure 1 As shown, the point cloud processing method based on hardware-accelerated ray tracing of the present invention includes the following steps:

[0089] Step S1: Based on ray tracing, and based on the reverse query idea, create a reverse neighborhood search formula based on hardware-accelerated ray tracing, and map the neighborhood search to hardware-accelerated ray tracing.

[0090] Step S1 describes creating a reverse neighborhood search formula based on hardware-accelerated ray tracing, using the reverse query concept, and mapping the neighborhood search to hardware-accelerated ray tracing. The specific method is as follows:

[0091] Step S101: Determine the maximum neighborhood radius r of the query point in the neighborhood search. max , will r max As the dimensions of the AABB bezel box;

[0092] The AABB (Axis-Aligned Bounding Box) is a common data structure used to represent the minimum bounding box of a 3D object.

[0093] When there is a set of query points, each query point has a different neighborhood value. If the neighborhood radius *r* of a certain query point is used as the size of the AABB bounding box, a single ray tracing query will only affect query points whose neighborhood radius *r* is smaller than the specified radius *r*. Other query points will need to have their AABB size reset and be traced again, requiring multiple ray tracings, which is time-consuming and laborious. Therefore, this invention uses the maximum neighborhood radius *r* of the query point in the neighborhood search. max Using the size of the AABB bounding box, a single ray tracing operation can complete the search for a subset of all query points based on the radius of that maximum value;

[0094] Step S102: Take each query point as the starting point of a ray. The ray direction is arbitrary and the length is extremely short. Ray tracing performs a radius search of the query point based on BVH, according to the formula:

[0095]

[0096] Determine if the maximum neighborhood radius r is satisfied. max Then, determine which AABB bounding boxes each query point falls within in the BVH; where I q (s) indicates whether sample point s satisfies the query condition of query point q. qWhen (s) = 1, it means that sample point s satisfies the query condition of query point q; when I q When (s) = 0, it indicates that sample point s does not satisfy the query condition of query point q; d(s,q) is the distance function used to calculate the distance from sample point s to query point q; that is, when the distance from sample point s to point q is less than or equal to r max At that time, I q (s) = 1, otherwise, I q (s) = 0.

[0097] In practice, ray tracing performs a radius search for the query point based on BVH (Bounding Volume Hierarchy) and determines whether the neighborhood radius is satisfied. The key factor in this determination is the size of the AABB bounding box; the size must be greater than or equal to the neighborhood radius of the query point to find the AABB bounding box containing that query point. Figure 2 As shown, if the size of AABB is smaller than the neighborhood radius, even if ray B is within the neighborhood of the query point, it will not be detected if it does not intersect with the AABB bounding box. Even if ray A intersects with the AABB bounding box, further judgment is required to determine whether it is within the neighborhood of the query point.

[0098] This invention, based on the concept of reverse lookup, creates a reverse neighborhood search formula for hardware-accelerated ray tracing, mapping the neighborhood search to the hardware-accelerated ray tracing process as follows: Figure 3 As shown.

[0099] In existing technologies, query operations typically treat the query point as the center point and search for surrounding sample points. Following this logic, ray tracing requires treating all sample points as the starting point of a ray and performing ray intersection operations on each starting point, resulting in significant performance overhead. However, by using a reverse query method, treating the query point as the starting point of a ray and having each sample point search for its surrounding query points (i.e., ray starting points), the amount of ray intersection operations can be significantly reduced, thus improving performance. The key to achieving neighborhood search in ray tracing is treating each query point as the starting point of a ray, with the ray direction arbitrary and its length extremely short. Since our goal is to determine which AABB bounding boxes each query point falls within within its BVH (Bounding Value Height), the ray cannot have a length. Ray tracing will then automatically determine and perform a neighborhood search based on the BVH, and the key to this determination lies in the size of the AABB bounding box. This size must be greater than or equal to the neighborhood value of the query point to find its AABB bounding box. We have a set of query points, each with a different neighborhood value. If we use the neighborhood value of a query point as the size of its ABCD bounding box, then this ray tracing will only affect query points whose neighborhood values ​​are smaller than that of the query point. The remaining query points will need to have their ABCD size reset and be traced again, requiring multiple ray tracings, which is not the desired result. Therefore, we need to first determine the maximum neighborhood value of the query point in the neighborhood search and use that value as the size of the ABCD bounding box. This allows us to complete the neighborhood search subset of all query points based on this maximum value in a single ray tracing. After obtaining this subset, we calculate the distance between the query point and all points in the subset to determine if it meets our neighborhood value. This process of first creating ray origins for all query points, searching for query points using sample points, and then calculating the distance based on the result of the maximum neighborhood value to determine if it meets our neighborhood value is called reverse tracing.

[0100] Step S2: Create a ray tracing acceleration structure based on point cloud data to provide data structure support for ray tracing;

[0101] Step S2 describes creating a ray tracing acceleration structure based on point cloud data to provide data structure support for ray tracing; the specific process is as follows:

[0102] Step S201: Construct the underlying acceleration structure. Each instance of the underlying acceleration structure corresponds to a point cloud in the scene.

[0103] The specific process of constructing the underlying acceleration structure in step S201 is as follows:

[0104] Step S2011: Transfer the vertex data of the model from memory to video memory through the storage buffer;

[0105] Step S2012: Bind the vertex data to the vertex buffer of the underlying acceleration structure, and create a maximum neighborhood radius r centered on each point in the point cloud. max Use an AABB bounding box of the specified bounding box size to ensure that the acceleration structure accurately reflects the spatial layout of the model.

[0106] Step S2013: Transfer the information of the underlying acceleration structure to the top-level acceleration structure.

[0107] Step S202: Based on the indexing and instantiation of the underlying acceleration structure, construct the top-level acceleration structure.

[0108] The top-level acceleration structure is responsible for managing the spatial relationships between instances of the bottom-level acceleration structure, enabling efficient access to the entire scene.

[0109] The specific process of constructing the top-level acceleration structure based on the indexing and instantiation of the underlying acceleration structure in step S202 is as follows:

[0110] Step S2021: Each top-level acceleration structure instance references a different number of bottom-level acceleration structures, and describes the position and orientation of the bottom-level acceleration structure instance in the scene through a unique transformation matrix;

[0111] Step S2022: Convert the created low-level acceleration structure instance and its transformation information into the instance descriptor of the high-level acceleration structure, and complete the construction of the BVH space index structure of the entire scene.

[0112] The acceleration structure for hardware-accelerated ray tracing mainly consists of two parts: a top-level acceleration structure and a bottom-level acceleration structure; together, they form the acceleration structure spatial index, such as... Figure 5 As shown; the underlying acceleration structure for accelerating the intersection testing process between rays and the scene is as follows. Figure 4 As shown, for the underlying accelerated structure, neighborhood search becomes a tree traversal problem. At each node, it is tested whether the ray intersects with the node's AABB. If the ray does not intersect with the node's AABB, the entire subtree under that node can be skipped, because all child nodes contained in that AABB are guaranteed not to intersect with the ray. For example, Figure 4 Ray A in the equation does not intersect the AABB of node 4, therefore all child nodes of node 4 can be skipped. Otherwise, intersection tests will be performed on all AABBs contained in node 4. Figure 4 When ray B intersects AABB at node 7, it is necessary to determine whether it intersects with the object it surrounds. However, in reality, they do not intersect. This shows that after intersecting with AABB, it is still necessary to further determine the intersection with the object in order to obtain the correct result.

[0113] Step S3: Using the reverse neighborhood search formula created in step S1, load the sample points and query points into the ray tracing acceleration structure created in step S2, design a ray query algorithm, and implement the neighborhood search based on hardware-accelerated ray tracing in the computation shader.

[0114] The ray query algorithm designed in step S3 is as follows:

[0115] Step S301: Read the point cloud and construct an AABB bounding box;

[0116] Step S302: Construct an acceleration structure using AABB bounding boxes;

[0117] Step S303: Perform neighborhood search using ray tracing;

[0118] The specific process of using ray tracing for neighborhood search in step S303 is as follows:

[0119] Step S3031: Globally call the index to obtain the ID of each point;

[0120] Step S3032: The ray initialization function initiates ray query;

[0121] Step S3033: Accelerated structure for ray query traversal.

[0122] Computation shaders, as programs that perform general-purpose computing tasks on the GPU, play the same role as CUDA cores in NVIDIA GPUs. Efficient parallel computation is achieved by setting the size and number of workgroups. Each thread is responsible for the neighborhood search of a query point, independently processing the query point according to the hardware-accelerated ray tracing-based point cloud processing algorithm described above; for example... Figure 6 As shown.

[0123] In practice, the input is a query set Q and a sample set S, and the output is the sample points within the radius of each query set.

[0124] The ray query algorithm designed in this invention, such as... Figure 7 As shown, two ray tracing operations are used. In the compute shader, the neighborhood is searched using ray queries. The first ray tracing is started to obtain the first AABB intersection of the query point. Based on the first intersection, Morton sorting is used to make the spatially adjacent query points also adjacent in array index. Then the second ray tracing is started and the result is stored in the register, thereby reducing the video memory usage and preventing the thread control flow from diverging.

[0125] The ray query algorithm designed in this invention can reduce ray incoherence and reduce thread control flow divergence in the algorithm. The theoretical idea of ​​the query scheduling algorithm is to group spatially close queries together, so that adjacent rays follow similar BVH traversal paths. A lightweight grouping algorithm using a simple heuristic is proposed: queries located in the same leaf AABB are spatially close and should be grouped together. In practice, queries are usually surrounded by many leaf AABBs; any such closed AABB will provide useful clues about the spatial proximity of queries. This loose definition of spatial proximity can very effectively group queries—as another starting point for ray tracing, after finding the first intersecting node AABB for each query point, ray tracing stops, and Morton's algorithm is performed based on the bounding boxes of the intersecting AABBs for each query point, allowing threads in the same group to process queries that are spatially close.

[0126] Step S304: Obtain the first AABB intersection point for each query point;

[0127] Step S305: Morton sort is used based on the intersection of AABB;

[0128] Step S306: Restart ray tracing;

[0129] Step S307: Perform a rejection operation;

[0130] Step S308: Obtain neighborhood points;

[0131] Step S309: Calculate the point cloud normals and perform smoothing.

[0132] Step S4: Store the neighborhood search results from step S3 in a register, calculate the point cloud normal using principal component analysis, and smooth the point cloud using moving least squares.

[0133] The specific process of calculating the point cloud normal using principal component analysis in step S4 is as follows:

[0134] Step S4A1: For each point in the point cloud, select all points within its neighborhood and calculate the centroid coordinates P:

[0135]

[0136] Among them, P i Let represent the coordinates of the i-th point, k be the number of neighboring points, and i be a natural number from 1 to k.

[0137] Step S4A2: Calculate the covariance matrix C of the points based on the obtained barycenter coordinates:

[0138]

[0139] Among them, P i Let i represent the coordinates of the i-th point, where i is a natural number from 1 to k.

[0140] Step S4A3: Solve for the eigenvalues ​​and eigenvectors of the covariance matrix C to capture the distribution characteristics of neighborhood points relative to the mean;

[0141] Step S4A4: Select the eigenvector corresponding to the smallest eigenvalue as the normal direction of that point.

[0142] The specific process of smoothing point clouds using the moving least squares method described in step S4 is as follows:

[0143] Step S4B1: Calculate the weight w of the neighboring points corresponding to the query point. i :

[0144]

[0145] Among them, P i P represents the coordinates of the i-th neighboring point. j Represents the i-th neighborhood point P i The corresponding query point, σ is a parameter controlling the rate of weight descent; weight w ij This indicates a neighborhood point to the query point P. i Smoothing weights, w i The smaller the value, the less smooth the surface.

[0146] Step S4B2: With the query point as the center, and the normal of the plane formed by the query point and its neighboring points as the z-axis, define the normalized vector perpendicular to the normal as the y-axis vector v. Obtain the x-axis vector u through the cross product of the normal and the y-axis vector v, and construct the local coordinate system (u,v).

[0147] Expressed as a formula:

[0148] v = unitOrthogonal(normal)

[0149] u = normal × v

[0150] Where unitOrthogona represents vertical normalization, and normal represents the normal of the plane formed by the query point and its neighboring points;

[0151] Step S4B3: Project the coordinates of the neighboring points from the point cloud coordinate system to the local coordinate system (u,v); for the i-th neighboring point P i Its x-coordinate in the local coordinate system i Represented as:

[0152] x i =(P i-P j )·u

[0153] Its y-coordinate in the local coordinate system i Represented as:

[0154] y i =(P i -P j )·v

[0155] Step S4B4: Construct the coefficient matrix f:

[0156]

[0157] Where m represents the number of neighboring points; that is, i takes the value of a natural number from 1 to m;

[0158] Step S4B5: Combine the local coordinates u and v of the neighboring points into matrix A:

[0159]

[0160] Where, x i λ x represents i The power of λ, where i takes the value of a natural number from 1 to m, and λ takes the value of a natural number from 1 to σ;

[0161] Step S4B6: Solve for the coefficient vector c using the least squares method:

[0162] min c =||Ac-f|| 2

[0163] The coefficients of the polynomial fitting are obtained, and the coefficient vector is multiplied by the point cloud normal and coordinates to achieve point cloud smoothing.

[0164] After obtaining the neighborhood search results, the primary issue to address is the excessive video memory usage. In GPU-based point cloud processing methods, the biggest factor affecting video memory usage is that all results of the neighborhood search need to be stored in video memory. This method of storing neighborhood search results consumes a large amount of video memory. To solve this problem, this invention stores the results in a register after the neighborhood search is completed, and performs point cloud normal calculation and smoothing directly in the neighborhood search thread, without needing to allocate additional video memory for each point in the point cloud to store the index of the neighboring points.

[0165] To verify the technical effects of this invention, point cloud normals were processed using the Stanford 3D Scanning Repository point cloud dataset. The point cloud smoothing results for the Armadillo normal with a radius of 0.8 mm are shown below. Figure 8The result of point cloud smoothing calculated using the Asian Dragon normal with a radius of 0.15 mm is shown below. Figure 9 As shown, the point cloud smoothing result calculated using the Lucy normal with a radius of 1.0 mm is as follows. Figure 10 Show.

[0166] from Figure 8 , Figure 9 and Figure 10 It can be seen that after point cloud normal calculation and point cloud smoothing, the surface details of the point cloud model are clearer, the smoothness is significantly improved, the influence of noise points is effectively reduced, and surface discontinuities are repaired. Furthermore, while maintaining the overall shape characteristics of the model, edge transitions are more natural, highlighting the important role of normal calculation and smoothing in improving point cloud data quality and optimizing model surface characteristics. This indicates that the adopted method can effectively improve the accuracy and visual effect of point cloud processing, providing a higher-quality data foundation for subsequent applications such as 3D reconstruction and feature extraction.

[0167] The above description is merely a preferred embodiment of the present invention and does not constitute any limitation on the present invention. Any simple modifications, alterations, or equivalent structural changes made to the above embodiments based on the technical essence of the present invention shall still fall within the protection scope of the present invention.

Claims

1. A point cloud processing method based on hardware-accelerated ray tracing, characterized in that, The method includes the following steps: Step S1: Based on ray tracing, and based on the reverse query idea, create a reverse neighborhood search formula based on hardware-accelerated ray tracing, and map the neighborhood search to hardware-accelerated ray tracing. Step S2: Create a ray tracing acceleration structure based on point cloud data to provide data structure support for ray tracing; Step S3: Using the reverse neighborhood search formula created in step S1, load the sample points and query points into the ray tracing acceleration structure created in step S2, design a ray query algorithm, and implement the neighborhood search based on hardware-accelerated ray tracing in the computation shader. Step S4: Store the neighborhood search results from step S3 in a register, calculate the point cloud normal using principal component analysis, and smooth the point cloud using moving least squares.

2. The point cloud processing method based on hardware-accelerated ray tracing according to claim 1, characterized in that: Step S1 describes creating a reverse neighborhood search formula based on hardware-accelerated ray tracing, using the reverse query concept, and mapping the neighborhood search to hardware-accelerated ray tracing. The specific method is as follows: Step S101, determine the maximum neighborhood radius r of the query point in the neighborhood search max r max as the size of the AABB bounding box; Step S102: Take each query point as the starting point of the ray, with arbitrary ray direction. Ray tracing performs a radius search of the query point based on BVH, according to the formula: determine whether the maximum neighborhood radius r is satisfied max and further determine in which several AABBs of the BVH each query point is located; wherein I q (s) represents whether the sample point s satisfies the query condition of the query point q, when I q (s) = 1, it represents that the sample point s satisfies the query condition of the query point q; when I q (s) = 0, it represents that the sample point s does not satisfy the query condition of the query point q; d(s, q) is a distance function for calculating the distance from the sample point s to the query point q.

3. A point cloud processing method based on hardware-accelerated ray tracing as described in claim 1, characterized in that: Step S2 describes creating a ray tracing acceleration structure based on point cloud data to provide data structure support for ray tracing. The specific process is as follows: Step S201: Construct the underlying acceleration structure. Each instance of the underlying acceleration structure corresponds to a point cloud in the scene. Step S202: Based on the indexing and instantiation of the underlying acceleration structure, construct the top-level acceleration structure.

4. A point cloud processing method based on hardware-accelerated ray tracing as described in claim 3, characterized in that: The specific process of constructing the underlying acceleration structure in step S201 is as follows: Step S2011: Transfer the vertex data of the model from memory to video memory through the storage buffer; Step S2012, bind the vertex data into the vertex buffer of the underlying acceleration structure, and create an AABB bounding box with the maximum neighborhood radius r centered on each point in the point cloud max AABB bounding box for the bounding box size; Step S2013: Transfer the information of the underlying acceleration structure to the top-level acceleration structure.

5. A point cloud processing method based on hardware-accelerated ray tracing as described in claim 3, characterized in that: The specific process of constructing the top-level acceleration structure based on the indexing and instantiation of the underlying acceleration structure in step S202 is as follows: Step S2021: Each top-level acceleration structure instance references a different number of bottom-level acceleration structures, and describes the position and orientation of the bottom-level acceleration structure instance in the scene through a unique transformation matrix; Step S2022: Convert the created low-level acceleration structure instance and its transformation information into the instance descriptor of the high-level acceleration structure, and complete the construction of the BVH space index structure of the entire scene.

6. A point cloud processing method based on hardware-accelerated ray tracing as described in claim 1, characterized in that: The ray query algorithm designed in step S3 is as follows: Step S301: Read the point cloud and construct an AABB bounding box; Step S302: Construct an acceleration structure using AABB bounding boxes; Step S303: Perform neighborhood search using ray tracing; Step S304: Obtain the first AABB intersection point for each query point; Step S305: Morton sort is used based on the intersection of AABB; Step S306: Restart ray tracing; Step S307: Perform a rejection operation; Step S308: Obtain neighborhood points; Step S309: Calculate the point cloud normals and perform smoothing.

7. A point cloud processing method based on hardware-accelerated ray tracing as described in claim 8, characterized in that: The specific process of using ray tracing for neighborhood search in step S303 is as follows: Step S3031: Globally call the index to obtain the ID of each point; Step S3032: The ray initialization function initiates ray query; Step S3033: Accelerated structure for ray query traversal.

8. A point cloud processing method based on hardware-accelerated ray tracing as described in claim 1, characterized in that: The specific process of calculating the point cloud normal using principal component analysis in step S4 is as follows: Step S4A1: For each point in the point cloud, select all points within its neighborhood and calculate the barycenter coordinates. Among them, P i Let represent the coordinates of the i-th point, k be the number of neighboring points, and i be a natural number from 1 to k. Step S4A2: Calculate the covariance matrix C of the points based on the obtained barycenter coordinates: Among them, P i Let i represent the coordinates of the i-th point, where i is a natural number from 1 to k. Step S4A3: Solve for the eigenvalues ​​and eigenvectors of the covariance matrix C to capture the distribution characteristics of neighborhood points relative to the mean; Step S4A4: Select the eigenvector corresponding to the smallest eigenvalue as the normal direction of that point.

9. A point cloud processing method based on hardware-accelerated ray tracing as described in claim 1 or 8, characterized in that: The specific process of smoothing point clouds using the moving least squares method described in step S4 is as follows: Step S4B1: Calculate the weight w of the neighboring points corresponding to the query point. i : Among them, P i P represents the coordinates of the i-th neighboring point. j Represents the i-th neighborhood point P i The corresponding query point, σ is a parameter controlling the rate of weight descent; weight w ij This indicates a neighborhood point to the query point P. i Smoothing weights, w i The smaller the value, the less smooth the surface. Step S4B2: With the query point as the center, and the normal of the plane formed by the query point and its neighboring points as the z-axis, define the normalized vector perpendicular to the normal as the y-axis vector v. Obtain the x-axis vector u through the cross product of the normal and the y-axis vector v, and construct the local coordinate system (u,v). Step S4B3: Project the coordinates of the neighboring points from the point cloud coordinate system to the local coordinate system (u,v); for the i-th neighboring point P i Its x-coordinate in the local coordinate system i Represented as: x i =(P i -P j )·u Its y-coordinate in the local coordinate system i Represented as: y i =(P i -P j )·v Step S4B4: Construct the coefficient matrix f: Where m represents the number of neighboring points; Step S4B5: Combine the local coordinates u and v of the neighboring points into matrix A: Where, x i λ x represents i The power of λ, where i takes the value of a natural number from 1 to m, and λ takes the value of a natural number from 1 to σ; Step S4B6: Solve for the coefficient vector c using the least squares method: min c =‖Ac-f 2 The coefficients of the polynomial fitting are obtained, and the coefficient vector is multiplied by the point cloud normal and coordinates to achieve point cloud smoothing.