A point cloud octree forest construction method and system
By performing initial grid division and further vertical division on the point cloud data, an octree forest is constructed, which solves the problem of the traditional octree's difficulty in parallel processing and improves the efficiency of data query and rendering.
Patent Information
- Application Number
- CN202310378581.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-04-10
- Publication Date
- 2026-11-24
- Estimated Expiration
- 2043-04-10
AI Technical Summary
Traditional octrees are difficult to parallelize, resulting in low efficiency in data querying and rendering.
By performing initial grid division, sub-grid division, and further vertical division on the point cloud data, an octree forest of point cloud is constructed. Adaptive spatial segmentation is achieved through two plane and elevation divisions, and parallel processing is performed.
It improves the efficiency of data analysis, processing, and display rendering, enables parallel processing, reduces the amount of data read in, and speeds up data storage efficiency.
Smart Images

Figure CN116797721B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of point cloud octree technology, specifically to a method and system for constructing a point cloud octree forest. Background Technology
[0002] With the continuous development of large-scale 3D data acquisition technology, 3D laser scanning equipment has been widely used. It can acquire complete point cloud coordinates of a target scene, perform automatic high-precision scanning in 3D space, realistically describe the overall structure and morphological features of the target scene, and quickly obtain point cloud data. In applications involving point cloud querying, analysis, processing, and rendering, octrees are generally used for spatial partitioning and data organization. However, data querying and rendering often require parallel processing, and traditional octrees, with their tree structure, are difficult to parallelize.
[0003] Therefore, there is an urgent need for an octree forest construction method that can be easily parallelized during application. Summary of the Invention
[0004] To address the shortcomings of existing technologies, this invention proposes a point cloud octree forest construction method and system to solve the technical problem that in data querying and rendering, parallel processing of data is often required, but traditional octrees only have a tree structure and are difficult to parallelize.
[0005] A method for constructing a point cloud octree forest includes: calculating the coordinate range of all point cloud data; dividing the point cloud data into an initial grid; dividing the initial grid into sub-grids for initial grids whose size and the number of point clouds within them both exceed a threshold; further dividing all grids in the vertical direction to obtain a target grid set; and constructing an octree for each grid in the target grid set to obtain a point cloud octree forest.
[0006] In one embodiment, the initial grid division step of the point cloud data includes: obtaining the minimum coordinate range of the lower left corner and the maximum coordinate range of the upper right corner in the coordinate range of the point cloud data; preset the grid division size; and determine the number of rows and columns of the grid division based on the grid division size, the minimum coordinate range, and the maximum coordinate range; and dividing the coordinate range of the point cloud data according to the number of rows and columns to obtain the initial grid.
[0007] In one embodiment, the initial grid division step of the point cloud data further includes: calculating the grid row and column numbers corresponding to the point cloud data based on the point cloud data coordinates and the preset grid division size; adding the point cloud data to the corresponding grid index array according to the index of the grid row and column numbers corresponding to the point cloud data; repeating the above steps until all the point cloud data are added to the grid index array, thereby completing the initial grid division of the point cloud data.
[0008] In one embodiment, the step of further dividing all grids in the vertical direction to obtain a target grid set includes: calculating the number of vertical divisions for each grid; vertically dividing grids with a vertical division number greater than 1; calculating the elevation interval of the grids; and vertically dividing the grids according to the number of vertical divisions and the elevation interval to obtain the target grid.
[0009] In one embodiment, the step of constructing an octree for each grid in the target grid set to obtain a point cloud octree forest includes: defining the minimum number of point clouds included in each octree node and the maximum level of the octree; taking the current grid as the root node of the octree, and stopping node partitioning if the number of points in the root node is less than the minimum number of point clouds; if the number of points in the root node is greater than or equal to the minimum number of point clouds, partitioning along the coordinate axes in three directions with the three-dimensional center coordinates of the root node as the center to obtain eight child nodes; using the child nodes as new root nodes for judgment and partitioning until all are less than the minimum number of point clouds, thus completing the construction of the octree; and combining all the constructed octrees to form a point cloud octree forest.
[0010] In one embodiment, after constructing an octree for each grid in the target grid set to obtain a point cloud octree forest, the method further includes storing the point cloud octree forest in an input file.
[0011] In one embodiment, the step of storing the point cloud octree forest input file includes: storing the coordinate index array of the octree in sequence; and storing the attributes of the octree according to the storage order of the coordinate index array.
[0012] A point cloud octree forest construction system includes a range calculation module, a grid partitioning module, and an octree construction module, wherein: the range calculation module is used to calculate the coordinate range of all point cloud data; the grid partitioning module is used to partition the point cloud data into initial grids; the grid partitioning module is also used to partition the initial grids whose size and the number of point clouds within them both exceed a threshold into sub-grids; the grid partitioning module is also used to further partition all grids in the vertical direction to obtain a target grid set; the octree construction module is used to construct an octree for each grid in the target grid set to obtain a point cloud octree forest.
[0013] A computer device includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the steps of a point cloud octree forest construction method described in the above embodiments.
[0014] A storage medium storing a computer program that, when executed by a processor, implements the steps of a point cloud octree forest construction method as described in the above embodiments.
[0015] As can be seen from the above technical solution, the beneficial technical effects of the present invention are as follows:
[0016] 1. This scheme first divides the point cloud data into an initial grid, then further divides the initial grid into sub-grids for those whose size and the number of points within them both exceed thresholds, and finally divides the grid in the vertical direction to obtain the final target grid set. By constructing an octree in each grid of the target grid set, an octree forest of point clouds is ultimately built. This scheme uses two partitioning methods—planar partitioning, elevation partitioning, and octree partitioning—to adaptively segment the point cloud spatially. After being divided into an octree forest, it facilitates parallel processing in data analysis, processing, and display rendering applications, greatly improving processing efficiency.
[0017] 2. By storing the coordinate index array of the octree in sequence, and storing the octree attributes according to the storage order of the coordinate index array, the octree forest coordinates and attribute arrays are stored contiguously according to the coordinate order. This reduces the amount of data read in, and spatially adjacent coordinates and attributes are stored adjacently on the disk, which can facilitate faster data traversal. Attached Figure Description
[0018] To more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the accompanying drawings used in the description of the specific embodiments or the prior art will be briefly introduced below. In all the drawings, similar elements or parts are generally identified by similar reference numerals. In the drawings, the elements or parts are not necessarily drawn to scale.
[0019] Figure 1 This is a flowchart illustrating a point cloud octree forest construction method in one embodiment;
[0020] Figure 2 This is a structural block diagram of a point cloud octagonal tree forest construction system in one embodiment;
[0021] Figure 3 This is an internal structural diagram of a computer device in one embodiment. Detailed Implementation
[0022] The embodiments of the technical solution of the present invention will now be described in detail with reference to the accompanying drawings. These embodiments are merely illustrative of the technical solution of the present invention and are therefore intended to limit the scope of protection of the present invention.
[0023] It should be noted that, unless otherwise stated, the technical or scientific terms used in this application should have the ordinary meaning understood by those skilled in the art to which this invention pertains. The terms "first," "second," etc., in the specification, claims, and accompanying drawings of this disclosure are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data used can be interchanged where appropriate for the embodiments of this disclosure described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion. Unless otherwise stated, the term "a plurality of" means two or more. In this disclosure, the character " / " indicates that the preceding and following objects are in an "or" relationship. For example, A / B means: A or B. The term "and / or" describes an association relationship between objects, indicating that three relationships can exist. For example, A and / or B means: A or B, or, A and B. The term "corresponding" can refer to an association or binding relationship; A corresponding to B means that there is an association or binding relationship between A and B.
[0024] In the text: cell: grid. cellsize: grid size, ROW: total number of rows, COL: total number of columns. Cells[r,c]: grid cell. count: number of points in the grid cell. min: the coordinate of the lower left corner of the entire point cloud data range (i.e., the minimum coordinate range). max: the coordinate of the upper right corner of the entire point cloud data range (i.e., the maximum coordinate range). indices: an array of indices of the points in the point cloud data. i: the index of the point cloud. cells: a set of grids. cellset: a set of all grids at each stage. OctMaxCount: the maximum number of points in the cloud, OctMaxSize: the maximum size of the octree, subCells: multiple subgrids, subCell: subgrid, n: number of vertical divisions, vCells: a grid array of length n. OctNodeMinCount: the minimum number of points in the cloud, MaxLevel: the maximum level of the octree.
[0025] OctNode = {First, Count, Min, Max, Level, Next, Child}, an octree node, where First is the index of the first node in Cell.Indices; Count is the number of nodes in the node; Min and Max are the three-dimensional coordinates of the bottom-left and top-right corners of the node; Level is the node level (0 represents the root node); Next is its next sibling node; and Child is its first child node.
[0026] Root: The root node of the current grid as the octree. OctTrees = (Cell.Indiecs, Root): An octree forest. Otc: Each octree.
[0027] In one embodiment, such as Figure 1 As shown, a method for constructing a point cloud octree forest is provided, including the following steps:
[0028] S110 calculates the coordinate range of all point cloud data.
[0029] Specifically, the maximum coordinate value (max) of the statistical point cloud data. x ,max y ,max z ) and minimum coordinates (min) x ,min y ,min z ), max x and min x The calculation method is as follows:
[0030]
[0031] Where n is the number of point clouds, p is the number of point clouds, and Y is calculated according to the formula above. max Y min Z max and Z min The value of .
[0032] S120 divides the initial grid of point cloud data.
[0033] Specifically, the point cloud data is initially divided according to a preset grid size to obtain an initial grid.
[0034] In one embodiment, step S120 includes: obtaining the minimum coordinate range of the lower left corner and the maximum coordinate range of the upper right corner in the coordinate range of the point cloud data; preset the grid division size, and determine the number of rows and columns of the grid division based on the grid division size, the minimum coordinate range, and the maximum coordinate range; and dividing the coordinate range of the point cloud data according to the number of rows and columns to obtain an initial grid.
[0035] Specifically, let the minimum value of the lower left corner coordinate in all point cloud data be O = (min x ,min y If the grid size is Cellsize, then the total number of rows is... The total number of columns is: Create a grid with ROW rows and COL columns. The grid cell is represented as Cells[r,c] = (Count,Cellsize,Min,Max,Indices), where Count is the number of points in the grid cell, CellSize is the planar size of the grid cell, Min is the coordinate of the lower left corner, Max is the coordinate of the upper right corner of the cell, and Indices is an array of indices of the points contained in the cell in the point cloud data.
[0036] In one embodiment, step S120 further includes: calculating the grid row and column numbers corresponding to the point cloud data based on the point cloud data coordinates and the preset grid division size; and adding the point cloud data to the corresponding grid index array based on the index of the grid row and column numbers corresponding to the point cloud data; repeating the above steps until all the point cloud data are added to the grid index array, thereby completing the initial grid division of the point cloud data.
[0037] Specifically, all point clouds are traversed and assigned to their corresponding grids. For example, the correspondence between point clouds and grids can be established as follows: first, calculate the row and column number (r) of the corresponding grid for each point cloud. i c i The formula is as follows:
[0038]
[0039] where i is the index of the point cloud. The index of this point is added to the corresponding grid index array Cells[ri, ci]. Indices, and Cells[ri, ci]. Count is incremented by 1. All point clouds are traversed to complete the division of the initial grid of point clouds.
[0040] S130 performs sub-grid division on the initial grids whose size and the number of point clouds in both exceed the threshold.
[0041] Specifically, since the initial grid division is simply performed according to a preset size, there are cases where the point cloud data in some initial grids is excessive, or the size of the entire initial grid exceeds the range, so sub-grid division is required.
[0042] In order to avoid the point cloud quantity and size included in the octree from being too large, the maximum point cloud quantity OctMaxCount and the maximum octree size OctMaxSize are set. Since the octree is finally constructed with the grid as the unit, each grid corresponds to an octree. In order to avoid the point cloud quantity or size included in a single octree from being too large, constraints are imposed on the point cloud quantity and size of the octree. Therefore, the constraint conditions are also required during grid division, that is, the constraint conditions for the point cloud quantity and size are set. When the point cloud quantity and size of the grid Cell are less than the threshold, the grid is added to the Cellset set. The Cellset set is a transition set of grids, that is, the grid set obtained after dividing the sub-grid in step S130. Otherwise, then use the size to divide the grid into 4 sub-grids subCell, calculate the corresponding relationship between all points in the Cell and the subCell (sub-grid), and divide all points into their corresponding sub-grids. If the number of point clouds contained in the sub-grid subCell[i]. Count<OctMaxCount and the size subCell[i]. CellSize<OctMaxSize, stop the division; otherwise, continue to divide the sub-grid subCell[i] into 4 sub-grids, and so on, to complete the division of the sub-grid, where i is the index of the sub-grid. Finally, the sub-grid subCell is merged into the Cellset.
[0043] S140 re-divides all grids in the vertical direction to obtain a target grid set.
[0044] Specifically, the previous steps S120 and S130 are both grid divisions of the horizontal plane, and since the point cloud data is three-dimensional, it is also necessary to uniformly divide the grid from the vertical direction.
[0045] In one embodiment, step S140 includes: calculating the number of vertical divisions for each grid; vertically dividing grids with a vertical division number greater than 1; calculating the elevation interval of the grid; and vertically dividing the grid according to the number of vertical divisions and the elevation interval to obtain the target grid.
[0046] Specifically, for each grid cell, calculate the vertical division number n. If n > 1, then perform vertical division, where n = Max(Cell.Count / OctMinCount,(Cell.Max.z-Cell.min.z) / Cell.CellSize); calculate the elevation interval dZ = (Cell.Max.z-Cell.Min.z) / n; create a new Cell (grid) array vCells of length n; the planar coordinate range of the elements in vCells is the same as that of the Cell, and the elevation range n equally divides the elevation range of the Cell; for all points in the Cell, if its index is i, then add i to the index array of vCells[m], where m = (Pi.z-Cell.Min.z) / dZ; in CellSet, replace the corresponding Cell element with vCells.
[0047] S150 constructs an octree for each grid in the target grid set, resulting in a point cloud octree forest.
[0048] In one embodiment, step S150 includes: defining the minimum number of point clouds included in each octree node and the maximum level of the octree; taking the current grid as the root node of the octree, if the number of points in the root node is less than the minimum number of point clouds, then stopping node partitioning; if the number of points in the root node is greater than or equal to the minimum number of point clouds, partitioning is performed in three directions along the coordinate axes with the three-dimensional center coordinates of the root node as the center, resulting in eight child nodes; the child nodes are used as new root nodes for judgment and partitioning until all are less than the minimum number of point clouds, thus completing the construction of the octree; all the constructed octrees are combined to form a point cloud octree forest.
[0049] Specifically, constructing an octree for each grid in the target mesh set Cellset may include the following steps: Let the minimum number of point clouds included in each octree node be OctNodeMinCount and the maximum level of the octree be MaxLevel. An octree node is represented as OctNode = {First, Count, Min, Max, Level, Next, Child}, where First is the index of the first point in Cell.Indices, Count is the number of points in the node, Min and Max are the 3D coordinates of the lower left and upper right corners of the node, Level is the node level (0 represents the root node), Next is its next sibling node, and Child is its first child node. The current grid is taken as the root node of the octree. If the number of points in the current node is less than OctNodeMinCount, the partitioning process stops. Conversely, if the number of points in the current node is greater than or equal to OctNodeMinCount, then the node is divided along the coordinate axes in three directions, centered on the 3D center coordinates of the current root node, resulting in eight child nodes. The point cloud indices in Cell.Indices are then rearranged according to the order of the child nodes, and the values of First and Count for each child node are set. If the number of points in a child node is less than OctNodeMinCount, no further division is performed; otherwise, the node is divided into eight child nodes with that child node as the root node, and so on, completing the construction of the octree. The constructed octree forest is represented as OctTrees = (Cell.Indiecs, Root).
[0050] In one embodiment, after step S150, the method further includes storing the point cloud octagonal forest input file.
[0051] In one embodiment, the step of storing the point cloud octree forest input file includes: storing the coordinate index array of the octree in sequence; and storing the attributes of the octree according to the storage order of the coordinate index array.
[0052] Specifically, the current octree forest is saved to a file. The writing steps include: for each octree Otc in the OctTrees octree forest, the coordinates are written to the file sequentially according to its coordinate index array; for each octree Otc in the OctTrees octree forest, the other attributes are written to the file sequentially according to its coordinate index array, with each attribute stored contiguously. For each octree Otc in the OctTrees octree forest, the index is written to the file.
[0053] In one embodiment, such as Figure 2The diagram illustrates a point cloud octree forest construction system, comprising a range calculation module 210, a grid partitioning module 220, and an octree construction module 230, wherein:
[0054] The range calculation module 210 is used to calculate the coordinate range of all point cloud data;
[0055] Grid division module 220 is used to divide the point cloud data into initial grids;
[0056] The grid division module 220 is also used to divide the initial grid into subgrids for initial grids whose size and number of point clouds both exceed the threshold.
[0057] The grid division module 220 is also used to further divide all grids in the vertical direction to obtain the target grid set;
[0058] Octree building module 230 is used to build an octree for each grid in the target grid set to obtain a point cloud octree forest.
[0059] In one embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be as follows: Figure 3 As shown, the computer device includes a processor, memory, network interface, and database connected via a system bus. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and the database. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The database stores configuration templates and can also be used to store target webpage data. The network interface communicates with external terminals via a network connection. When executed by the processor, the computer program implements a point cloud octree forest construction method.
[0060] Those skilled in the art will understand that Figure 3 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0061] In one embodiment, a storage medium is also provided, the storage medium storing a computer program, the computer program including program instructions that, when executed by a computer, cause the computer to perform the method described in the foregoing embodiments, the computer being part of a point cloud octtree forest construction system mentioned above.
[0062] It is obvious to those skilled in the art that the modules or steps of the present invention described above can be implemented using general-purpose computing devices. They can be centralized on a single computing device or distributed across a network of multiple computing devices. Optionally, they can be implemented using computer-executable program code, thereby storing them in a computer storage medium (ROM / RAM, magnetic disk, optical disk) for execution by the computing device. In some cases, the steps shown or described can be performed in a different order than those described herein, or they can be fabricated as separate integrated circuit modules, or multiple modules or steps can be fabricated as a single integrated circuit module. Therefore, the present invention is not limited to any particular hardware and software combination.
[0063] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some or all of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention, and they should all be covered within the scope of the claims and specification of the present invention.
Claims
1. A method for constructing an octagonal forest from point clouds, characterized in that, include: Calculate the coordinate range of all point cloud data; The initial grid is used to divide the point cloud data; For initial grids whose size and the number of point clouds within them both exceed the threshold, subgrids are created. The entire grid is further subdivided in the vertical direction to obtain the target grid set; An octree is constructed for each grid in the target grid set to obtain a point cloud octree forest; The initial grid division step for the point cloud data includes: Get the minimum coordinate range of the bottom left corner and the maximum coordinate range of the top right corner in the point cloud data coordinate range; The grid division size is preset, and the number of rows and columns of the grid division is determined based on the grid division size, the minimum value of the coordinate range, and the maximum value of the coordinate range; The coordinate range of the point cloud data is divided according to the number of rows and columns to obtain an initial grid. Calculate the grid row and column numbers corresponding to the point cloud data based on the point cloud data coordinates and the preset grid division size; And according to the index of the grid row and column number corresponding to the point cloud data, the point cloud data is added to the corresponding grid index array; Repeat the above steps until all point cloud data are added to the grid index array, completing the initial grid division of the point cloud data; The steps to further subdivide all grids vertically to obtain the target grid set include: Calculate the number of vertical divisions for each grid cell; Vertically divide the grid with a vertical division number greater than 1; Calculate the elevation interval of the grid; The grid is vertically divided according to the number of vertical divisions and the elevation interval to obtain the target grid. Specifically: For each grid cell, calculate the number of vertical divisions n. If n > 1, then perform vertical division, where n = Max(Cell.Count / OctMinCount, (Cell.Max.z - Cell.min.z) / Cell.CellSize); Calculate the elevation interval dZ = (Cell.Max.z - Cell.Min.z) / n; Create a new Cell array vCells of length n; The planar coordinate range of the elements in vCells is the same as that of Cell, and the elevation range n is divided into equal parts of the elevation range of Cell; For all points in Cell, if its index is i, then add i to the index array of vCells[m], where m = (Pi.z - Cell.Min.z) / dZ; In CellSet, replace the corresponding Cell elements with vCells; where Cell is the grid, Count is the number of points in the grid cell, CellSize is the planar size of the grid cell, Min is the coordinate of the lower left corner, Max is the coordinate of the upper right corner of the Cell, vCells is a grid array of length n, OctMinCount is the minimum number of points in the point cloud; The step of constructing an octree for each grid in the target grid set to obtain a point cloud octree forest includes: Define the minimum number of point clouds included in each octree node and the maximum level of the octree; The current grid is used as the root node of the octree. If the number of points in the root node is less than the minimum number of points in the point cloud, then the node partitioning is stopped. If the number of points in the root node is greater than or equal to the minimum number of points in the point cloud, the three-dimensional center coordinates of the root node are used as the center, and the points are divided in three directions along the coordinate axes to obtain eight child nodes. The child nodes are used as new root nodes for judgment and division until all of them are less than the minimum number of point clouds, thus completing the construction of the octree; All the constructed octrees are combined to form a point cloud octree forest.
2. The method for constructing a point cloud octree forest according to claim 1, characterized in that, After constructing an octree for each grid in the target grid set to obtain a point cloud octree forest, the process further includes: The point cloud octree forest is stored in the input file.
3. The method for constructing a point cloud octree forest according to claim 2, characterized in that, The step of storing the point cloud octree forest input file includes: The coordinate index array of the octree is stored in order; The attributes of the octree are stored according to the order in which the coordinate index array is stored.
4. A point cloud octagonal tree forest construction system, characterized in that, It includes a range calculation module, a grid partitioning module, and an octree construction module, among which: The range calculation module is used to calculate the coordinate range of all point cloud data; The grid division module is used to divide the point cloud data into an initial grid, including: Get the minimum coordinate range of the bottom left corner and the maximum coordinate range of the top right corner in the point cloud data coordinate range; The grid division size is preset, and the number of rows and columns of the grid division is determined based on the grid division size, the minimum value of the coordinate range, and the maximum value of the coordinate range; The coordinate range of the point cloud data is divided according to the number of rows and columns to obtain an initial grid. Calculate the grid row and column numbers corresponding to the point cloud data based on the point cloud data coordinates and the preset grid division size; And according to the index of the grid row and column number corresponding to the point cloud data, the point cloud data is added to the corresponding grid index array; Repeat the above steps until all point cloud data are added to the grid index array, completing the initial grid division of the point cloud data; The grid division module is also used to divide the initial grid into sub-grids if the size of the initial grid and the number of point clouds within it both exceed the threshold. The grid division module is further configured to further divide all grids in the vertical direction to obtain a target grid set, including: Calculate the number of vertical divisions for each grid cell; Vertically divide the grid with a vertical division number greater than 1; Calculate the elevation interval of the grid; The grid is vertically divided according to the number of vertical divisions and the elevation interval to obtain the target grid. Specifically: For each grid cell, calculate the number of vertical divisions n. If n > 1, then perform vertical division, where n = Max(Cell.Count / OctMinCount, (Cell.Max.z - Cell.min.z) / Cell.CellSize); Calculate the elevation interval dZ = (Cell.Max.z - Cell.Min.z) / n; Create a new Cell array vCells of length n; The planar coordinate range of the elements in vCells is the same as that of Cell, and the elevation range n is divided into equal parts of the elevation range of Cell; For all points in Cell, if its index is i, then add i to the index array of vCells[m], where m = (Pi.z - Cell.Min.z) / dZ; In CellSet, replace the corresponding Cell elements with vCells; where Cell is the grid, Count is the number of points in the grid cell, CellSize is the planar size of the grid cell, Min is the coordinate of the lower left corner, Max is the coordinate of the upper right corner of the Cell, vCells is a grid array of length n, OctMinCount is the minimum number of points in the point cloud; The octree construction module is used to construct an octree for each grid in the target grid set, resulting in a point cloud octree forest, including: Define the minimum number of point clouds included in each octree node and the maximum level of the octree; The current grid is used as the root node of the octree. If the number of points in the root node is less than the minimum number of points in the point cloud, then the node partitioning is stopped. If the number of points in the root node is greater than or equal to the minimum number of points in the point cloud, the three-dimensional center coordinates of the root node are used as the center, and the points are divided in three directions along the coordinate axes to obtain eight child nodes. The child nodes are used as new root nodes for judgment and division until all of them are less than the minimum number of point clouds, thus completing the construction of the octree; All the constructed octrees are combined to form a point cloud octree forest.
5. A computer device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 3.
6. A storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 3.
Citation Information
Patent Citations
A spatial index construction method and device for mass point cloud data
CN106407408A
Mass point cloud data multi-view rendering method
CN114387375A
