Method and device for processing point cloud spatial data
The octree-based method addresses inefficiencies in point cloud data processing by organizing data into multi-resolution levels using node resolution and threshold values, ensuring efficient storage and retrieval of high-resolution data without redundancy.
Patent Information
- Application Number
- CN202111600552.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-24
- Publication Date
- 2025-07-15
- Estimated Expiration
- 2041-12-24
AI Technical Summary
The existing point cloud spatial data organization structure algorithms are inefficient when processing massive point cloud data and cannot operate flexibly, resulting in insufficient computer hardware and data processing capabilities, affecting actual applications.
The Octet Tree model construction method is adopted, combining node resolution and segmentation threshold, and a LOD Octet Tree structure with multi-resolution hierarchical details is generated through distance sampling, point cloud data is stored, and the hash function is used to accelerate the construction process of spatial data organization structure.
It improves the processing efficiency of point cloud data, reduces redundant points, ensures that point cloud information is not missing, and improves production efficiency and data operability.
Smart Images

Figure CN114399592B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical fields of power systems and earth observation technology, in particular to the technical field of the spatial data organization structure of airborne lidar point cloud data, and specifically relates to a method and device for processing point cloud spatial data. Background Art
[0002] In recent years, spatial information acquisition technologies such as three-dimensional laser scanning, aerospace / ground stereo photography image matching have developed more and more maturely, so that the acquisition of spatial object information has developed from two dimensions to three dimensions. The main ways to obtain three-dimensional spatial information include traditional measurements such as electromagnetic wave ranging, high-tech precision measuring instruments such as total stations, and three-dimensional laser scanning technology (abbreviated as LIDAR). Among them, according to the different carrier forms of the scanner when acquiring point cloud data, the laser scanning system can be divided into an airborne lidar system, a vehicle-mounted lidar system, and a ground-based lidar system. As a new large-scale three-dimensional information acquisition technology, LIDAR can directly obtain high-precision information and geometric information on the object surface, and has great superiority compared with traditional measurements in terms of accuracy, data acquisition speed, and acquisition volume. Therefore, it has quickly developed into a key technology.
[0003] The point cloud information obtained by three-dimensional laser scanning, due to containing three-dimensional information, has the characteristic of extremely large data volume. However, due to the development bottleneck of computer hardware (such as insufficient memory), the drawing efficiency is poor in the visualization processing of three-dimensional point cloud information, and at the same time, the ability to process massive point cloud data is insufficient (data structure algorithm), which seriously affects the application of massive point cloud data in actual projects and cannot operate on point cloud data more flexibly. Specifically, the existing algorithms for the spatial data organization structure of point clouds mainly include the following several types: The research on the spatial data organization of massive point cloud data mainly includes constructing a spatial index. A spatial index is a data structure that uses the position of spatial objects or the spatial relationship between spatial objects to arrange spatial data in order. According to different partitioning methods, it is mainly divided into three partitioning methods: regular segmentation method, object segmentation method, and combined segmentation method.
[0004] (1) Regular Segmentation Method
[0005] The regular segmentation method is to map each entity in space to uniformly divided units according to certain methods, and the corresponding relationship can be that one entity corresponds to one unit or one entity corresponds to multiple units. More commonly used regular grid meshing methods include KD tree, KDB tree, octree, BSP tree, and R tree, etc.
[0006] (2) Object Segmentation Method
[0007] The object segmentation method refers to dividing the space by using hierarchical bounding volumes and certain regular methods. The hierarchical bounding volume is a simple tree structure. The space objects are segmented by using some specific methods, and thus each node of the tree is saved as the information of the hierarchical bounding volume where it is located, and the leaf nodes store the basic space objects.
[0008] (3) Composite Indexing Technique
[0009] Composite indexing utilizes multiple spatial organization indexes, taking advantages and compensating for disadvantages, giving full play to the advantages of various spatial indexes and overcoming the drawbacks brought by using a single index. For example, the two-dimensional grid index cannot be applied to the situation where the point cloud data is extremely unevenly distributed, but the hybrid index structure such as the octree index and the KD-tree index overcomes the extremely uneven distribution of the point cloud data.
[0010] In terms of spatial data organization indexing, various spatial index algorithms have their own advantages and disadvantages, as described in Table 1.
[0011] Table 1
[0012] Summary of the Invention
[0013] The method and device for processing point cloud spatial data provided by the present invention have high efficiency and applicability, and have high practical application value.
[0014] In order to achieve the above object, a method for processing point cloud spatial data is provided, including:
[0015] Receiving point cloud spatial data;
[0016] Constructing an octree model according to the total amount of the point cloud spatial data, a preset node resolution, and a preset node segmentation threshold;
[0017] Performing distance sampling on the point cloud spatial data according to the octree model.
[0018] In one embodiment, the constructing an octree model according to the total amount of the point cloud spatial data, a preset node resolution, and a preset node segmentation threshold includes:
[0019] Determining the sampling distance of a single node in each node layer of the octree model according to the node resolution;
[0020] Determining the number of node layers of the octree model according to the sampling distance, the node segmentation threshold, and the total amount of the point cloud spatial data;
[0021] Constructing the octree model according to the preset node resolution and the number of layers.
[0022] In one embodiment, the distance sampling of the point cloud spatial data according to the octree model includes:
[0023] Storing each piece of point cloud spatial data in the point cloud spatial data into the corresponding node in the octree model according to the sampling distance.
[0024] In one embodiment, the node level in the octree model has a direct proportional relationship with the resolution.
[0025] In a second aspect, the present invention provides a processing device for point cloud spatial data, and the device includes:
[0026] A data receiving module, configured to receive point cloud spatial data;
[0027] A model construction module, configured to construct an octree model according to the total amount of the point cloud spatial data, a preset node resolution, and a preset node segmentation threshold;
[0028] A distance sampling module, configured to perform distance sampling on the point cloud spatial data according to the octree model.
[0029] In one embodiment, the model construction module includes:
[0030] A sampling distance determination unit, configured to determine the sampling distance of a single node in each node layer of the octree model according to the node resolution;
[0031] A node layer number determination unit, configured to determine the number of node layers of the octree model according to the sampling distance, the node segmentation threshold, and the total amount of the point cloud spatial data;
[0032] A model construction unit, configured to construct the octree model according to the preset node resolution and the number of layers.
[0033] In one embodiment, the model construction unit is specifically configured to store each piece of point cloud spatial data in the point cloud spatial data into the corresponding node in the octree model according to the sampling distance.
[0034] In one embodiment, the node level in the octree model has a direct proportional relationship with the resolution.
[0035] In a third aspect, the present invention provides an electronic device, including a memory, a processor, and a computer program stored on the memory and executable on the processor, and the processor implements the steps of the method for processing point cloud spatial data when executing the program.
[0036] In a fourth aspect, the present invention provides a computer-readable storage medium, on which a computer program is stored, and the computer program implements the steps of the method for processing point cloud spatial data when being executed by a processor.
[0037] As can be seen from the above description, for the method and device for processing point cloud spatial data provided by the embodiments of the present invention, first, point cloud spatial data is received; then, an octree model is constructed according to the total amount of the point cloud spatial data, a preset node resolution, and a preset node segmentation threshold; finally, distance sampling is performed on the point cloud spatial data according to the octree model. The present invention is based on the spatial segmentation structure of the octree and samples the point cloud data during its construction process to generate a multi-resolution level of detail (abbreviated as LOD octree), and constructs the original point cloud data into multiple resolution levels of detail and stores them in the form of binary files on the computer hard disk. Specifically, the present invention has the following beneficial effects:
[0038] 1. The present invention takes the octree structure as the basis of the spatial data organizational structure, and adds a sampling process with the node resolution as the spacing during the construction of the octree. Finally, the constructed spatial data organizational structure retains a subset of low-resolution point cloud data for low-level nodes and a subset of high-resolution point cloud data for high-level nodes.
[0039] 2. The data stored in the LOD spatial data organizational structure based on the octree constructed by the present invention does not have redundant points or deleted points. Therefore, all subsets of node point cloud data can return to the original point cloud set, ensuring that the point cloud information is not missing.
[0040] 3. The introduction of the hash function accelerates the construction process of the spatial data organizational structure and improves the production efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] In order to more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the drawings required for the description of the embodiments or the prior art. Obviously, the following drawings are some embodiments of the present invention. For those of ordinary skill in the art, without creative efforts, other drawings can be obtained based on these drawings.
[0042] Figure 1 It is a schematic flowchart of the method for processing point cloud spatial data provided in the embodiments of the present invention;
[0043] Figure 2 It is a schematic diagram of the random sampling method in the embodiments of the present invention;
[0044] Figure 3 It is a schematic diagram of the grid center sampling method in the embodiments of the present invention;
[0045] Figure 4 It is a schematic diagram of the distance sampling method in the embodiments of the present invention;
[0046] Figure 5It is a flowchart of step 200 of the method for processing point cloud spatial data in an embodiment of the present invention;
[0047] Figure 6 It is a flowchart of step 300 of the method for processing point cloud spatial data in an embodiment of the present invention;
[0048] Figure 7 It is a flowchart of the method for processing point cloud spatial data in a specific application example of the present invention;
[0049] Figure 8 It is a logic diagram of the method for processing point cloud spatial data in a specific application example of the present invention;
[0050] Figure 9 It is a schematic diagram of the quadtree model structure in a specific application example of the present invention;
[0051] Figure 10 It is a schematic diagram of the structure of the device for processing point cloud spatial data in an embodiment of the present invention;
[0052] Figure 11 It is a schematic diagram of the structure of the model construction module 20 in an embodiment of the present invention;
[0053] Figure 12 It is a schematic diagram of the structure of the electronic device in an embodiment of the present invention. Detailed implementation manners
[0054] To make the objectives, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are some, but not all, of the embodiments of the present invention. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts shall fall within the protection scope of the present invention.
[0055] Those skilled in the art should understand that the embodiments of the present invention can be provided as a method, a system, or a computer program product. Therefore, the present invention can take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects. Moreover, the present invention can take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk memories, CD-ROMs, optical memories, etc.) containing computer-usable program codes.
[0056] It should be noted that the terms "comprising", "having" and any variations thereof in the specification, claims and above-mentioned drawings of this application are intended to cover non-exclusive inclusion. For example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units not clearly listed or inherent to these processes, methods, products or devices.
[0057] It should be noted that, without conflict, the embodiments in this application and the features in the embodiments may be combined with each other. The following will detail this application with reference to the drawings and in combination with the embodiments.
[0058] An embodiment of the present invention provides a specific implementation manner of a method for processing point cloud spatial data. Refer to Figure 1 , the method specifically includes the following content:
[0059] Step 100: Receive point cloud spatial data.
[0060] It can be understood that point cloud spatial data is a set of sampled points with spatial coordinates obtained by a lidar. Since the quantity is large and dense, it is called "point cloud". Because the point cloud has spatial coordinates, it is widely used in quite a number of fields such as surveying and mapping, electric power, construction, industry, automobiles, games, criminal investigation, etc. The application scenarios of point cloud data are as follows:
[0061] 1. Topographic map surveying and mapping: The application of three-dimensional laser scanning technology in large-scale topographic surveying and mapping can quickly and accurately collect a large amount of point cloud data when the surveyed area is large, effectively saving manpower and material resources, shortening the construction period, and improving work efficiency and economic benefits; in complex terrains and dangerous surveyed areas, it can collect field data in detail and quickly without directly contacting dangerous targets, ensuring the safety of personnel and equipment, meeting the mapping accuracy requirements, and improving work efficiency at the same time.
[0062] 2. Digital Elevation Model (DEM) and contour lines: By using the obtained laser point cloud, after removing some noise points and rasterizing, a high-quality Digital Surface Model (DSM) can be quickly generated. At the same time, if further filtering operations are performed on the laser point cloud by combining automated methods with manual editing to filter out non-ground points and rasterize, a high-quality Digital Terrain Model (DEM) can be obtained.
[0063] 3. Volume calculation: The high-precision laser point cloud and terrain three-dimensional model obtained by an airborne lidar system can provide information such as cross-section measurement, slope and slope vector measurement, and earthwork filling and excavation volume for survey and design, greatly reducing the field work volume in engineering survey and design and shortening the work cycle.
[0064] 4. Highway and road surveying, reconstruction, and expansion: Mobile LiDAR scanners installed on vehicles or airborne scanners operated on helicopters can provide dense point clouds that can accurately depict highways, as well as their surrounding environments and road surface conditions. Using simultaneously captured photos and control points measured using GPS can improve accuracy and help compensate for GPS signal gaps caused by high-rise buildings and trees.
[0065] Step 200: Construct an octree model based on the total amount of the point cloud spatial data, a preset node resolution, and a preset node segmentation threshold.
[0066] The definition of an octree is as follows: If it is not an empty tree, any node in the tree will have exactly eight or zero child nodes, that is, the number of child nodes will not be other than 0 and 8. It is a tree-like data structure used to describe three-dimensional space. Each node of the octree represents a cubic volume element, and each node has eight child nodes. The volume elements represented by the eight child nodes added together are equal to the volume of the parent node.
[0067] Step 300: Perform distance sampling on the point cloud spatial data according to the octree model.
[0068] Types of sampling methods: During the construction of the LOD octree model, a distance sampling based on the node resolution is used to sample the original point cloud set, and its goal is to generate multi-resolution layers. The point cloud subsets are sampled by different sampling methods (illustrated with a two-dimensional graph), which are respectively random sampling, sampling the point cloud data closest to the center of the node, and the point cloud data within the node having the minimum distance (see Figures 2 to 4 ). For the later visualization effect and the data storage structure designed in this application, the preferred method is that the point cloud data within the node has the minimum distance. The generated point cloud data subsets of the octree nodes have the minimum distance between points, and the threshold of the distance is controlled by the resolution of the node.
[0069] As can be seen from the above description, the method for processing point cloud spatial data provided by the embodiments of the present invention first receives the point cloud spatial data; then constructs an octree model based on the total amount of the point cloud spatial data, a preset node resolution, and a preset node segmentation threshold; and finally performs distance sampling on the point cloud spatial data according to the octree model. The present invention uses a method based on octree indexing to construct the spatial relationship between the node point cloud data. During the construction of the spatial data organizational structure, the method of Poisson sampling is used to perform spacing sampling on the LOD (Level of Detail) octree node point cloud data, and its sampling spacing (node resolution) is determined by the node size.
[0070] In one embodiment, see Figure 5 , Step 200 includes:
[0071] Step 201: Determine the sampling distance of a single node in each node layer of the octree model according to the node resolution;
[0072] Step 202: Determine the number of node layers of the octree model according to the sampling distance, the node segmentation threshold, and the total amount of point cloud spatial data;
[0073] Step 203: Construct the octree model according to the preset node resolution and the number of layers.
[0074] In Steps 201 to 203, during the process of constructing the octree model, initially there is a root node r, and the first point cloud data falling into the root node will be added to the subset of the root node's point cloud data. If the segmentation threshold of the root node is reached (the node is segmented only when a certain amount of point cloud data is reached. This parameter is mainly to save storage space and avoid creating unnecessary new nodes), then the point cloud data of the root node is segmented. During the segmentation process, the method of distance sampling is used to judge the point cloud data retained by this node. If the point cloud data meets the resolution of the root node, it is retained; otherwise, the point cloud data is passed down to the child nodes of the root node.
[0075] The resolution of the root node is determined by the size of the root node bounding box as shown in Equation (1). aabb.size is the size of the current node, and diagonalFraction is the number of parts into which the current node is divided in a certain axis direction. In this application, the value of the diagonalFraction parameter used is 250.
[0076] resolving_power = aabb.size / diagonalFraction (1)
[0077] After determining the resolution of the root node, when there is point cloud data that does not meet the resolution of the root node, the point cloud data is passed to a higher-level node. During the transfer process, first check whether this node exists. If it does not exist, create a node. During the process of creating a new node, the resolution of the new node is halved relative to the upper-level node. For example, if the resolution of the root node r is 2m, then the resolution of the child node r1 of the root node is 1m. The specific calculation of the child node resolution is as shown in Equation (2):
[0078] resolving_power = pow / (2.0, float(level)) (2)
[0079] In one embodiment, referring to Figure 6 , Step 300 includes:
[0080] Step 301: Store each piece of point cloud spatial data in the corresponding node of the octree model according to the sampling distance.
[0081] In the octree model, the unit grids divided by nodes are based on hash_map in the stl standard library, and the idea of hash mapping is used to improve the grid query and insertion efficiency. The key value of hash_map is obtained by shifting 3 integer indexes, and the value is the grid instantiation corresponding to the index. When creating the LOD octree nodes, the grids divided by the corresponding nodes also need to be created, but they are not instantiated and thus do not occupy memory space. Only when the point cloud data falls into the grid will it be instantiated. The size of the divided grid can be any value between the node resolution size and the node size. Only the grid cell size equal to or greater than the node resolution size can ensure that the points related to distance checking are stored in the same or adjacent grid cells. In this application, the size of the grid cell is determined by the parameter cellSizeFactor. Preferably, the parameter used is 5. The calculation of the grid size is shown in formulas (3)-(5):
[0082] width = aabb.size.x / (resolving_power × cellSizeFactor) (3)
[0083] height = aabb.size.y / (resolving_power × cellSizeFactor) (4)
[0084]
[0085] cellSizeFactor controls the size of the grid cell. If the grid cell size is too large, the creation of the number of grids will be reduced. At the same time, the point cloud data in the grid will be more, the amount of distance checking will be more, and the memory occupancy and processing overhead will be larger.
[0086] Each grid cell stores the accepted point cloud data after distance checking and the pointer addresses of its adjacent grid cells, so as to quickly iterate the point cloud data in adjacent grid cells. If the distances to all points within this grid cell and all points in adjacent grid cells are greater than the node resolution, the point cloud data set of the grid cell will store this point cloud data (which also represents that the node accepts this point cloud data); otherwise, the point cloud data will be passed to the lower-level node. When newly added point cloud data falls into the grid, the grid index is calculated through formulas (6)-(8), and then the required grid is found through the lookup function of the hash_map. If the grid is not instantiated, instantiation operations are performed. If it has been instantiated, distance checking is directly carried out. During grid instantiation, it is also checked whether adjacent grids have been instantiated. If an adjacent grid has been instantiated, the neighbor grid is added to the neighbor list of the newly instantiated grid, and the newly instantiated grid is also added to the neighbor list of the adjacent grid.
[0087] indexx = width × (p.x - aabb.min.x) / aabb.size.x (6)
[0088] indexy = height × (p.y - aabb.min.y) / aabb.size.y (7)
[0089] indexz = depth × (p.z - aabb.min.z) / aabb.size.z (8)
[0090] Where p is the current point coordinate, width, height, and depth are the current grid size, indexx, indexy, and indexz are the indices of the grid where the current point is located. After calculation, these three integer components are subjected to a shift operation, and the obtained index value is the key value of the hash_map (see formula (9)), and the value of its hash_map is the pointer address of the current grid.
[0091] index = (indexz << 40) | (indexy << 20) | indexx (9)
[0092] In one embodiment, the node level and resolution in the octree model are in a direct proportional relationship.
[0093] It can be understood that in the finally constructed octree model (spatial data organizational structure), low-level nodes retain subsets of low-resolution point cloud data, high-level nodes retain subsets of high-resolution point cloud data, and the point cloud data subsets of all nodes can return the entire original point cloud set.
[0094] As can be seen from the above description, the method for processing point cloud spatial data provided by the embodiments of the present invention first receives point cloud spatial data; then constructs an octree model according to the total amount of the point cloud spatial data, a preset node resolution, and a preset node segmentation threshold; and finally performs distance sampling on the point cloud spatial data according to the octree model. The present invention is based on the spatial segmentation structure of the octree and samples the point cloud data during its construction process to generate a multi-resolution level of detail (referred to as the LOD octree), and constructs the original point cloud data into multiple resolution levels of detail and stores them in the form of binary files on the computer hard disk. Specifically, the present invention has the following beneficial effects:
[0095] 1. Based on the octree structure as the basis of the spatial data organization structure, a sampling process with the node resolution as the spacing is added during the construction of the octree. Finally, the constructed spatial data organization structure retains a subset of low-resolution point cloud data for low-level nodes and a subset of high-resolution point cloud data for high-level nodes.
[0096] 2. The data stored in the LOD spatial data organization structure based on the octree constructed by the present invention has no redundant points or deleted points. Therefore, all subsets of node point cloud data can return to the original point cloud set, ensuring that the point cloud information is not missing.
[0097] 3. The hash function is introduced to accelerate the construction process of the spatial data organization structure and improve the production efficiency.
[0098] To further illustrate the present solution, the present invention also provides a specific application example of the method for processing point cloud spatial data, which specifically includes the following content. See Figure 7 and Figure 8 .
[0099] See Figure 8 , a method for organizing spatial data of LOD massive point clouds based on the octree proposed by the specific application example of the present invention is: distance sampling is added during the construction of the octree. The distance sampling process is used to judge the point cloud data retained by the octree nodes. The final result is that each node of the generated octree retains a subset of point clouds at a certain spacing, and all subsets of node point cloud data jointly return the entire original point cloud set. The constructed spatial data organization structure is saved in the form of binary files for realizing later file memory organization and scheduling.
[0100] S1: Construct an octree model.
[0101] To implement the construction of the LOD octree, a data structure suitable for storing LOD octree data is designed, including a data structure for storing point cloud information, a data structure for storing node bounding boxes, a data structure for storing node information, and a grid structure for storing the division of nodes. Specifically as follows:
[0102] The PtCloud point structure is used to store the XYZ three - dimensional coordinates, RGBA grayscale color information of the point cloud, and the marked SelID. The specific structure is shown in Table 2:
[0103] Table 2 Point Structure
[0104]
[0105] The AABB node bounding box structure is used to store the bounding box radius radius, the maximum point max, the minimum point min, and the node center center. The specific structure is shown in Table 3:
[0106] Table 3 Bounding Box Structure
[0107]
[0108] The Node node structure is used to store the layer index where the node is located, the node bounding box aabb, the child nodes children, the node's parent node parent, the node's point cloud data ptdata, the segmentation threshold limit, whether the node is in memory isInMemory, etc. The specific structure is shown in Table 4:
[0109] Table 4 Node Structure
[0110]
[0111] The gridcell is the grid divided by the node. points is the point cloud data stored in the current grid; neighbours are the neighbor grids of the current grid; the add function adds the point cloud data after distance checking to the current grid; the isDistant function is for distance checking. The specific structure is shown in Table 5:
[0112] Table 5 Grid
[0113] Name Type points Ptcloud set neighbours Set of grid pointers add Function isDistant Function width Width height Height depth Length resolving_power Resolution
[0114] The octree nodes constructed by this algorithm have the following main characteristics compared with ordinary octree nodes: Each octree node stores a subset of the point cloud data, and it is stored at a certain resolution; the subset of the point cloud data stored in the node will not be repeated or missing, and finally all subsets of the point cloud data will return the overall original point cloud data set; as the level increases, the node size decreases, and the density of the point cloud data set stored in the node increases, as Figure 9 shown (taking the quadtree as an example).
[0115] S2: Perform distance sampling on the point cloud spatial data according to the octree model.
[0116] Specifically, first create a single root node. Initially, the octree consists of a single root node. Points are added to the root node one by one, and the root node or leaf node saves all points first.
[0117] Next, sampling is performed. If there are no other points within the minimum distance (spacing), the internal node retains the point; otherwise, it passes it to its child nodes. Check if the child nodes exist. If not, create them and halve the minimum distance. Check if it is in memory. If not, first read the node point cloud data from the disk.
[0118] If the splitting threshold of the node is reached, expand the leaf node. Add all the stored points to itself. During the process, following the internal node rules, the points with the minimum distance are retained in the current node, and the other points are passed down to the newly created child nodes. Regularly flush the data to the disk. For nodes that have not been touched since the last flush, remove their point cloud data from memory during the next flush.
[0119] Preferably, the spatial data organization storage file form of the massive point cloud data is a binary storage structure, which is convenient for fast scheduling in later visualization.
[0120] As can be seen from the above description, the method for processing point cloud spatial data provided by the embodiments of the present invention proposes a spatial data organization method for LOD massive point cloud data based on an octree on the basis of the existing research on spatial data organization indexing, and Poisson sampling is added during the construction of the octree. Each node of the finally generated octree retains a subset of the point cloud at a certain spacing, and the subsets of the point cloud data of all nodes are combined to return the entire original point cloud set. On the other hand, the present invention introduces the hash idea and uses the hash_map function to achieve the rapid construction and efficient search of the unit grids in the node, accelerating the process of spatial data organization construction.
[0121] Based on the same inventive concept, the embodiments of the present application also provide a device for processing point cloud spatial data, which can be used to implement the method described in the above embodiments, as in the following embodiments. Since the principle of the device for processing point cloud spatial data to solve problems is similar to that of the method for processing point cloud spatial data, the implementation of the device for processing point cloud spatial data can refer to the implementation of the method for processing point cloud spatial data, and the repeated parts will not be described again. Hereinafter, the term "unit" or "module" can be a combination of software and / or hardware that can achieve a predetermined function. Although the systems described in the following embodiments are preferably implemented in software, implementation in hardware, or a combination of software and hardware is also possible and contemplated.
[0122] The embodiments of the present invention provide a specific implementation manner of a device for processing point cloud spatial data that can implement the method for processing point cloud spatial data. Refer to Figure 10 , the device for processing point cloud spatial data specifically includes the following content:
[0123] The data receiving module 10 is used to receive point cloud spatial data;
[0124] The model construction module 20 is used to construct an octree model according to the total amount of the point cloud spatial data, a preset node resolution, and a preset node segmentation threshold;
[0125] The distance sampling module 30 is used to perform distance sampling on the point cloud spatial data according to the octree model.
[0126] In one embodiment, see Figure 11 , the model construction module 20 includes:
[0127] The sampling distance determination unit 201 is used to determine the sampling distance of a single node in each node layer of the octree model according to the node resolution;
[0128] The node layer number determination unit 202 is used to determine the number of node layers of the octree model according to the sampling distance, the node segmentation threshold, and the total amount of the point cloud spatial data;
[0129] The model construction unit 203 is used to construct the octree model according to the preset node resolution and the number of layers.
[0130] In one embodiment, the model construction unit is specifically used to store each point cloud spatial data in the point cloud spatial data into the corresponding node in the octree model according to the sampling distance.
[0131] In one embodiment, the relationship between the node level and the resolution in the octree model is a direct proportional relationship.
[0132] As can be seen from the above description, the processing device for point cloud spatial data provided by the embodiment of the present invention first receives point cloud spatial data; then constructs an octree model according to the total amount of the point cloud spatial data, a preset node resolution, and a preset node segmentation threshold; and finally performs distance sampling on the point cloud spatial data according to the octree model. The present invention is based on the spatial segmentation structure of the octree and samples the point cloud data during its construction process to generate a multi-resolution level of detail (referred to as LOD octree for short), and constructs the original point cloud data into multiple resolution levels of detail and stores them in the computer hard disk in the form of binary files. Specifically, the present invention has the following beneficial effects:
[0133] 1. Based on the octree structure as the basis of the spatial data organization structure, a sampling process with the node resolution as the spacing is added during the construction of the octree. Finally, the constructed spatial data organization structure retains a low-resolution point cloud data subset for low-level nodes and a high-resolution point cloud subset for high-level nodes.
[0134] 2. The data stored in the octree-based LOD spatial data organizational structure constructed by the present invention has no redundant points or deleted points. Therefore, all subsets of node point cloud data can return the original point cloud set, ensuring that the point cloud information is not missing.
[0135] 3. The introduction of the hash function accelerates the construction process of the spatial data organizational structure and improves the production efficiency.
[0136] An embodiment of the present application also provides a specific implementation manner of an electronic device capable of implementing all steps in the method for processing point cloud spatial data in the above embodiment. Refer to Figure 12 , and the electronic device specifically includes the following contents:
[0137] A processor 1201, a memory 1202, a communication interface 1203, and a bus 1204;
[0138] Among them, the processor 1201, the memory 1202, and the communication interface 1203 communicate with each other through the bus 1204; the communication interface 1203 is used to implement information transmission between related devices such as server-side devices, measurement devices, and user-side devices.
[0139] The processor 1201 is used to call the computer program in the memory 1202. When the processor executes the computer program, all steps in the method for processing point cloud spatial data in the above embodiment are implemented. For example, when the processor executes the computer program, the following steps are implemented:
[0140] Step 100: Receive point cloud spatial data;
[0141] Step 200: Construct an octree model according to the total amount of the point cloud spatial data, a preset node resolution, and a preset node segmentation threshold;
[0142] Step 300: Perform distance sampling on the point cloud spatial data according to the octree model.
[0143] An embodiment of the present application also provides a computer-readable storage medium capable of implementing all steps in the method for processing point cloud spatial data in the above embodiment. A computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, all steps in the method for processing point cloud spatial data in the above embodiment are implemented. For example, when the processor executes the computer program, the following steps are implemented:
[0144] Step 100: Receive point cloud spatial data;
[0145] Step 200: Construct an octree model according to the total amount of the point cloud spatial data, a preset node resolution, and a preset node segmentation threshold;
[0146] Step 300: Perform distance sampling on the point cloud spatial data according to the octree model.
[0147] In summary, the computer-readable storage medium provided by the embodiments of the present invention can support a service provider to perform self-adaptive offline and online of services according to the availability of its own software and hardware resources, realize the self-isolation ability of the service provider, and ensure the response success rate of the service provider to service requests.
[0148] Each embodiment in this specification is described in a progressive manner. The same or similar parts among the embodiments can be referred to each other, and the differences between each embodiment and other embodiments are emphasized. In particular, for the hardware + program type embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiments.
[0149] The above describes specific embodiments of this specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recited in the claims can be performed in a different order than in the embodiments and still achieve the desired results. Additionally, the processes depicted in the figures do not necessarily require the specific order or sequential order shown to achieve the desired results. In certain embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0150] Although this application provides method operation steps such as in the embodiments or flowcharts, based on routine or non-creative labor, there can be more or fewer operation steps. The order of steps listed in the embodiments is only one way among many execution orders of the steps and does not represent the only execution order. When an actual device or client product is executed, it can be executed in the order shown in the embodiments or the figures or in parallel (such as in an environment of parallel processors or multithreaded processing).
[0151] Those skilled in the art should understand that the embodiments of the present invention can be provided as a method, a system, or a computer program product. Therefore, the present invention can take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware aspects. Moreover, the present invention can take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk memories, CD-ROMs, optical memories, etc.) containing computer-usable program code.
[0152] The present invention is described with reference to the flowcharts and / or block diagrams of methods, apparatuses (systems), and computer program products according to embodiments of the present invention. It should be understood that each flow and / or block in the flowchart and / or block diagram, and the combination of flows and / or blocks in the flowchart and / or block diagram, can be realized by computer program instructions. These computer program instructions can be provided to the processors of general-purpose computers, special-purpose computers, embedded processors, or other programmable data processing devices to generate a machine, so that the instructions executed by the processors of the computer or other programmable data processing devices generate means for realizing the functions specified in one or more flows and / or one or more blocks in the flowcharts. Figure 1 one or more flows and / or Figure 1 blocks.
[0153] These computer program instructions can also be stored in a computer-readable memory that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer-readable memory generate a manufactured article including instruction means, and the instruction means realizes the functions specified in one or more flows and / or one or more blocks in the flowcharts. Figure 1 one or more flows and / or Figure 1 blocks.
[0154] These computer program instructions can also be loaded onto a computer or other programmable data processing device, so that a series of operating steps are executed on the computer or other programmable device to generate a computer-implemented process, and thus the instructions executed on the computer or other programmable device provide steps for realizing the functions specified in one or more flows and / or one or more blocks in the flowcharts. Figure 1 one or more flows and / or Figure 1 blocks.
[0155] Specific embodiments are applied in the present invention to elaborate on the principles and implementation manners of the present invention. The description of the above embodiments is only used to help understand the method and its core idea of the present invention; at the same time, for those of ordinary skill in the art, according to the idea of the present invention, there will be changes in the specific implementation manners and application scopes. In summary, the content of this specification should not be construed as a limitation to the present invention.
Claims
1. A method for processing point cloud spatial data, characterized in that, Including: Receiving point cloud spatial data; Constructing an octree model according to the total amount of the point cloud spatial data, a preset node resolution, and a preset node segmentation threshold; Performing distance sampling on the point cloud spatial data according to the octree model; The constructing of the octree model according to the total amount of the point cloud spatial data, the preset node resolution, and the preset node segmentation threshold includes: Determining the sampling distance of a single node in each node layer of the octree model according to the node resolution; Determining the number of node layers of the octree model according to the sampling distance, the node segmentation threshold, and the total amount of the point cloud spatial data; Constructing the octree model according to the preset node resolution and the number of layers. Specifically: During the process of constructing the octree model, initially there is a root node r, and the first point cloud data falling into the root node will be added to the subset of the root node's point cloud data. If the segmentation threshold of the root node is reached, the point cloud data of the root node will be segmented. During the segmentation process, the method of distance sampling is used to judge the point cloud data retained by this node. If the point cloud data meets the resolution of the root node, it will be retained; otherwise, the point cloud data will be passed down to the child nodes of the root node; The resolution of the root node is determined by the size of the root node bounding box as shown in Equation (1), where aabb.size is the size of the current node, and diagonalFraction is the number of parts into which the current node is divided in a certain axial direction. The value of the diagonalFraction parameter used in Equation (1) is 250: resolving_power = aabb.size / diagonalFraction (1) After determining the resolution of the root node, when there is point cloud data that does not meet the resolution of the root node, the point cloud data will be passed to a higher-level node; during the passing process, first check whether this node exists. If it does not exist, create a node. During the process of creating a new node, the resolution of the new node is halved relative to the upper-level node. The specific calculation of the child node resolution is as shown in Equation (2): resolving _ power = pow / (2.0, float(level)) (2).
2. The method for processing point cloud spatial data according to claim 1, wherein The performing of the distance sampling on the point cloud spatial data according to the octree model includes: Storing each point cloud spatial data in the point cloud spatial data into the corresponding node in the octree model according to the sampling distance.
3. The method for processing point cloud spatial data according to claim 1, wherein, There is a direct proportional relationship between the node level and the resolution in the octree model.
4. A processing device for point cloud spatial data, characterized in that, Including: A data receiving module for receiving point cloud spatial data; A model constructing module for constructing an octree model according to the total amount of the point cloud spatial data, a preset node resolution, and a preset node segmentation threshold; A distance sampling module for performing distance sampling on the point cloud spatial data according to the octree model; The model constructing module includes: A sampling distance determining unit for determining the sampling distance of a single node in each node layer of the octree model according to the node resolution; A node layer number determining unit for determining the number of node layers of the octree model according to the sampling distance, the node segmentation threshold, and the total amount of the point cloud spatial data; A model construction unit for constructing the octree model according to the preset node resolution and the number of layers. Specifically: during the process of constructing the octree model, initially there is a root node r, and the first point cloud data falling into the root node will be added to the subset of the root node's point cloud data. If the segmentation threshold of the root node is reached, the point cloud data of the root node will be segmented. During the segmentation process, the method of distance sampling is used to judge the point cloud data retained by this node. If it meets the resolution of the root node, the point cloud data is retained; otherwise, the point cloud data is passed down to the child nodes of the root node. The resolution of the root node is determined by the size of the root node bounding box as shown in Equation (1), where aabb.size is the size of the current node, and diagonalFraction is the number of parts into which the current node is divided in a certain axis; the value of the diagonalFraction parameter used in Equation (1) is 250: resolving_power = aabb.size / diagonalFraction (1) After determining the resolution of the root node, when there is point cloud data that does not meet the resolution of the root node, the point cloud data is passed to a higher-level node; during the transfer process, first check whether this node exists. If it does not exist, create a node. During the process of creating a new node, the resolution of the new node is halved relative to the upper-level node. The specific calculation of the child node resolution is as shown in Equation (2): resolving _ power = pow / (2.0, float(level)) (2).
5. The processing device for point cloud spatial data according to claim 4, wherein The model construction unit is specifically configured to store each point cloud spatial data in the point cloud spatial data into the corresponding node in the octree model according to the sampling distance.
6. The processing device for point cloud spatial data according to claim 4, wherein The relationship between the node level and the resolution in the octree model is a direct proportional relationship.
7. An electronic device, comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, characterized in that, When the processor executes the program, it implements the steps of the method for processing point cloud spatial data according to any one of claims 1 to 3.
8. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the steps of the method for processing point cloud spatial data according to any one of claims 1 to 3.
Citation Information
Patent Citations
Massive point cloud data processing method and apparatus
CN108470374A
Sub-volume octrees
CN109643442A