Large-scale point cloud management method of point cloud data structure based on three-layer mixed index
By adopting a three-layer hybrid index point cloud data structure and multi-threaded concurrent design in large-scale point cloud management, the problems of low construction efficiency, slow search speed and large memory usage in the existing technology are solved, and the fast and efficient processing and storage of point cloud data are achieved.
Patent Information
- Application Number
- CN202311065410.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-08-23
- Publication Date
- 2025-02-25
AI Technical Summary
The existing technology has problems such as low construction efficiency, slow search speed and large memory usage in large-scale point cloud management.
The point cloud data structure based on three-layer hybrid index is adopted, combined with the improved raster method, quadtree method and k-d tree method, efficient index establishment, point query and neighborhood search functions are realized, and the storage and processing efficiency of point clouds are optimized through multi-threaded concurrent design, binary storage and floating-point numerical compression methods.
It improves the storage, query and processing efficiency of point cloud data, reduces memory usage, and realizes fast and high-precision processing of large-scale point clouds.
Smart Images

Figure FT_1 
Figure FT_2 
Figure FT_3
Abstract
Description
Technical Field
[0001] The invention belongs to the field of three-dimensional point cloud data processing and relates to a large-scale point cloud management method based on a point cloud data structure with three-layer hybrid indexes. Background Art
[0002] With the development of machine vision-based three-dimensional scanning technology, the dense point cloud obtained can represent the morphological information of the object surface. The amount of complete point cloud data obtained by measurement can be as high as hundreds of millions. Existing computing equipment cannot meet the requirements of fast storage, processing and feature extraction of point clouds of such a scale. This requires preprocessing of the point cloud while ensuring accuracy, and then designing a fast point cloud processing method to achieve fast and high-precision processing of large-scale point clouds.
[0003] The data volume of hundreds of millions of three-dimensional point clouds will reach GB (109 bytes), which is inconvenient to store and manage directly. Moreover, the point cloud obtained by three-dimensional scanning equipment is a spatially disordered point cloud, which only contains three-dimensional coordinates and has no topological relationship. Its spatial information cannot be directly obtained. This requires designing an efficient point cloud data structure based on the location information of the point cloud, indexing the point cloud in blocks, and solving the problem of fast storage, query and retrieval of point cloud data. Therefore, in order to achieve fast and high-precision processing of large-scale point clouds, it is urgent to design an efficient point cloud data structure to manage the point cloud. Summary of the invention
[0004] In response to the need for improvement in the prior art, the present invention provides a large-scale point cloud management method based on a point cloud data structure with a three-layer hybrid index, thereby solving the problems of low construction efficiency, slow search speed and large memory usage of the existing point cloud data structure in large-scale point cloud management.
[0005] To achieve the above object, the present invention provides a large-scale point cloud management method based on a point cloud data structure with a three-layer hybrid index, comprising:
[0006] S1. The point cloud data structure based on the three-layer hybrid index is composed of the improved grid method, quadtree method and kd tree method;
[0007] S2. The point cloud data structure based on the three-layer hybrid index implements four commonly used interfaces, namely index establishment, search point query, R neighborhood search and K neighborhood search, realizing efficient point cloud data structure index establishment, point query and neighborhood search functions;
[0008] S3. Implement point cloud multi-threaded concurrent design based on the thread management library in the C++ standard library;
[0009] S4. Based on binary storage and floating point value compression method, the compressed storage of point cloud is realized.
[0010] Preferably, the point cloud data structure based on the three-layer hybrid index is composed of a hybrid of an improved grid method, a quadtree method and a kd tree method, specifically:
[0011] S21. Use the improved grid method to achieve fast point cloud segmentation. Use the grid to evenly divide the point cloud into blocks at 90° intervals. For any point P, the position of the grid is determined according to the x-coordinate and y-coordinate of the query point. Four grid point sets are used to represent:
[0012] Φ1={P(x,y,z)|y≥x&y≥0}
[0013] Φ2={P(x,y,z)|y<x&x≤0}
[0014] Φ3={P(x,y,z)|y≥x&y≤0}
[0015] Φ4={P(x,y,z)|y<x&x≥0}
[0016] S22. The point cloud after grid division is distributed more evenly, but the amount of point cloud data in each grid is still in the tens of millions. The quadtree index can be used to spatially segment the point cloud data to further reduce the amount of point cloud data. For example, to avoid the quadtree being too deep and having too many nodes, the spatial scale of each node being too fine, the tree shape being destroyed, and the huge backtracking cost caused by the storage and recording of nodes, the termination condition of the quadtree index is set to the number of point clouds in the node being less than 100,000;
[0017] S23. Since the kd tree has obvious advantages in searching medium-sized point clouds (greater than 10,000 points), in order to speed up the query and neighborhood search, the kd tree can be used in the quadtree node to accelerate the retrieval. When performing a neighborhood search, if the number of points in the leaf node is greater than the threshold, a kd tree is established for neighborhood search, otherwise the traversal method is used to directly search.
[0018] Preferably, the point cloud data structure based on the three-layer hybrid index implements four commonly used interfaces, namely index establishment, search point query, R neighborhood search and K neighborhood search, and realizes efficient point cloud data structure index establishment, point query and neighborhood search functions, specifically:
[0019] S31. Index establishment algorithm process is as follows Figure 2As shown in the figure, the process of index establishment is to divide the unordered data points into corresponding grid nodes according to their spatial positions and then distribute them to the leaf nodes of the quadtree. The input is a point set. In the management node, the bounding box of the point set is first calculated, and the center and side length of the bounding box are recorded. Then, it is divided into four point sets according to the coordinate information of each point, and then each point set is passed to the corresponding grid node to establish a grid index. The grid index also needs to record the bounding box information of the corresponding point set, and select the subsequent quadtree segmentation axis according to the spatial position of the grid. The quadtrees in nodes 1 and 3 use the x-axis and z-axis for point cloud segmentation, and the quadtrees in nodes 2 and 4 use the y-axis and z-axis for segmentation. In the process of establishing the quadtree index, the positional relationship between the point to be divided and the center of the bounding box of the current quadtree node is passed to the corresponding child node until the point cloud data in the current node is less than the set threshold, the subdivision is stopped, the leaf node is established, and the establishment of the mixed index is completed;
[0020] S32. Search point query algorithm flow is as follows Figure 3 As shown, according to the bounding box information and space segmentation information stored in each node, the quadtree leaf node where the search point is located is found, and the pointer of the leaf node is returned;
[0021] S33. The algorithm flow of the mixed index R neighborhood search is as shown in the attached Figure 4 As shown, first query the leaf node where the search point P is located, and then continuously push all the parent nodes and four child nodes of the current node into the backtracking queue. When a child node enters the queue, it is necessary to determine whether the leaf node intersects with the neighborhood sphere based on the shortest distance from the search point to the bounding box. Only if it intersects will it be added to the queue for backtracking. Each time backtracking occurs, a node is taken out of the queue and it is determined whether the node is a leaf node. If it is a leaf node and the number of points in the leaf node is greater than ten thousand, a kd tree is established in the leaf node to accelerate the neighborhood search, otherwise a traversal search is performed directly. After completing the search of the grid where the search point is located, it is also necessary to determine whether a supplementary search of the other three grids is required based on the positional relationship between the search point and the other three grids;
[0022] S34. The algorithm flow of the mixed index K-neighbor search is as shown in the attached Figure 5As shown, this process is similar to the R neighborhood search. The difference is that since the K neighborhood search does not have a fixed-size neighborhood ball, but provides a search point number k, it is necessary to maintain a large top heap priority queue during the search process. The priority queue stores the points with the smallest distance to the search point among the points that have been searched so far, and sorts them according to the distance to the search point. When the number of elements in the priority queue is less than k, all traversed points are stored in the queue. When the number of elements is greater than or equal to k, the top data of the stack is the farthest point in the current search process, and the distance from this point to the search point is the current neighborhood ball radius. The dynamic radius is used to perform the R neighborhood search, and the priority queue is updated according to the search results;
[0023] Preferably, the point cloud multi-threaded concurrent design is implemented based on the thread management library in the C++ standard library, specifically:
[0024] S41. Use multithreading to accelerate index establishment. During the index establishment process, each node division will divide the data into multiple blocks, and then each block of data will be transferred to the corresponding node for node establishment. In this process, the sub-node pointer and the point cloud data controlled by it can be passed to the current idle thread for index establishment. Since there is no data interaction between different nodes, the process is thread-safe and can fully utilize the computing performance of the CPU.
[0025] S42. In the process of neighborhood search, since the neighborhood search needs to maintain a unique stack and priority queue, and the interface needs to be frequently called for operation during the search process, any concurrent operation on these memory spaces is unsafe, so the neighborhood search does not have the conditions to achieve concurrency. When multiple threads call the same data structure at the same time, if only the nodes are accessed, the concurrent operation of the structure is safe, and there is no need to introduce mutex operations. However, when a thread among the multiple threads needs to establish a kd tree in the node, or add or delete data points in the node, it is necessary to add a mutex lock to the leaf node of the quadtree, and the mutex lock needs to be locked when performing modification operations, and all operations need to check the status of the mutex lock before the operation, and wait for it to be unlocked before accessing;
[0026] Preferably, based on binary storage and floating point value compression method, compression storage of point cloud is realized, specifically:
[0027] S51. Since each coordinate value in the point cloud data is a floating point data, the coordinate information of a point can be represented by three floating point data. The memory occupation of a floating point number is 4 bytes, so the memory occupation of the coordinate data of a point is 12 bytes. In binary storage, the memory of each floating point number is converted into a binary string with four bits of data, and then the string is directly written into the binary file, so that the space occupation of a point can be reduced to less than 50% of the text format;
[0028] S52. A point cloud data compression algorithm based on integer compression is proposed. A compressed floating-point type with a space of 3 bytes is designed. The binary bit corresponding to one data is 24 bits. For a signed number, the data range that can be represented is ±8388.608, which meets the general large-scale point cloud usage requirements. When compressing the original data, a single-precision floating-point data is first enlarged 1000 times, and then the floating-point data is truncated into an integer. The integer data obtained at this time is intercepted from low to high bits. 23 bits, the highest bit is the same as the sign bit of the original data. Using this method, each coordinate value can be compressed from 4 bytes to 3 bytes, reducing the memory usage by 25%. BRIEF DESCRIPTION OF THE DRAWINGS
[0029] Figure 1 A data structure class diagram of a large-scale point cloud management method based on a three-layer hybrid index point cloud data structure provided by the present invention.
[0030] Figure 2 Schematic diagram of the tree building algorithm flow.
[0031] Figure 3 Schematic diagram of the query algorithm flow.
[0032] Figure 4 This is the flow chart of the R neighborhood search algorithm.
[0033] Figure 5 This is the flow chart of the K-neighbor search algorithm. DETAILED DESCRIPTION
[0034] In order to make the purpose and technical solution of the present invention clearer, the present invention is further described in detail below with reference to the accompanying drawings and embodiments.
[0035] The embodiment of the present invention provides a large-scale point cloud management method based on a point cloud data structure of a three-layer hybrid index, comprising:
[0036] S1. Attachment Figure 1 The point cloud data structure class diagram for implementing large-scale point cloud management is shown, including the common base class DataIndex, and the derived classes ManageNode, VoxelNode, QuandNode, and QuandChild.
[0037] Specifically, all nodes have a common interface, so the entire data structure can be abstracted into a common base class DataIndex, and all actual nodes are derived from this abstract interface class. The first type is called by the user and is the management type of the entire data structure. It provides users with functional interfaces for index establishment, data query, neighborhood search, and data reading and writing, which are named ManageNode. The second type of node is a grid node, which completes the grid division of point cloud data. This node is combined with the management node as a member variable and is not open to users. Its life cycle is controlled by the management node. It also provides various functional interfaces required by the data structure and saves the bounding box information of each grid for neighborhood search pruning. This node is named VoxelNode. The third type of node is a quadtree node, which completes the quadtree division of point cloud data in each grid. This node is combined with the grid node as a member variable and is not open to users. Its life cycle is controlled by the upper node. The quadtree node is the smallest data unit of the entire data structure, and can be divided into intermediate nodes that do not contain data but only represent spatial information and leaf nodes that store data. In addition to the necessary functional interfaces, the quadtree node also needs to record the parent-child nodes, quadtree split axis information, and two-dimensional rectangular bounding box information. If it is a leaf node, it also needs to provide additional data reading functions. It is named QuandNode and QuandChild according to the different levels. The fourth type of node is the kd tree node, which is only used to accelerate the query of medium-sized data. It is established on demand during neighborhood queries and combined with the quadtree node as a member variable. Each node stores the parent-child relationship of the kd tree, split hyperplane information, and node data points.
[0038] The improved grid method is used to achieve fast point cloud segmentation. The grid is used to evenly divide the point cloud into blocks at 90° intervals. This division method avoids the time overhead of calculating the edge length of the global point cloud bounding box required by the traditional grid method, and can quickly reduce the number of point clouds in subsequent hierarchical index operations. Since the time complexity of indexing by the grid method is, and the hierarchical index tree building time is usually, the grid method segmentation can effectively reduce the time complexity to, and improve the tree building efficiency. The point cloud divided by the grid is more evenly distributed, but the amount of point cloud data in each grid is still in the tens of millions. The kd tree index is more affected by the amount of point cloud data than the quadtree and octree indexes. The tree building efficiency and neighborhood search efficiency in large-scale point clouds are not as good as the quadtree or octree indexes. The point cloud divided by the grid method has certain planar properties, so the quadtree index can be used to spatially segment the point cloud data to further reduce the amount of point cloud data. If the number of layers of the quadtree is not limited, the quadtree will be too deep and have too many nodes. In addition, the spatial scale of each node is too fine, which can easily destroy the balance of the tree. The storage and recording of nodes during the backtracking search of nodes will bring huge backtracking costs. When the number of point clouds is less than 1000, the neighborhood search efficiency of the traversal search algorithm is similar to that of all index structures, while when the number of point clouds is between 1000-100000, the kd tree has a faster and more stable neighborhood search efficiency. Therefore, in the structural design, the termination condition of the quadtree index is set to the number of point clouds in the node is less than 100000.
[0039] Since the kd tree has obvious advantages in searching medium-sized point clouds (greater than 10,000 points), in order to speed up the query and neighborhood search, the kd tree can be used in the quadtree node to accelerate the retrieval. When performing a neighborhood search, if the number of points in the leaf node is greater than the threshold, a kd tree is established for neighborhood search, otherwise the traversal method is used to search directly.
[0040] S2. The point cloud data structure based on the three-layer hybrid index implements four commonly used interfaces, namely index establishment, search point query, R neighborhood search and K neighborhood search, to achieve efficient point cloud data structure index establishment, point query and neighborhood search functions.
[0041] Specifically, the index establishment algorithm process is as follows: Figure 2As shown in the figure, the process of index establishment is to divide the unordered data points into corresponding grid nodes according to their spatial positions and then distribute them to the leaf nodes of the quadtree. The input is a point set. In the management node, the bounding box of the point set is first calculated, the center of the bounding box and the side length of the bounding box are recorded, and then it is divided into four point sets according to the coordinate information of each point, and then each point set is passed to the corresponding grid node to establish a grid index. The grid index also needs to record the bounding box information of the corresponding point set, and select the subsequent quadtree segmentation axis according to the spatial position of the grid. The quadtrees in nodes 1 and 3 use the x-axis and z-axis for point cloud segmentation, and the quadtrees in nodes 2 and 4 use the y-axis and z-axis for segmentation. In the process of establishing the quadtree index, the position relationship between the point to be divided and the center of the bounding box of the current quadtree node is passed to the corresponding child node until the point cloud data in the current node is less than the set threshold, the subdivision is stopped, the leaf node is established, and the establishment of the mixed index is completed.
[0042] The search point query of the mixed index is to find the quadtree leaf node where the search point is located based on the bounding box information and space segmentation information stored in each node, and return the pointer of the leaf node.
[0043] The R neighborhood search of the mixed index needs to first query the leaf node where the search point P is located, and then continuously push all the parent nodes and four child nodes of the current node into the backtracking queue. When the child node is queued, it is necessary to determine whether the leaf node intersects with the neighborhood sphere based on the closest distance from the search point to the bounding box. Only when it intersects will it be added to the queue for backtracking. Assuming that the center coordinate of the bounding box of the current node is C, the bounding box is a square bounding box, and the side length of the bounding box is L, the minimum distance D from the search point to the bounding box is:
[0044]
[0045] Each time backtracking, a node is taken out of the queue and it is determined whether the node is a leaf node. If it is a leaf node and the number of points in the leaf node is greater than ten thousand, a kd tree is established in the leaf node to accelerate the neighborhood search, otherwise a traversal search is performed directly.
[0046] After completing the search of the grid where the search point is located, it is also necessary to determine whether additional searches of the other three grids are required based on the positional relationship between the search point and the other three grids.
[0047] The K-neighborhood search process of the hybrid index is similar to the R-neighborhood search. The difference is that since the K-neighborhood search does not have a fixed-size neighborhood ball, but provides a number of search points k, it is necessary to maintain a large-top priority queue during the search process. The priority queue stores the points with the smallest distance to the search point among the points that have been searched so far, and sorts them according to the distance to the search point. When the number of elements in the priority queue is less than k, all traversed points are stored in the queue. When the number of elements is greater than or equal to k, the top data of the stack is the farthest point in the current search process, and the distance from this point to the search point is the current neighborhood ball radius. The dynamic radius is used to perform the R-neighborhood search, and the priority queue is updated according to the search results.
[0048] S3. Implement point cloud multi-threaded concurrent design based on the thread management library in the C++ standard library. The specific process is as follows:
[0049] The multi-threaded concurrency of the point cloud data structure is implemented using the thread management library in the C++ standard library. In the work of using indexes, there are three main usage scenarios that require concurrent operations, namely, using multi-threading to block nodes in index establishment, using multi-threading to accelerate neighborhood search in neighborhood search, and maintaining thread safety when multiple threads call the same data structure at the same time.
[0050] It is relatively simple to use multi-threading to accelerate index establishment, because during the index establishment process, each node division will divide the data into multiple blocks, and then each block of data will be passed to the corresponding node for node establishment. In this process, the child node pointer and the point cloud data it controls can be passed to the currently idle thread for index establishment. Since there is no data interaction between different nodes, the process is thread-safe and can fully utilize the CPU's computing performance.
[0051] In the process of neighborhood search, since the neighborhood search needs to maintain a unique stack and priority queue, and the interface needs to be called frequently during the search process, any concurrent operation on these memory spaces is unsafe, so the neighborhood search does not have the conditions to achieve concurrency. When multiple threads call the same data structure at the same time, if only the nodes are accessed, the concurrent operation of the structure is safe, and there is no need to introduce mutex operations. However, when a thread in the multithreading needs to establish a kd tree in the node, or add or delete data points in the node, it is necessary to add a mutex to the leaf node of the quadtree, and the mutex needs to be locked when performing modification operations, and all operations need to check the status of the mutex before the operation, and wait for it to be unlocked before accessing.
[0052] S4. Based on binary storage and floating point value compression method, the point cloud compression storage is realized. The specific process is as follows:
[0053] The compressed storage of point clouds is mainly achieved through binary storage and floating point value compression. Conventional point cloud data storage usually uses ASCII code to store the coordinates of each point as a text file. Taking a set of measured point clouds as an example, since each character of the ASCII code occupies 1 byte of memory space, the space occupied by each coordinate data ranges from 8 bytes to 11 bytes depending on the number of valid bits of the data. In addition, since the length of each coordinate value is different, spaces and line breaks are required for data segmentation, so the space occupied by a point data in the text file ranges from 27 bytes to 36 bytes. The storage space occupied by text files is large, and it needs to be operated character by character when reading and writing, which requires a lot of time cost.
[0054] In order to solve the storage problem of large-scale data, a common method is to use binary to directly store data. Since each coordinate value in the point cloud data is a floating-point data, the coordinate information of a point can be represented by three floating-point data. The memory occupation of a floating-point number is 4 bytes, and the memory occupation of the coordinate data of a point is 12 bytes. In binary storage, the memory of each floating-point number is converted into a binary string with four bits of data, and then the string is directly written into the binary file, so that the space occupation of a point can be reduced to less than 50% of the text format.
[0055] According to the actual point cloud data, the maximum value of the valid coordinates in the spatial point cloud will not exceed 4000mm, so in fact, the valid data of each coordinate value only needs four integer bits and three decimal places to complete the lossless storage of the point cloud data. Since the floating-point data in the compiler is a fixed 4-byte space, the binary storage form of single-precision floating-point data in memory is a three-level storage based on scientific notation, that is, the highest bit is the sign bit, the second highest bit after the highest bit is the exponent bit, and the remaining bits are called mantissa bits, which represent the actual data bits, so the compression of the floating-point type will have redundant data affecting storage. This paper proposes a point cloud data compression algorithm based on integer compression.
[0056] The present invention designs a compressed floating point type that occupies 3 bytes of space. The binary bit corresponding to one data is 24 bits. For a signed number, the data range that can be represented is ±8388.608, which meets the data limit requirements of the paper. When compressing the original data, a single-precision floating point data is first enlarged 1000 times, and then the floating point data is truncated into an integer. The integer data obtained at this time is intercepted from the low bit to the high bit by 23 bits, and the highest bit is the same as the sign bit of the original data. Using this method, each coordinate value can be compressed from 4 bytes to 3 bytes, so that the memory usage is reduced by 25%.
[0057] Since binary storage directly reads and writes binary code from the disk and then transfers it to the memory in a certain format, it supports reading and writing multiple bits of data at a time. It does not need to operate one character at a time and perform complex decoding like ASCII storage. Therefore, binary storage can reduce memory usage by 50% while reducing storage time by more than 95% and reading time by more than 90%.
[0058] The compression storage algorithm designed by the present invention adds a step of digital truncation encoding and decoding operation before and after binary reading and writing. Since the hard copy mechanism of the memory is used in the operation, the operation speed is extremely fast. The time difference cannot be effectively reflected in multiple repeated experiments. Therefore, the reading and writing time can be similar to that of binary storage, and the memory occupancy can be reduced to 75% of that of binary storage, achieving a better compression effect.
Claims
1. A large-scale point cloud management method based on a three-layer hybrid index point cloud data structure, characterized in that: include: S1. The point cloud data structure based on the three-layer hybrid index is composed of the improved grid method, quadtree method and kd tree method; S2. The point cloud data structure based on the three-layer hybrid index implements four commonly used interfaces, namely index establishment, search point query, R neighborhood search and K neighborhood search, realizing efficient point cloud data structure index establishment, point query and neighborhood search functions; S3. Implement point cloud multi-threaded concurrent design based on the thread management library in the C++ standard library; S4. Based on binary storage and floating point value compression method, the compressed storage of point cloud is realized.
2. The method according to claim 1 is characterized in that The point cloud data structure based on the three-layer hybrid index is composed of the improved grid method, quadtree method and kd tree method, including: S11. Use the improved grid method to achieve fast point cloud segmentation. Use the grid to evenly divide the point cloud into blocks at 90° intervals. For any point P, the position of the grid is determined according to the x-coordinate and y-coordinate of the query point. Four grid point sets are used to represent: Φ1={P(x,y,z)|y≥x&y≥0} Φ2={P(x,y,z)|y<x&x≤0} Φ3={P(x,y,z)|y≥x&y≤0} Φ4={P(x,y,z)|y<x&x≥0} S12. Use quadtree index to perform spatial segmentation on the point cloud data to further reduce the amount of point cloud data, and set the termination condition of the quadtree index to the number of point clouds in the node being less than 100,000; S13. In the quadtree node, a kd tree can be used to accelerate the retrieval. When performing a neighborhood search, if the number of leaf nodes is greater than a threshold, a kd tree is established to perform a neighborhood search. Otherwise, a traversal method is used to directly perform the search.
3. The method according to claim 2 is characterized in that The point cloud data structure based on the three-layer hybrid index implements four commonly used interfaces, namely index establishment, search point query, R neighborhood search and K neighborhood search, including: S21. The process of index establishment is to divide the disordered data points into corresponding grid nodes according to their spatial positions and then distribute them to the leaf nodes of the quadtree; the input is a point set, and in the management node, the bounding box of the point set is first calculated, the center of the bounding box and the side length of the bounding box are recorded, and then it is divided into four point sets according to the coordinate information of each point, and then each point set is passed into the corresponding grid node to establish a grid index; the grid index also needs to record the bounding box information of the corresponding point set, and select the subsequent quadtree segmentation axis according to the spatial position of the grid, where the quadtrees in nodes 1 and 3 use the x-axis and z-axis for point cloud segmentation, and the quadtrees in nodes 2 and 4 use the y-axis and z-axis for segmentation; in the process of establishing the quadtree index, the positional relationship between the point to be divided and the center of the bounding box of the current quadtree node is passed into the corresponding child node until the point cloud data in the current node is less than the set threshold, the subdivision is stopped, a leaf node is established, and the establishment of the mixed index is completed; S22. The search point query of the mixed index is to find the quadtree leaf node where the search point is located according to the bounding box information and space segmentation information stored in each node, and return the pointer of the leaf node; S23. The R neighborhood search of the mixed index needs to first query the leaf node where the search point P is located, and then continuously push all the parent nodes and four child nodes of the current node into the backtracking queue; when the child node enters the queue, it is necessary to determine whether the leaf node intersects with the neighborhood sphere based on the shortest distance from the search point to the bounding box. Only if it intersects will it be added to the queue for backtracking. Each time backtracking occurs, a node is taken out of the queue and it is determined whether the node is a leaf node. If it is a leaf node and the number of points in the leaf node is greater than ten thousand, a kd tree is established in the leaf node to accelerate the neighborhood search, otherwise a traversal search is performed directly; after completing the search of the grid where the search point is located, it is also necessary to determine whether a supplementary search of the other three grids is required based on the positional relationship between the search point and the other three grids; S24. The K-neighborhood search process of the hybrid index is similar to the R-neighborhood search. The difference is that since the K-neighborhood search does not have a fixed-size neighborhood ball, but provides a search point number k, it is necessary to maintain a large top heap priority queue during the search process. The priority queue stores the points with the smallest distance to the search point among the points that have been searched, and sorts them according to the distance to the search point. When the number of elements in the priority queue is less than k, all the traversed points are stored in the queue. When the number of elements is greater than or equal to k, the top data of the stack is the farthest point in the current search process, and the distance from this point to the search point is the current neighborhood ball radius. The dynamic radius is used to perform the R-neighborhood search, and the priority queue is updated according to the search results.
4. The method according to claim 3 is characterized in that The point cloud multi-threaded concurrent design is implemented based on the thread management library in the C++ standard library, including: S31. Use multithreading to accelerate index establishment. During the index establishment process, each node division will divide the data into multiple blocks, and then each block of data will be transferred to the corresponding node for node establishment. In this process, the sub-node pointer and the point cloud data controlled by it can be passed to the current idle thread for index establishment. Since there is no data interaction between different nodes, the process is thread-safe and can fully utilize the computing performance of the CPU. S32. In the process of neighborhood search, since the neighborhood search needs to maintain a unique stack and priority queue, and the interface needs to be frequently called for operation during the search process, any concurrent operation on these memory spaces is unsafe, so the neighborhood search does not have the conditions for achieving concurrency; when multiple threads call the same data structure at the same time, if only the node is accessed, the concurrent operation of the structure is safe, and there is no need to introduce mutex operations. However, when a thread in the multithreading needs to establish a kd tree in the node, or add or delete data points in the node, it is necessary to add a mutex to the leaf node of the quadtree, and the mutex needs to be locked when performing modification operations, and all operations need to check the state of the mutex before the operation, and wait for it to be unlocked before accessing.
5. The method according to claim 4 is characterized in that Based on binary storage and floating point value compression method, point cloud compression storage is realized, including: S41. Since each coordinate value in the point cloud data is a floating point data, the coordinate information of a point can be represented by three floating point data. The memory occupation of a floating point number is 4 bytes, so the memory occupation of the coordinate data of a point is 12 bytes. In binary storage, the memory of each floating point number is converted into a binary string with four bits of data, and then the string is directly written into the binary file, so that the space occupation of a point can be reduced to less than 50% of the text format. S42. A point cloud data compression algorithm based on integer compression is proposed. A compressed floating point type with a space of 3 bytes is designed. The binary bit corresponding to one data is 24 bits. For a signed number, the data range that can be represented is ±8388.608, which meets the general large-scale point cloud usage requirements. When compressing the original data, a single-precision floating point data is first enlarged by 1000 times, and then the floating point data is truncated into an integer. The integer data obtained at this time is intercepted from low to high bits. 23 bits, the highest bit is the same as the sign bit of the original data. Using this method, each coordinate value can be compressed from 4 bytes to 3 bytes, reducing the memory usage by 25%.
Citation Information
Cited By
Square Euclidean distance calculation method for realizing in-memory acceleration point cloud in 2T0C dynamic random access memory array
CN120656045A