An optimization method for farthest point sampling of point cloud data
By dividing point cloud data into locally clustered point cloud buckets and optimizing the sampling process using the KD tree algorithm, the problems of high time complexity and high hardware power consumption in large-scale point cloud data processing are solved, and efficient point cloud data processing is achieved.
Patent Information
- Application Number
- CN202310252721.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-03-07
- Publication Date
- 2026-01-27
- Estimated Expiration
- 2043-03-07
AI Technical Summary
Existing farthest point sampling algorithms suffer from high time complexity, low computational efficiency, and high hardware power consumption when processing large-scale point cloud data, and cannot meet real-time requirements.
Point cloud data is divided into multiple spatially independent and locally clustered point cloud buckets. The KD tree algorithm is used for segmentation, and the state information of the point cloud buckets is updated through merging calculations and implicit calculation conditions. Only necessary point cloud buckets are traversed to select sampling points, thereby reducing time complexity and hardware power consumption.
By optimizing the sampling method for point cloud data, the time complexity was reduced, the computational efficiency and memory access time clustering were improved, thus meeting the needs of real-time processing of large-scale point cloud data.
Smart Images

Figure CN116612144B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the technical field of point cloud data sampling, and specifically to an optimized method for sampling the farthest point of point cloud data. Background Technology
[0002] Point clouds are collections of points representing physical objects or 3D scenes. Point clouds can reflect the spatial characteristics of objects, and therefore have wide applications in fields such as robotics, autonomous driving, augmented reality (AR), and virtual reality (VR). Similar to image processing, point cloud processing also has various specific applications, such as simultaneous localization and mapping (SLAM), object classification, semantic segmentation, and object detection.
[0003] However, typical autonomous driving scenarios require the program to process a point cloud consisting of approximately 120,000 points within 1 / 10 of a second, placing high demands on the real-time performance of point cloud processing. Furthermore, with technological advancements, the scale of the point clouds that need to be processed is continuously increasing. Currently, the latest generation of sensors generates up to 4.8 million points per second. Such a large-scale point cloud further places higher demands on the real-time performance, computational efficiency, and hardware power consumption of point cloud processing.
[0004] In large-scale point cloud processing, downsampling is an essential step. Farthest-point sampling is one of the most commonly used downsampling algorithms, preserving the original spatial features of the point cloud to the greatest extent possible. Currently, farthest-point sampling often employs a brute-force algorithm with a double loop, traversing the entire point cloud in each sampling iteration, calculating the distance from each point cloud to the sampling set, and selecting the maximum distance as the sampling point. While simple, this method has high computational time complexity and low processing efficiency. Related technologies use GPUs or dedicated accelerators to handle the second loop in the above algorithm, improving computational efficiency to some extent. However, when the point cloud is large, because the above algorithms do not effectively utilize the locality of point cloud data, both methods require frequent memory reads and writes to read and write point cloud data, thus increasing computational latency and hardware power consumption. Summary of the Invention
[0005] To address the high time complexity of existing point cloud farthest point sampling methods and the memory performance bottleneck caused by deploying the algorithms on hardware, this invention provides an optimized method for sampling the farthest point of point cloud data.
[0006] The technical solution adopted by this invention to solve the technical problem is as follows:
[0007] The point cloud data is divided into multiple spatially independent and locally clustered point cloud buckets; a random point from one point cloud bucket is randomly selected as the initial sampling set; K rounds of sampling begin, wherein, in the i-th round of sampling iteration, firstly, the state information of the point cloud bucket is updated according to the sampling results of the i-1 rounds, then, the local farthest point with the maximum distance in each point cloud bucket is selected as the sampling point for this round, and finally, this sampling point is added to the sampling set; the k+1 points in the sampling set are the sampling results.
[0008] Preferably, the method for dividing a point cloud into multiple spatially independent and locally clustered point cloud buckets includes: recursively dividing the point cloud into multiple point cloud subsets using a KD-tree algorithm, and storing the three-dimensional boundary information, local far point information, local far point distance information, point cloud information belonging to this point cloud subset, and merged point set of each subset; traversing the point cloud data, calculating the range of each dimension of the point cloud data, and calculating the arithmetic mean of the projected distance of the point cloud data in this dimension; dividing the point cloud data into two parts based on this arithmetic mean, and recursively dividing them to a preset maximum depth H to obtain 2 H Create 2 spatially independent and locally clustered subsets of point clouds. H Each point cloud bucket object data structure stores the points in each point cloud subset sequentially into the corresponding point cloud bucket object data structure, obtains the maximum and minimum values of each dimension of the point data in each point cloud subset, updates the three-dimensional boundary information of the point cloud bucket object data structure, sets the local far point and local far point distance to the initial state, and sets the merged point set to empty.
[0009] Furthermore, during the i-th round of sampling iteration, the state information of the point cloud bucket is updated based on the sampling results of the (i-1)-th round. The method includes: updating the local far point and local far point distance information of the point cloud bucket object based on historical information. First, it is determined whether the point cloud bucket and the sampling point s(i-1) of the (i-1)-th round satisfy the merging calculation condition. If not, s(i-1) is added to the merging point set, and the distance between all points in the merging point set and the member points of the point cloud bucket is calculated. The member point with the maximum distance is selected as the local far point of the point cloud bucket, and the maximum distance is used as the local far point distance of the point cloud bucket. The merging point set is then cleared. Otherwise, it is determined whether the point cloud bucket and the sampling point s(i-1) of the (i-1)-th round satisfy the implicit calculation condition. If not, s(i-1) is added to the merging point set.
[0010] Furthermore, the process of determining the merging calculation conditions includes: calculating the distance between the local far point of the point cloud bucket and the sampling point s(i-1) of round i-1, denoted as the current maximum sampling distance; determining whether the distance between the local far point of the point cloud bucket is valid and less than the current maximum sampling distance; if so, the merging calculation conditions are met; otherwise, they are not met.
[0011] Furthermore, the implicit computation condition judgment process includes: calculating the distance between the three-dimensional boundary information of the point cloud bucket and the sampling point s(i-1) of round i-1, denoted as the current sampling boundary distance; judging whether the local far point distance of the point cloud bucket is valid and less than the current sampling boundary distance; if so, the implicit computation condition is satisfied; otherwise, it is not satisfied.
[0012] The beneficial effects of this invention are as follows: This invention utilizes the KD-tree algorithm to divide the point cloud into multiple point cloud subsets. In the main algorithm process, it only needs to traverse the point cloud bucket object data structure corresponding to these subsets. Furthermore, it only needs to traverse all points in the point cloud buckets that do not meet the merging calculation conditions. Compared to related methods that always require traversing all points in the entire point cloud, this reduces time complexity. Simultaneously, this method combines the distance calculations of the point cloud bucket object data structures that meet the merging calculation conditions and the corresponding sampling points (i.e., the aforementioned "merging points") into a single calculation, making the calculation process and the resulting memory access time-clustered, thereby reducing computational latency and hardware power consumption. Attached Figure Description
[0013] Figure 1 This is a flowchart of the optimized method for sampling the farthest point of point cloud data provided by the present invention.
[0014] Figure 2 This is a schematic diagram of a process for dividing a point cloud into multiple spatially independent and locally clustered point cloud buckets according to an embodiment of the present invention.
[0015] Figure 3 This is a schematic diagram of the operation process of the first sampling iteration according to an embodiment of the present invention.
[0016] Figure 4 This is a partial schematic diagram of the second sampling iteration process according to an embodiment of the present invention. Detailed Implementation
[0017] The technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. It should be noted that the described embodiments are only some embodiments of this application, and not all embodiments. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without creative effort are within the protection scope of the present invention.
[0018] Reference Figure 1The flowchart shown illustrates an optimized method for sampling the farthest point in point cloud data. The method includes: first, dividing the unordered point cloud data into multiple spatially independent and locally clustered point cloud bucket structures; then, during each round of sampling point generation, updating information such as the local farthest point and its distance to each bucket based on historical data relationships, according to the proposed merging and implicit computation rules; finally, traversing the local farthest points of each bucket to generate sampling points for one round of sampling. The process terminates when the required number of sampling points is reached. This method reduces the time complexity of sampling the farthest point in point cloud data and improves the time efficiency of computation and memory access.
[0019] Figure 2 This is a flowchart illustrating an embodiment of the present invention, illustrating the process of dividing a point cloud into multiple spatially independent and locally clustered point cloud buckets. For ease of illustration, this embodiment uses a two-dimensional point cloud. It should be emphasized that the typical application of this invention is often three-dimensional point clouds, and the method is similar. Applying this invention to... Figure 2 (a) shows a 2D point cloud composed of 32 points. When using the KD-tree algorithm to segment the point cloud, the maximum recursion depth H = 2 is specified by parameters. In the initial segmentation, the x-dimensional coordinates are used as the segmentation dimension, and the arithmetic mean of the coordinates in that dimension is taken, resulting in x = 30. Then, using x = 30 as a threshold, points with x-coordinates less than or equal to this threshold form one subset of the point cloud, while points with x-coordinates greater than this threshold form another subset. For example... Figure 2 As shown in (b), the point cloud is divided into two subsets by the dashed lines in the diagram, with a recursion depth of 1. Then, the left and right subsets are recursively divided into two new subsets along the y-axis. The arithmetic mean of the coordinates of all points in the left subset along the y-axis is calculated as y = 33, while the arithmetic mean of the coordinates of the right subset along the y-axis is calculated as y = 32. Figure 2 As shown in (c), the left and right point sets are segmented using thresholds of y = 33 and y = 32, respectively. At this point, the recursion depth is 2, the recursion process ends, and the entire point cloud is divided into 4 point cloud subsets, as follows: Figure 2As shown in (d). For ease of description and management, the four point cloud subsets are sequentially numbered and named: Point Cloud Bucket 0, Point Cloud Bucket 1, Point Cloud Bucket 2, and Point Cloud Bucket 3. After obtaining the required point cloud subsets, point cloud bucket object data structures are established for each of the four subsets. The stored content includes: the three-dimensional boundary information of the point cloud subset, local far point information, local far point distance information, point cloud information belonging to this subset, and the merged point set. After completion, four point cloud bucket object data structures are obtained. The initialization method for the point cloud bucket object data structure is as follows: Initialize the two-dimensional boundary information as the maximum and minimum values of the x and y coordinates in the point cloud subset; initialize local far points as invalid points; initialize the distance of local far points as an invalid value (generally selected as the maximum value of a 32-bit signed integer, 2147483647); initialize the point cloud coordinate information as the coordinates of each point belonging to the corresponding point cloud subset; initialize the distance information from each point in the point cloud to the sampling set as an invalid value (generally also selected as 2147483647); initialize the merged point set as an empty set.
[0020] Figure 3 This is a schematic diagram illustrating the operation process of the first sampling iteration in one embodiment of the present invention. Figure 2 After the sample data, KD-tree segmentation, and point cloud bucket object data structure initialization are completed, the sampling set will be initialized, and a point will be randomly selected from the point cloud and added to the sampling set. For example... Figure 3 As shown in (a), the star point is the first selected sampling point s(0). Then, the first round of sampling iteration is entered to select the first sampling point s(1). Since the point cloud bucket structure is only initialized and never updated, the maximum distance still retains the invalid value assigned during initialization. None of the point cloud bucket structures meet the merging calculation conditions. The first sampling point will be added to the merging point set of each point cloud bucket structure, and the information will be updated by traversing each point cloud bucket structure. Specifically, the coordinates of the point cloud bucket points of each point cloud bucket structure will be read out one by one, and then the merging point of the current point cloud bucket structure will be read out one by one (in this example, there is only one merging point s(0)). The distance from the point cloud bucket point to the merging point will be calculated using the following distance formula: d(x m y n )=∑ 维度i (x m,i -y n,i ) 2
[0021] Where d(·,·) represents the distance to be found; x m y n These represent the m-th point cloud bucket point and the n-th merged point, respectively; x m,i y n,i Let represent the coordinates of the m-th point cloud bucket point and the n-th merged point in the i-th dimension, respectively.
[0022] The minimum distance from the given point bucket to each merged point is taken and compared with the currently stored distance information from the given point bucket to the sampling set. The smaller of the two distances is used to update the distance from the given point bucket to the sampling set, as expressed by the following formula:
[0023]
[0024] d samp (x m )=min(d samp (x m ), d now (x m ))
[0025] Where, d now (x m ) represents the current m-th point in the cloud bucket, x. m Distance to the merged point set; d samp (x m ) represents the point x stored in the point cloud bucket structure. m Distance information to the sampling set.
[0026] During the update, record the point cloud bucket point in each point cloud bucket structure that is farthest from the sampling set. Using this point cloud bucket point and its corresponding distance to the sampling set, update the local farthest point and local farthest point distance of that point cloud bucket, respectively.
[0027]
[0028] dist k =d now (FP k )
[0029] Among them, FP k dist is the local far point of the k-th point cloud bucket structure; k Let be the local far point distance of the k-th point cloud bucket structure.
[0030] like Figure 3 The triangle markers in (b) are the local far points of each point cloud bucket structure calculated after updating the four point cloud bucket structures. The corresponding local far point distances are shown in the figure.
[0031] The sampling point s(1) obtained in this round is the local farthest point of the point cloud bucket structure with the largest local farthest point distance among the four point cloud bucket structures, i.e.
[0032] maxIdx = argmax k (dist k )
[0033] s(i)=FP maxIdx
[0034] Where maxIdx is the index of the point cloud bucket structure with the largest maximum distance, and s(i) is the sampling point in the i-th round of sampling.
[0035] like Figure 3 In (c), the local far point distance of the third point cloud bucket structure is 57.45, which is the largest among the four point cloud bucket structures. Therefore, the local far point of the third point cloud bucket structure, i.e., the star-shaped marker point in the figure, is selected as the first round sampling point s(1) and added to the sampling set. The first round of sampling ends here. The selected local far point becomes a sampling point, so the distance from this point to the sampling set becomes 0, and correspondingly, the local far point distance of the point cloud bucket structure needs to be updated to 0.
[0036] Figure 4 This is a partial schematic diagram of the second sampling iteration process according to an embodiment of the present invention. Figure 2 The sample point cloud data, in the first sampling iteration, Figure 3 The point marked with an x-shape in (c) is selected, that is... Figure 4 The star-shaped markers in the data. During the second sampling iteration, it is first necessary to traverse each point cloud bucket structure and determine whether each point cloud bucket structure satisfies the merging condition for the first round of sampling points s(1). For example... Figure 4 (a) When judging the merging condition for the 0th point cloud bucket structure, it is necessary to calculate the distance from the first round of sampling point to the local far point of the point cloud bucket, which is the so-called "current sampling maximum distance". In the figure, it is the distance from the star marker point to the triangle marker point. According to the distance formula of the aforementioned point, it is 68.12. Since this distance is greater than the local far point distance of the current 0th point cloud bucket structure of 22.56 (this value was calculated in the first round of sampling), the merging calculation condition is met. This means that the addition of this sampling point will not cause the local far point and the distance of the local far point of this point cloud bucket structure to change. The update operation of the distance of the points in this point cloud bucket structure can be merged into the future sampling iteration. Then it is necessary to judge whether the implicit calculation condition is met. Before judging, it is necessary to calculate the distance from the first round of sampling point s(1) to the two-dimensional boundary of the point cloud bucket structure, which is the so-called "current sampling boundary distance". (For the i-th round of sampling) the calculation formula is:
[0037]
[0038] Where, d Bo u nding(s(i-1), bk) represents the current sampling boundary distance from the (i-1)th round sampling point s(i-1) to the point cloud bucket structure bk. If the (i-1)th round sampling point s(i-1) is in bk or on its two-dimensional boundary, the value is 0; otherwise, if s(i-1) is outside bk, the minimum distance from s(i-1) to all points on the boundary of bk is taken as the current sampling boundary distance. In actual calculation, the distance is obtained by comparing the stored boundary information of the point cloud bucket, i.e., the maximum and minimum values of each point in the point cloud subset corresponding to the point cloud bucket, with the corresponding coordinates of s(i-1), and then by classification discussion and calculation.
[0039] Figure 4 In the example shown in (a), the sampling point s(1) (i.e., the star point) in the first round is outside the 0th point cloud bucket structure. The distance between s(1) and the lower right corner of the two-dimensional boundary of the point cloud bucket structure is calculated to be 41.87, which is the current sampling boundary distance. Therefore, the current sampling boundary distance is also greater than the local far point distance of the point cloud bucket structure, satisfying the implicit calculation condition. This means that the distance from s(1) to all points in the point cloud bucket structure (with the current sampling boundary distance as the lower bound) is greater than the distance from each point in the point cloud bucket structure to the current sampling set (with the local far point distance of the point cloud bucket structure as the upper bound). Therefore, adding s(1) to the sampling set will not affect the distance from any point in the current point cloud bucket to the sampling set. Thus, there is no need to update the distance information of the points in the point cloud bucket structure with this sampling point. Therefore, no operation is required, and the calculation of the next point cloud bucket structure can continue, saving calculation time and space.
[0040] Figure 4 (b) shows the calculation process and results of updating the first point cloud bucket structure during the second round of sampling. It is necessary to determine whether the point cloud bucket structure and the sampling point s(1) of the first round meet the merging calculation condition and the implicit calculation condition. The merging calculation condition needs to be determined by calculating the current maximum sampling distance, which is 41.29; while the local far point distance of the first point cloud bucket structure is 34.93. The local far point distance is less than the current maximum sampling distance, which meets the merging calculation condition. Then, the current sampling boundary distance is calculated, which is the length of the perpendicular line segment from the star point in the figure to the lower boundary of the point cloud bucket, which is 32. The maximum distance is greater than the current sampling boundary distance, so the implicit calculation condition is not met. Therefore, s(1) needs to be added to the merging point set of the point cloud bucket structure, and the distance will be updated together when the merging calculation is not met in a future round of sampling, so that the calculation memory access has time aggregation. However, the local far point and the local far point distance of the point cloud bucket remain unchanged, and then the calculation of the next point cloud bucket structure can be continued directly.
[0041] The present invention has been described in detail above using specific embodiments. It should be noted that the above content is merely a specific embodiment of the present invention and should not be used to limit the scope of the invention. Any modifications, substitutions, or improvements within the design concept of the present invention should be within the protection scope of the present invention.
Claims
1. An optimization method for sampling the farthest point in point cloud data, characterized in that, Includes the following steps: The point cloud data is divided into multiple spatially independent and locally clustered point cloud buckets. Random points from one point cloud bucket are randomly selected as the initial sampling set. K rounds of sampling begin. In the i-th round of sampling iteration, firstly, the state information of the point cloud bucket is updated based on the sampling results of the (i-1)-th round. Then, the local farthest point with the maximum distance in each point cloud bucket is selected as the sampling point for this round. Finally, this sampling point is added to the sampling set. The K+1 points in the sampling set are the sampling results. The point cloud is divided into multiple spatially independent and locally clustered point cloud buckets. Specifically, this involves: recursively dividing the point cloud into multiple point cloud subsets using the KD-tree algorithm, and storing the 3D boundary information, local far point information, local far point distance information, point cloud information belonging to this subset, and the merged point set for each subset; traversing the point cloud data, calculating the range of each dimension of the point cloud data, and calculating the arithmetic mean of the projected distances of the point cloud data in this dimension; dividing the point cloud data into two parts based on this arithmetic mean, and recursively dividing them to a preset maximum depth H to obtain 2. H A spatially independent and locally clustered subset of point clouds; create 2 H Each point cloud bucket object data structure stores the points in each point cloud subset sequentially into the corresponding point cloud bucket object data structure, obtains the maximum and minimum values of each dimension of the point data in each point cloud subset, updates the three-dimensional boundary information of the point cloud bucket object data structure, sets the local far point and local far point distance to the initial state, and sets the merged point set to empty; Based on the sampling results of round i-1, update the state information of the point cloud bucket. Specifically, this includes updating the local far point and local far point distance information of the point cloud bucket object based on historical information. First, determine whether the point cloud bucket and the sampling point s(i-1) of round i-1 meet the merging calculation conditions. If not, add s(i-1) to the merged point set, and calculate the distance between all points in the merged point set and the member points of the point cloud bucket. Select the member point with the maximum distance as the local far point of the point cloud bucket, and use the maximum distance as the local far point distance of the point cloud bucket. Clear the merged point set. Otherwise, determine whether the point cloud bucket and the sampling point s(i-1) of round i-1 meet the implicit calculation conditions. If not, add s(i-1) to the merged point set.
2. The optimization method for sampling the farthest point of point cloud data according to claim 1, characterized in that, The process of determining the merging calculation conditions includes: calculating the distance between the local far point of the point cloud bucket and the sampling point s(i-1) of round i-1, denoted as the current maximum sampling distance; determining whether the distance between the local far point of the point cloud bucket is valid and less than the current maximum sampling distance; if so, the merging calculation conditions are met; otherwise, they are not met.
3. The optimization method for sampling the farthest point of point cloud data according to claim 1, characterized in that, The implicit computation condition judgment process includes: calculating the distance between the three-dimensional boundary information of the point cloud bucket and the sampling point s(i-1) of round i-1, denoted as the current sampling boundary distance; judging whether the local far point distance of the point cloud bucket is valid and less than the current sampling boundary distance; if so, the implicit computation condition is satisfied; otherwise, it is not satisfied.
Citation Information
Patent Citations
Point cloud sampling method, device and equipment and computer readable storage medium
CN113674425A
Deep learning-based retention density point cloud compression method
CN114286103A