A switch cabinet point cloud indexing method and device based on octree
Through the point cloud indexing method based on octree, the point cloud data of the switch cabinet is divided into subcube space bodies and the octree encoding is constructed, which solves the problem of waste of point cloud data access performance of the switch cabinet and realizes efficient data storage and access.
Patent Information
- Application Number
- CN202110581667.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-05-26
- Publication Date
- 2025-06-06
- Estimated Expiration
- 2041-05-26
AI Technical Summary
In the prior art, the data access of point clouds at switch cabinets has a problem of performance waste, especially in different geometric detection requirements for different chamber parts. Point clouds with the same resolution and data volume are used for detection, resulting in waste of resources.
The point cloud indexing method based on octree is adopted to divide the point cloud scanning data of the switch cabinet into subcube space bodies of different levels according to the segmentation depth. The octree encoding is constructed through the spatial index value, and converted it into a point cloud format file to create a dedicated file to store point cloud data at different levels.
It realizes efficient indexing, storage and access to point cloud data of switch cabinets, avoids performance waste, reduces I/O redundancy of point cloud data, and improves data reading and search efficiency in three-dimensional detection.
Smart Images

Figure CN113377978B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of point cloud data processing, and in particular to an octree-based switch cabinet point cloud indexing method and device. Background Art
[0002] Switchgear objects are large in size and have a particularly large number of data points in the point cloud. In actual inspection and other projects, different resolution data are often required to cope with different application contents. In the process of geometric inspection of switchgear, switchgear objects are large in size and have a particularly large number of data points in the point cloud. Moreover, in actual projects, the inspection accuracy requirements of different geometric inspection items in different chambers are different. For the switchgear with lower inspection accuracy requirements, the flatness of the large planes on the cabinet surface, the length, width and height of the cabinet, the verticality and horizontality of the cabinet placement, etc., are used with the same resolution and data volume point cloud for inspection, which obviously has performance waste problems. At present, the academic and industrial circles have not yet carried out research on the organization method of switchgear point cloud data. Therefore, how to efficiently access the switchgear point cloud data is an urgent problem to be solved. Summary of the invention
[0003] In view of this, it is necessary to provide an octree-based switch cabinet point cloud indexing method and device to solve the problem of switch cabinet point cloud data access performance waste in the prior art.
[0004] The present invention provides a switch cabinet point cloud indexing method based on an octree, comprising:
[0005] Obtain point cloud scanning data of the switch cabinet;
[0006] According to the segmentation depth of the point cloud octree established corresponding to the point cloud scanning data, the point cloud scanning data is divided into at least one sub-cube space volume corresponding to different levels;
[0007] Scan and traverse the at least one sub-cube space volume to determine a corresponding space index value, determine a corresponding octree code according to the space index value, and convert the octree code into a corresponding point cloud format file;
[0008] For different levels, exclusive files are created to store the point cloud format file of the corresponding at least one sub-cube space volume.
[0009] Furthermore, the determination of the segmentation depth includes:
[0010] Determine the maximum circumscribed side length according to the maximum side length of the circumscribed spatial bounding box of the point cloud scanning data;
[0011] The segmentation depth is determined according to the maximum circumscribed side length.
[0012] Furthermore, the segmentation depth is determined by the following formula:
[0013] d 0 *2 n ≥d max
[0014] Among them, d 0 is the segmentation depth, n represents the total number of different levels of the point cloud octree, d max is the maximum circumscribed side length.
[0015] Furthermore, the scanning and traversing the at least one sub-cube space volume to determine the corresponding space index value includes:
[0016] At different levels, scanning point cloud traversal is performed on the at least one sub-cube space volume according to a depth traversal order to determine the three-dimensional coordinates of each point cloud data therein;
[0017] The spatial index value corresponding to each point cloud data is determined according to the three-dimensional coordinates of each point cloud data, the segmentation depth and the standard coordinate components, wherein the standard coordinate components are the three coordinate components of the minimum data point of the circumscribed spatial bounding box of the point cloud scanning data.
[0018] Furthermore, the spatial index value corresponding to each point cloud data is determined by the following formula:
[0019]
[0020] Among them, (x, y, z) represents the three-dimensional coordinates of the point cloud data, (i, j, k) represents the spatial index value corresponding to the point cloud data, […] represents rounding down, x min ,y min 、z min Respectively represent the three coordinate components of the standard coordinate components, d 0 represents the segmentation depth.
[0021] Further, determining the corresponding octree code according to the spatial index value includes:
[0022] Perform binary conversion according to the spatial index value, converting the spatial index value into an n-bit binary number, where n is an integer;
[0023] Perform binary multiplication on the n-bit binary number to determine the total binary number corresponding to the point cloud data;
[0024] In different levels, the total binary numbers corresponding to all point cloud data of the at least one sub-cube space volume constitute the corresponding octree code.
[0025] Furthermore, the converting of the octree encoding into a corresponding point cloud format file includes: for different levels, saving the octree encoding of the at least one sub-cube space body into a point cloud format file of point cloud data, wherein the point cloud format file includes but is not limited to STL format and PCD format.
[0026] Furthermore, the step of creating dedicated files for different levels to store the corresponding point cloud format file of at least one sub-cube space volume includes:
[0027] For different levels, determining the coordinate range, level and point cloud format file of the corresponding at least one sub-cube space volume;
[0028] A dedicated file is created to store the coordinate range, the level and the point cloud format file of the at least one sub-cube space volume at different levels.
[0029] Furthermore, it also includes:
[0030] Get the input level parameters, point cloud resolution parameters, and bounding box coordinate parameters;
[0031] According to the level parameters, the point cloud resolution parameters and the bounding box coordinate parameters, data is quickly queried and accessed in different dedicated files to determine the point cloud data that needs to be found.
[0032] The present invention also provides an octree-based switch cabinet point cloud indexing device, including a processor and a memory, wherein a computer program is stored in the memory. When the computer program is executed by the processor, the octree-based switch cabinet point cloud indexing method as described above is implemented.
[0033] Compared with the prior art, the beneficial effects of the present invention include: first, effectively acquiring the point cloud scanning data of the switch cabinet; then, based on the segmentation depth, dividing the point cloud scanning data into different sub-cube space bodies, which is conducive to classifying point clouds with different resolutions and different data volumes, and facilitating subsequent searches; further, using the spatial retrieval value, constructing the octree encoding of different sub-cube space bodies, converting them into point cloud format files, reducing the storage data, effectively storing the point cloud data composed of each sub-cube space body, and facilitating efficient access; finally, creating a dedicated file, for each sub-cube space body in different levels of the point cloud format file, so as to quickly retrieve and locate the point cloud data through different level parameters, different resolutions, and different bounding box coordinate parameters. In summary, the present invention optimizes the operations such as indexing, storage, and access search of switch cabinet point cloud data based on the data organization method implemented by the regular octree, avoids performance waste, realizes efficient query and access of switch cabinet point cloud data, reduces the I / O redundancy of point cloud data in switch cabinet detection, and provides effective methods and means for efficient reading and searching in three-dimensional detection of switch cabinet. BRIEF DESCRIPTION OF THE DRAWINGS
[0034] Figure 1 A schematic diagram of a flow chart of an embodiment of a switch cabinet point cloud indexing method based on an octree provided by the present invention;
[0035] Figure 2 The present invention provides Figure 1 A schematic diagram of a flow chart of an embodiment of step S2 in FIG.
[0036] Figure 3 The present invention provides Figure 1 Schematic diagram of the process of step S3 in an embodiment Figure 1 ;
[0037] Figure 4 The present invention provides Figure 1 Schematic diagram of the process of step S3 in an embodiment Figure 2 ;
[0038] Figure 5 The present invention provides Figure 1 A schematic diagram of a flow chart of an embodiment of step S4 in FIG.
[0039] Figure 6 A schematic diagram of a process of accessing point cloud data according to an embodiment of the present invention;
[0040] Figure 7 A data schematic diagram of an octree point cloud embodiment provided by the present invention;
[0041] Figure 8 A data schematic diagram of an embodiment of creating a file provided by the present invention. DETAILED DESCRIPTION
[0042] The preferred embodiments of the present invention are described in detail below in conjunction with the accompanying drawings, wherein the accompanying drawings constitute a part of this application and are used together with the embodiments of the present invention to illustrate the principles of the present invention, but are not used to limit the scope of the present invention.
[0043] The embodiment of the present invention provides a switch cabinet point cloud indexing method based on an octree. Figure 1 Come and see, Figure 1 A schematic flow chart of an embodiment of a switch cabinet point cloud indexing method based on an octree provided by the present invention includes steps S1 to S4, wherein:
[0044] In step S1, point cloud scanning data of the switch cabinet is obtained;
[0045] In step S2, the point cloud scan data is divided into at least one sub-cube space volume corresponding to different levels according to the segmentation depth of the point cloud octree established corresponding to the point cloud scan data;
[0046] In step S3, the at least one sub-cube space volume is scanned and traversed to determine a corresponding spatial index value, and a corresponding octree code is determined according to the spatial index value, and the octree code is converted into a corresponding point cloud format file;
[0047] In step S4, for different levels, dedicated files are created to store the point cloud format file of the corresponding at least one sub-cube space volume.
[0048] In an embodiment of the present invention, first, the point cloud scanning data of the switch cabinet is effectively acquired; then, based on the segmentation depth, the point cloud scanning data is divided into different sub-cube space bodies, which is conducive to classifying point clouds with different resolutions and different data volumes, and is convenient for subsequent searches; then, using the spatial retrieval value, octree encodings of different sub-cube space bodies are constructed and converted into point cloud format files, which reduces the storage data, effectively stores the point cloud data composed of each sub-cube space body, and facilitates efficient access; finally, create exclusive files, point cloud format files for each sub-cube space body in different levels, so as to quickly and efficiently retrieve and locate the point cloud data through different level parameters, different resolutions, and different bounding box coordinate parameters.
[0049] As a preferred embodiment, Figure 2 Come and see, Figure 2 The present invention provides Figure 1 The flow chart of step S2 in an embodiment of the present invention is as follows. The determination of the segmentation depth in step S2 includes steps S21 to S22, wherein:
[0050] In step S21, the maximum circumscribed side length is determined according to the maximum side length of the circumscribed space bounding box of the point cloud scanning data;
[0051] In step S22, the segmentation depth is determined according to the maximum circumscribed side length.
[0052] As a specific embodiment, the embodiment of the present invention determines the segmentation depth in order to perform stratification and realize data classification of point clouds with different resolutions and different data volumes. It should be noted that the boundary of the external space bounding box is generally automatically calculated by the input scan point cloud, and the minimum division distance is set by the software program, and can also be manually adjusted according to actual needs.
[0053] As a preferred embodiment, the segmentation depth is determined by the following formula:
[0054] d 0 *2 n ≥d max
[0055] Among them, d 0 is the segmentation depth, n represents the total number of different levels of the point cloud octree, d max is the maximum circumscribed side length.
[0056] As a specific embodiment, the embodiment of the present invention utilizes segmentation depth to divide the entire point cloud scanning data into a number of sub-cubic space volumes.
[0057] As a preferred embodiment, Figure 3 Come and see, Figure 3 The present invention provides Figure 1 Schematic diagram of the process of step S3 in an embodiment Figure 1 The determination of the spatial index value in step S3 includes steps S31 to S32, wherein:
[0058] In step S31, at different levels, according to the depth traversal order, scanning point cloud traversal is performed on the at least one sub-cube space volume to determine the three-dimensional coordinates of each point cloud data therein;
[0059] In step S32, the spatial index value corresponding to each point cloud data is determined based on the three-dimensional coordinates of each point cloud data, the segmentation depth and the standard coordinate components, wherein the standard coordinate components are the three coordinate components of the minimum data point of the circumscribed spatial bounding box of the point cloud scanning data.
[0060] As a specific embodiment, the embodiment of the present invention uses three-dimensional coordinates, segmentation depth and standard coordinate components to determine the spatial index value corresponding to each point cloud data.
[0061] As a preferred embodiment, the spatial index value corresponding to each point cloud data is determined by the following formula:
[0062]
[0063] Among them, (x, y, z) represents the three-dimensional coordinates of the point cloud data, (i, j, k) represents the spatial index value corresponding to the point cloud data, […] represents rounding down, x min ,y min 、z min Respectively represent the three coordinate components of the standard coordinate components, d 0 represents the segmentation depth.
[0064] As a specific embodiment, the embodiment of the present invention uses the above formula to determine the spatial index value corresponding to each point cloud data.
[0065] As a preferred embodiment, Figure 4 Come and see, Figure 4 The present invention provides Figure 1 Schematic diagram of the process of step S3 in an embodiment Figure 2 The determination of the octree in step S3 includes steps S33 to S35, wherein:
[0066] In step S33, binary conversion is performed according to the spatial index value, and the spatial index value is converted into an n-bit binary number, where n is an integer;
[0067] In step S34, the n-bit binary number is converted into a binary number by binary multiplication to determine the total binary number corresponding to the point cloud data;
[0068] In step S35, in different levels, the total binary numbers corresponding to all point cloud data of the at least one sub-cube space volume constitute the corresponding octree code.
[0069] As a specific embodiment, the embodiment of the present invention utilizes binary conversion of the spatial index value to determine the corresponding octree code.
[0070] In a specific embodiment of the present invention, the spatial index value (i, j, k) is converted into a binary number, that is, (i, j, k) is converted into an n-bit binary number to obtain:
[0071]
[0072] Among them, i m , j m , k m ∈{0,1},m∈{0,1,…,n-1}
[0073] Furthermore, i m, j m , k m Based on the formula Stored as a new binary number q m ,q m That is the total binary number of point cloud data.
[0074] At the same time, according to the above formula, when the octree code Q representing the node space is known, the spatial index value (i, j, k) corresponding to the sub-cube where the node is located can also be substituted and inversely calculated. The calculation process is shown in the following formula:
[0075]
[0076] The percent sign represents division with a remainder, and […] means rounding down.
[0077] As a preferred embodiment, the converting of the octree code into a corresponding point cloud format file includes: for different levels, the octree code of the at least one sub-cube volume is used to save the point cloud format file of the point cloud data, wherein the point cloud format file includes but is not limited to the stl format and the pcd format. As a specific embodiment, the embodiment of the present invention effectively stores the octree code to facilitate subsequent access and search.
[0078] As a preferred embodiment, Figure 5 Come and see, Figure 5 The present invention provides Figure 1 The flowchart of step S4 in the embodiment of FIG. 1 is a flowchart of step S4, wherein step S4 includes step S41 to step S42, wherein:
[0079] In step S41, for different levels, the coordinate range, level and point cloud format file of the corresponding at least one sub-cube space volume are determined;
[0080] In step S42, a dedicated file is created to store the coordinate range, the level and the point cloud format file of the at least one sub-cube space volume at different levels.
[0081] As a specific embodiment, the embodiment of the present invention creates a dedicated format text file at a corresponding level to save information such as the sub-cube coordinate range, level, and corresponding three-dimensional point cloud file path.
[0082] As a preferred embodiment, Figure 6 Come and see, Figure 6 A schematic diagram of a process of accessing point cloud data according to an embodiment of the present invention includes steps S5 to S6, wherein:
[0083] In step S5, the input level parameters, point cloud resolution parameters and bounding box coordinate parameters are obtained;
[0084] In step S6, based on the level parameters, the point cloud resolution parameters and the bounding box coordinate parameters, data is quickly queried and accessed in different dedicated files to determine the point cloud data to be searched.
[0085] As a specific embodiment, after completing the construction of the switch cabinet octree data organization, the embodiment of the present invention inputs parameters such as level parameters, point cloud resolution, and bounding box coordinates through software to quickly query and access data.
[0086] In a specific embodiment of the present invention, Figure 7 , Figure 8 Come and see, Figure 7 A data schematic diagram of an octree point cloud embodiment provided by the present invention, Figure 8 This is a data schematic diagram of an embodiment of creating a file provided by the present invention. The above-mentioned switch cabinet point cloud index based on octree includes:
[0087] The first step is to input the switch cabinet scan point cloud for which the data structure needs to be constructed. When inputting the point cloud, two variables are used to record the maximum and minimum coordinates of the scan point cloud, thereby determining the corresponding scan point cloud bounding box coordinates.
[0088] The bounding box boundary values for the scan data recorded on the inside of the back of the switch cabinet are:
[0089] (-919.5607757568359,-1359.998168945313,-5790.4091796875) and (1577.512954721914,1137.075561533437,-3293.33544920875).
[0090] The second step is to determine the minimum division distance or number of division layers for the corresponding point cloud data segmentation. If the minimum division distance is input according to d 0 *2 n ≥d max Calculate the corresponding number of division layers, where d 0 is the minimum partition distance, n represents the number of point cloud octree partition layers, d max is the maximum side length of the bounding box of the point cloud data. Correspondingly, if the number of division levels is input, the minimum division distance is still calculated according to this formula for reference in subsequent steps;
[0091] Among them, the method of directly inputting the number of division layers is adopted, and the number of division layers is directly set to 4 for the scan data of the inner side of the back side of the switch cabinet.
[0092] The third step is to divide the switch cabinet point cloud data into several sub-cube spaces according to the number of division layers obtained, traverse all data points in the scanned point cloud, divide the sub-cube spaces to which they belong according to the above formula and determine the corresponding space index values (i, j, k), and then perform binary conversion on the space index values (i, j, k), that is, convert (i, j, k) into an n-bit binary number to obtain: i m , j m , k m ∈{0,1}, m∈{0,1,…,n-1}, and then i m , j m , k m Based on the formula q m =i m 2 0 +j m 2 1 +k m 2 2 Stored as a new binary number q m ;
[0093] The fourth step is to convert and store the obtained coded values, and store the results of the octree sampling of each sub-cube space volume at each level, and divide them into three-dimensional point cloud format files such as stl and pcd to save the point cloud data point information;
[0094] Among them, different octree point clouds can be accessed through hierarchical parameters and octree encoding. The display effect of octree hierarchical storage is as follows Figure 7 As shown;
[0095] Step 5: Create a dedicated format text file at the corresponding level to save the current sub-cube coordinate range, level, and corresponding 3D point cloud file path information for subsequent query and access work;
[0096] Among them, the octree file directory structure obtained by dividing the level into 4 is as follows Figure 8 As shown;
[0097] Step 6. After the data is stored, the software can be used to input relevant parameters such as level parameters, point cloud resolution, and bounding box coordinates to query and access specific octree areas.
[0098] Among them, the query access is performed on each area in the scanned point cloud of the rear side of the switch cabinet, and the access test is performed on the scanned point cloud of the rear side of the switch cabinet with a precision of 25 mm in a laptop computing environment with a CPU model of Intel Core i5 4260U, a CPU main frequency of 1.4 GHz, a graphics card model of Intel HD Graphics 5000, a memory capacity of 4G, and a quad-core processor, and the calculation efficiency results shown in Table 1 are obtained. It can be seen that the present invention has a significant efficiency improvement effect in querying and scanning point cloud data of switch cabinet objects.
[0099] Table 1
[0100] Serial number Target area Time consumed (ms) 1 Switch cabinet rear overall 6416 2 Switch cabinet rear door 2712 3 Switch cabinet rear side surface 1529 4 Busbar room side 2479 5 Outside busbar room 3230
[0101] An embodiment of the present invention also provides an octree-based switch cabinet point cloud indexing device, including a processor and a memory, wherein a computer program is stored in the memory. When the computer program is executed by the processor, the octree-based switch cabinet point cloud indexing method as described above is implemented.
[0102] The present invention discloses a switch cabinet point cloud indexing method and device based on octree. Firstly, the point cloud scanning data of the switch cabinet is effectively acquired; then, based on the segmentation depth, the point cloud scanning data is divided into different sub-cube space bodies, which is conducive to classifying point clouds with different resolutions and different data volumes, and is convenient for subsequent search; then, using the spatial retrieval value, the octree encoding of different sub-cube space bodies is constructed and converted into a point cloud format file, which reduces the storage data, effectively stores the point cloud data composed of each sub-cube space body, and is convenient for efficient access; finally, a dedicated file is created, and the point cloud format file of each sub-cube space body in different levels is used, so as to quickly retrieve and locate the point cloud data through different level parameters, different resolutions, and different bounding box coordinate parameters.
[0103] The technical solution of the present invention is a data organization method based on a regular octree, which optimizes operations such as indexing, storage, and access search of switch cabinet point cloud data, avoids performance waste, realizes efficient query and access of switch cabinet point cloud data, reduces the I / O redundancy of point cloud data in switch cabinet detection, and provides effective methods and means for efficient reading and searching in three-dimensional detection of switch cabinets.
[0104] The above description is only a preferred specific implementation manner of the present invention, but the protection scope of the present invention is not limited thereto. Any changes or substitutions that can be easily conceived by any technician familiar with the technical field within the technical scope disclosed by the present invention should be covered within the protection scope of the present invention.
Claims
1. A switch cabinet point cloud indexing method based on octree, It is characterized in that include: Obtain point cloud scanning data of the switch cabinet; According to the segmentation depth of the point cloud octree established corresponding to the point cloud scanning data, the point cloud scanning data is divided into at least one sub-cube space volume corresponding to different levels, and the different levels are used to realize data classification of point clouds with different resolutions and different data volumes; Scan and traverse the at least one sub-cube space volume to determine a corresponding space index value, determine a corresponding octree code according to the space index value, and convert the octree code into a corresponding point cloud format file; For different levels, create dedicated files to store the point cloud format file of the corresponding at least one sub-cube space volume; The scanning and traversing of the at least one sub-cube space volume to determine the corresponding space index value comprises: At different levels, scanning point cloud traversal is performed on the at least one sub-cube space volume according to a depth traversal order to determine the three-dimensional coordinates of each point cloud data therein; Determine the spatial index value corresponding to each point cloud data according to the three-dimensional coordinates of each point cloud data, the segmentation depth and the standard coordinate components, wherein the standard coordinate components are the three coordinate components of the minimum data point of the circumscribed spatial bounding box of the point cloud scan data; The spatial index value corresponding to each point cloud data is determined by the following formula: Among them, (x, y, z) represents the three-dimensional coordinates of the point cloud data, (i, j, k) represents the spatial index value corresponding to the point cloud data, […] represents rounding down, x min ,y min 、z min Respectively represent the three coordinate components of the standard coordinate components, represents the segmentation depth; Determining the corresponding octree code according to the spatial index value includes: Perform binary conversion according to the spatial index value, converting the spatial index value into an n-bit binary number, where n is an integer; Perform binary multiplication on the n-bit binary number to determine the total binary number corresponding to the point cloud data; In different levels, the total binary numbers corresponding to all point cloud data of the at least one sub-cube space volume constitute the corresponding octree code.
2. According to the octree-based switch cabinet point cloud indexing method of claim 1, It is characterized in that The determination of the segmentation depth includes: Determine the maximum circumscribed side length according to the maximum side length of the circumscribed spatial bounding box of the point cloud scanning data; The segmentation depth is determined according to the maximum circumscribed side length.
3. The switch cabinet point cloud indexing method based on octree according to claim 2, It is characterized in that The segmentation depth is determined by the following formula: in, is the segmentation depth, n represents the total number of different levels of the point cloud octree, is the maximum circumscribed side length.
4. The switch cabinet point cloud indexing method based on octree according to claim 1, It is characterized in that The converting of the octree code into a corresponding point cloud format file comprises: for different levels, saving the octree code of the at least one sub-cube space body into a point cloud format file of point cloud data, wherein the point cloud format file includes but is not limited to STL format and PCD format.
5. The switch cabinet point cloud indexing method based on octree according to claim 1, It is characterized in that The step of creating dedicated files for storing the corresponding point cloud format file of at least one sub-cube space volume at different levels includes: For different levels, determining the coordinate range, level and point cloud format file of the corresponding at least one sub-cube space volume; A dedicated file is created to store the coordinate range, the level and the point cloud format file of the at least one sub-cube space volume at different levels.
6. The switch cabinet point cloud indexing method based on octree according to claim 1, It is characterized in that Also includes: Get the input level parameters, point cloud resolution parameters, and bounding box coordinate parameters; According to the level parameters, the point cloud resolution parameters and the bounding box coordinate parameters, data is quickly queried and accessed in different dedicated files to determine the point cloud data that needs to be found.
7. A switch cabinet point cloud indexing device based on octree, It is characterized in that It includes a processor and a memory, wherein a computer program is stored in the memory. When the computer program is executed by the processor, the octree-based switch cabinet point cloud indexing method according to any one of claims 1 to 6 is implemented.
Citation Information
Patent Citations
Method and device for storing point cloud data
CN106874409A
A Web-oriented method for data publishing and visualization of building information model
CN109299548A