A method for massive point cloud management and fast loading
By constructing an undirected graph of point cloud relationships and storing it in binary files, the problems of slow point cloud data loading and high memory consumption were solved, enabling fast loading and flexible retrieval, and improving the efficiency of point cloud data management.
Patent Information
- Application Number
- CN202211313434.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-10-25
- Publication Date
- 2025-12-05
- Estimated Expiration
- 2042-10-25
AI Technical Summary
In existing technologies, the amount of vehicle-mounted point cloud data is enormous, resulting in low efficiency in data storage, management, and loading, which affects work efficiency.
By constructing an undirected graph of point cloud relationships, point cloud data is loaded and unloaded based on spatial relationships. Member variables of point cloud data objects are stored in binary files to achieve fast loading and unloading.
It improves the loading speed and memory management efficiency of point cloud data, supports flexible retrieval and display, reduces memory usage, and enhances workflow smoothness.
Smart Images

Figure CN115640126B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of point cloud loading, and in particular to a method for managing and rapidly loading massive point clouds. Background Technology
[0002] With the development of 3D laser scanning technology, point cloud data has become an important data source for new basic surveying and mapping. It contains various information such as 3D coordinates, reflection intensity, and color, and has the advantages of high precision and high efficiency. It can quickly acquire a large amount of ground feature information, greatly reducing the workload of field surveying. However, due to its high precision and large amount of information, the volume of point cloud data is enormous, reaching terabytes, which poses difficulties for data storage, management, querying, and visualization.
[0003] Vehicle-mounted point cloud data, as one of the main data sources for new basic surveying and mapping, provides rich road information. During feature acquisition, it is necessary to load continuous point cloud data within a certain range at once to extract terrain data for that area. However, the resulting vehicle-mounted point cloud data is segmented; a complete road may consist of several LAS files. This requires locating the corresponding LAS files within a folder. Currently, when using vehicle-mounted point cloud data for feature acquisition and data production on roads, traditional methods are used for point cloud data management and loading. However, commonly used LAS file loading methods are slow, requiring long loading times each time, impacting work efficiency. Furthermore, loading too many point clouds at once leads to excessive computer memory consumption, while loading too few makes it impossible to understand the overall data situation, hindering work. Therefore, a method for quickly loading and unloading point clouds is needed. Summary of the Invention
[0004] The purpose of this invention is to overcome the shortcomings of the existing technology by providing a method for managing and rapidly loading massive point cloud data that meets different retrieval conditions and allows for flexible loading and unloading of point cloud data.
[0005] The objective of this invention can be achieved through the following technical solutions:
[0006] A method for managing massive point clouds and loading them quickly includes the following steps:
[0007] S1. Write the member variables of the point cloud data object into the output file stream object in binary code to generate a binary file containing the member variables. The member variables include the file path, the coordinates of the smallest bounding cube, the coordinate array of all points, the reflection intensity array of all points, and the RGB color array of all points.
[0008] S2. Read the coordinates of the smallest bounding box in each binary file to obtain the bounding box of the cuboid, and load and display the bounding box of the cuboid.
[0009] S3. Calculate the spatial relationship between each cuboid bounding box and other cuboid bounding boxes respectively. Using the point cloud data corresponding to the cuboid bounding box as vertices and the spatial relationship between the cuboid bounding boxes that meets the conditions as undirected edges, construct an undirected graph of point cloud relationships. The conditions that the spatial relationship meets are: the two cuboid bounding boxes are connected or intersecting, and the weight of the edge between the two cuboid bounding boxes is the planar distance between the center points of the two cuboid bounding boxes.
[0010] S4. Obtain the initial point cloud and search condition information selected by the user in the displayed cuboid range box, and retrieve the target point cloud data based on the undirected graph of point cloud relationships, the initial point cloud, and the search condition information. The search condition information is the number of searches or the search range.
[0011] S5. Read the binary file corresponding to the target point cloud data, sequentially read the member variables in the binary file corresponding to the point cloud data, and load and display the point cloud.
[0012] S6. If the target point cloud data receives an unloading signal, the target point cloud data is unloaded. Unloading the target point cloud data means: retaining the file path and coordinates of the smallest bounding cube in the binary file corresponding to the target point cloud data, and clearing the coordinate array of all points, the reflection intensity array of all points, and the color RGB array of all points corresponding to the target point cloud data.
[0013] If the target point cloud data after unloading receives a loading signal, return to step S5.
[0014] Furthermore, the two cuboid bounding boxes are connected or intersecting, and the weight of the edge between the two cuboid bounding boxes is the planar distance between the center points of the two cuboid bounding boxes, specifically as follows:
[0015] Let the minimum coordinates of the i-th rectangular bounding box be (Xmin) i Ymin i Zmin i The maximum coordinate is (Xmax). i Ymax i Zmax i The rectangular bounding boxes of the i-th and j-th point clouds are connected or intersecting, and the weight of the edge between the two rectangular bounding boxes is the planar distance between the center points of the two rectangular bounding boxes. The calculation process of the weight value is as follows:
[0016]
[0017]
[0018]
[0019] Among them, Xmin i Let Xmax be the minimum x-coordinate of the bounding box of the i-th cuboid. i Ymin represents the maximum x-coordinate of the bounding box of the i-th cuboid. i Ymax is the minimum y-coordinate of the bounding box of the i-th cuboid. i Let X be the maximum y-coordinate of the bounding box of the i-th cuboid. i Let x be the x-axis coordinate of the center point of the i-th cuboid bounding box, and y be the x-axis coordinate of the center point of the cuboid bounding box. i Let X be the y-coordinate of the center point of the i-th cuboid bounding box. j Let x be the x-coordinate of the center point of the j-th cuboid bounding box, and y be the x-coordinate of the center point of the cuboid bounding box. j Let W be the y-coordinate of the center point of the j-th cuboid bounding box. ij This represents the weight of the edge between the i-th vertex and the j-th vertex.
[0020] Furthermore, when the search criteria information is the number of searches, the target point cloud data retrieved based on the undirected graph of point cloud relationships, the initial point cloud, and the search criteria information is as follows:
[0021] Add the initial point cloud to the first vertex set and perform the following steps:
[0022] S41. Add the adjacent points of each vertex in the first vertex set to the first vertex set. Record duplicate points only once. Increment the current search count by 1.
[0023] S42. Repeat S41 until the current search count reaches the search count for the retrieval criteria information, and obtain all related target point cloud data.
[0024] Furthermore, when the search criteria information is the search range, the target point cloud data is retrieved based on the undirected graph of point cloud relationships, the initial point cloud, and the search criteria information as follows:
[0025] Starting with the initial point cloud, perform the following steps:
[0026] S43. Vertices that have an undirected edge between the record and the starting point and whose path weight is less than or equal to the search range are integrated into a second vertex set, and the first unsearched vertex in the set is set as the starting point.
[0027] S44. Recursively execute S43, searching downwards along a path until the sum of the weights of the undirected edges traversed by the path is greater than the search range. Then backtrack to the previous step and set the next unsearched vertex in the vertex set recorded in the previous step as the starting point.
[0028] S45. Repeat S43 and S44 until the sum of the weights of the undirected edges of all paths is greater than the search range. Repeated vertices are recorded only once to obtain the target point cloud data associated with the initial point cloud.
[0029] Furthermore, the binary files have the same name but different suffixes.
[0030] Furthermore, loading and displaying the cuboid bounding boxes specifically involves displaying all cuboid bounding boxes in a three-dimensional window of the interface according to their actual geographical locations.
[0031] Furthermore, the point cloud data object is constructed in memory by reading the LAS file.
[0032] Furthermore, after unloading the target point cloud data, only the rectangular bounding box is displayed on the screen.
[0033] Furthermore, during the process of reading the member variables in the binary file corresponding to the point cloud data, the type and order of the member variables read are consistent with the type and order of the member variables output when generating the binary file.
[0034] Furthermore, the member variables of the point cloud data object also include custom member variables, which are used to store other information.
[0035] Compared with the prior art, the present invention has the following beneficial effects:
[0036] (1) Point cloud data is huge. Loading multiple point cloud data at once can easily lead to excessive computer memory usage and affect computer use. This invention loads the point cloud by a cuboid bounding box. The cuboid bounding box can be used to quickly load and unload the point cloud. A small amount of point cloud data in a region can be loaded first for the operation. After the operation in that region is completed, the required point cloud data can be loaded according to the cuboid bounding box, and the point cloud data of the completed region can be unloaded. This ensures that the computer memory usage remains stable and does not affect the smoothness of the operation.
[0037] (2) To address the issues of large point cloud data volume and slow reading speed, this invention constructs a point cloud data object by reading the point cloud LAS file and writes all member variables to the output file stream object in binary code format to generate a binary file, thereby improving the efficiency of point cloud data reading. Reading and writing binary files saves time on character conversion.
[0038] (3) Point cloud data files are mainly stored and managed through a file system, which is inconvenient for querying and intuitive viewing. This invention constructs an undirected graph of point cloud relationships according to spatial relationships, stores the association relationships between point cloud data, and enables rapid searching of point cloud data according to the number of searches and the search range. Attached Figure Description
[0039] Figure 1 This is a flowchart of the present invention;
[0040] Figure 2 This is a class definition diagram of the point cloud data object of the present invention;
[0041] Figure 3 This is an undirected graph of point cloud relationships in this invention;
[0042] Figure 4 This is a schematic diagram illustrating the query order and results of the search count in this invention;
[0043] Figure 5 This is a diagram showing the search results of the present invention.
[0044] Figure 6 This is a schematic diagram illustrating the search range, query order, and results of the present invention.
[0045] Figure 7 This is a diagram showing the search range results of the present invention. Detailed Implementation
[0046] The present invention will now be described in detail with reference to the accompanying drawings and specific embodiments. These embodiments are based on the technical solution of the present invention and provide detailed implementation methods and specific operating procedures. However, the scope of protection of the present invention is not limited to the following embodiments.
[0047] This embodiment provides a method for managing and rapidly loading massive point clouds. The flowchart of the method is as follows: Figure 1 As shown, the steps include:
[0048] S1. Write the member variables of the point cloud data object into the output file stream object as binary code, generating a binary file containing the member variables. The binary files have the same name but different suffixes. The member variables include the file path, the coordinates of the smallest bounding cube, the coordinate array of all points, the reflection intensity array of all points, and the RGB color array of all points.
[0049] Point cloud data objects are constructed in memory by reading LAS files. The member variables of a point cloud data object can also contain other user-defined member variables to store additional information. Examples of member variables for point cloud data objects include... Figure 2 The class definition diagram of the point cloud data object is shown below.
[0050] S2. Read the coordinates of the smallest bounding cuboid in each binary file to obtain the cuboid bounding box, load and display the cuboid bounding box, and display the cuboid bounding box in the 3D window of the interface according to the actual geographical location.
[0051] S3. Calculate the spatial relationships between each cuboid bounding box and other cuboid bounding boxes. Using the point cloud data corresponding to each cuboid bounding box as vertices and the spatial relationships between cuboid bounding boxes that meet certain conditions as undirected edges, construct an undirected graph of point cloud relationships. The conditions for spatial relationships are: two cuboid bounding boxes are connected or intersecting, and the weight of the edge between two cuboid bounding boxes is the planar distance between the center points of the two cuboid bounding boxes. The undirected graph of point cloud relationships is as follows: Figure 3 As shown.
[0052] Let the minimum coordinates of the i-th rectangular bounding box be (Xmin) i Ymin i Zmin i The maximum coordinate is (Xmax). i Ymax i Zmax i The rectangular bounding boxes of the i-th and j-th point clouds are connected or intersecting, and the weight of the edge between the two rectangular bounding boxes is the planar distance between the center points of the two rectangular bounding boxes. The weight value is calculated as follows:
[0053]
[0054]
[0055]
[0056] Among them, Xmin i Let Xmax be the minimum x-coordinate of the bounding box of the i-th cuboid. i Ymin represents the maximum x-coordinate of the bounding box of the i-th cuboid. i Ymax is the minimum y-coordinate of the bounding box of the i-th cuboid. i Let X be the maximum y-coordinate of the bounding box of the i-th cuboid. i Let x be the x-axis coordinate of the center point of the i-th cuboid bounding box, and y be the x-axis coordinate of the center point of the cuboid bounding box. i Let X be the y-coordinate of the center point of the i-th cuboid bounding box. j Let x be the x-coordinate of the center point of the j-th cuboid bounding box, and y be the x-coordinate of the center point of the cuboid bounding box. j Let W be the y-coordinate of the center point of the j-th cuboid bounding box. ij This represents the weight of the edge between the i-th vertex and the j-th vertex.
[0057] S4. Obtain the initial point cloud and search criteria information selected by the user in the displayed cuboid range box. Based on the undirected graph of point cloud relationships, the initial point cloud, and the search criteria information, retrieve the target point cloud data. The search criteria information is the number of searches or the search range.
[0058] When the search criteria information is the number of searches, the specific process for retrieving the target point cloud data based on the undirected graph of point cloud relationships, the initial point cloud, and the search criteria information is as follows:
[0059] Add the initial point cloud to the first vertex set and perform the following steps:
[0060] S41. Add the adjacent points of each vertex in the first vertex set to the first vertex set. Record duplicate points only once. Increment the current search count by 1.
[0061] S42. Repeat S41 until the current search count reaches the search count for the retrieval criteria information, and obtain all related target point cloud data.
[0062] by Figure 4 For example, point cloud number 7 is the initial point cloud, and the search count is 2. First, add point cloud number 7 to the first vertex set, P1 = {7}, and the current search count is 0. Add the adjacent vertices of vertex number 7 to the first set, P1 = {7, 3, 4, 8, 11}, and the current search count is 1. Add the adjacent vertices of vertex number 3 to the first set, P1 = {7, 3, 4, 8, 11, 2}, add the adjacent vertices of vertex number 4 to the first set, P1 = {7, 3, 4, 8, 11, 2, 5}, add the adjacent vertices of vertex number 8 to the first set, P1 = {7, 3, 4, 8, 11, 2, 5, 9}. Since the adjacent vertices of vertex number 11 are already in the set, they do not need to be added again, and the current search count is 2. The current search count has reached the user-defined search count of 2, so all associated target point cloud data are point clouds numbered 7, 3, 4, 8, 11, 2, 5, and 9. The search count result is shown in the following figure. Figure 5 As shown.
[0063] When the search criteria information is the search scope, the target point cloud data is retrieved based on the undirected graph of point cloud relationships, the initial point cloud, and the search criteria information as follows:
[0064] Starting with the initial point cloud, perform the following steps:
[0065] S43. Vertices that have an undirected edge between the record and the starting point and whose path weight is less than or equal to the search range are integrated into a second vertex set, and the first unsearched vertex in the set is set as the starting point.
[0066] S44. Recursively execute S43, searching downwards along a path until the sum of the weights of the undirected edges traversed by the path is greater than the search range. Then backtrack to the previous step and set the next unsearched vertex in the vertex set recorded in the previous step as the starting point.
[0067] S45. Repeat S43 and S44 until the sum of the weights of the undirected edges of all paths is greater than the search range. Repeated vertices are recorded only once to obtain the target point cloud data associated with the initial point cloud.
[0068] by Figure 6 For example, point cloud number 7 is the initial point cloud, and the search range is 200. First, vertex number 7 is set as the starting point. Vertices whose path weights among the adjacent vertices of vertex number 7 are less than or equal to 200 are added to set P2 = {3, 4, 8, 11}. The first vertex in this set, vertex number 3, is set as the starting point. Among the adjacent vertices of vertex number 3, vertices 4, 7, 8, and 11 have already been recorded. The path weight of vertex number 2, 7-3-2, has a sum of weights of 50 + 100 = 150 < 200, so vertex number 2 is added to set P3 = {2}. Among the adjacent vertices of vertex number 2, the path weight of vertex number 1, 7-3-2-1, has a sum of weights of 50 + 100 + 100 = 250 > 200. There are no paths with a sum of weights less than 200. For vertices with a path weight equal to 200, backtrack to set P2. Set the second vertex of P2, vertex 4, as the starting point. Among the adjacent vertices of vertex 4, only vertex 3 has a path weight less than or equal to 200, and it is already in set P2, so backtrack to set P2. Set the third vertex of P2, vertex 8, as the starting point. Among the adjacent vertices of vertex 8, there are no vertices with a path weight less than or equal to 200, so backtrack to set P2. Set the fourth vertex of P2, vertex 11, as the starting point. Among the adjacent vertices of vertex 11, there are no vertices with a path weight less than or equal to 200, so backtrack to set P2. The search of P2 is complete; backtrack to the starting point. The search ends here, and all associated target point cloud data are 7, 3, 2, 4, 8, and 11. The search range results are shown in the following diagram. Figure 7 As shown.
[0069] S5. Read the binary file corresponding to the target point cloud data, sequentially read the member variables in the binary file corresponding to the point cloud data, and load and display the point cloud. During the process of reading the member variables in the binary file corresponding to the point cloud data, the types and order of the member variables read are consistent with the types and order of the member variables output when generating the binary file.
[0070] S6. If the target point cloud data receives an unload signal, then unload the target point cloud data. Unloading the target point cloud data involves: retaining the file path and coordinates of the smallest bounding cube in the binary file corresponding to the target point cloud data, and clearing the coordinate arrays of all points, the reflection intensity arrays of all points, and the RGB color arrays of all points corresponding to the target point cloud data. Only the range box is displayed on the screen to indicate that there is point cloud data at this location, which can be quickly reloaded when needed by the user. If the unloaded target point cloud data receives a load signal, return to step S5.
[0071] The preferred embodiments of the present invention have been described in detail above. It should be understood that those skilled in the art can make numerous modifications and variations based on the concept of the present invention without creative effort. Therefore, all technical solutions that can be obtained by those skilled in the art based on the concept of the present invention through logical analysis, reasoning, or limited experimentation on the basis of existing technology should be within the scope of protection defined by the claims.
Claims
1. A method for massive point cloud management and fast loading, characterized in that, The method comprises the following steps: S1, write the member variables of the point cloud data object into an output file stream object in binary code, to generate a binary file containing the member variables, including the file path, the coordinates of the minimum bounding box, the coordinate array of all points, the reflectivity array of all points, and the color RGB array of all points; S2, read the coordinates of the minimum bounding box in each binary file to obtain a bounding box range, and load and display the bounding box range; S3, calculate the spatial relationship between each bounding box range and other bounding box ranges, respectively, to construct a point cloud relationship undirected graph, taking the point cloud data corresponding to the bounding box range as the vertex, and taking the spatial relationship between the bounding box ranges that meet the conditions as the undirected edge, the condition being that the two bounding box ranges are adjacent or intersected, and the weight value of the edge between the two bounding box ranges being the planar distance between the center points of the two bounding box ranges; S4, obtain the initial point cloud selected in the displayed bounding box range and the search condition information, and retrieve the target point cloud data based on the point cloud relationship undirected graph, the initial point cloud, and the search condition information, the search condition information being the search times or the search range; S5, read the binary file corresponding to the target point cloud data, and read the member variables in the binary file corresponding to the point cloud data in sequence, to load and display the point cloud; S6, if the target point cloud data receives an unloading signal, unload the target point cloud data, which comprises retaining the file path and the coordinates of the minimum bounding box in the binary file corresponding to the target point cloud data, and emptying the coordinate array of all points, the reflectivity array of all points, and the color RGB array of all points corresponding to the target point cloud data; If the unloaded target point cloud data receives a loading signal, return to step S5.
2. The method for massive point cloud management and fast loading according to claim 1, characterized in that, The two bounding box ranges are adjacent or intersected, and the weight value of the edge between the two bounding box ranges is the planar distance between the center points of the two bounding box ranges, specifically as follows: Let the minimum coordinates of the i-th cuboid range frame be (Xmin i , Ymin i , Zmin i ), and the maximum coordinates be (Xmax i , Ymax i , Zmax i ), the cuboid range frames of the i-th point cloud and the j-th point cloud are connected or intersected, and the weight value of the edge between the two cuboid range frames is the planar distance of the center points of the two cuboid range frames, and the calculation process of the weight value is: wherein Xmin i is the minimum x-axis coordinate of the i-th cuboid range frame, Xmax i is the maximum x-axis coordinate of the i-th cuboid range frame, Ymin i is the minimum y-axis coordinate of the i-th cuboid range frame, Ymax i is the maximum y-axis coordinate of the i-th cuboid range frame, X i is the x-axis coordinate of the center point of the i-th cuboid range frame, Y i is the y-axis coordinate of the center point of the i-th cuboid range frame, X j is the x-axis coordinate of the center point of the j-th cuboid range frame, Y j is the y-axis coordinate of the center point of the j-th cuboid range frame, W ij is the weight value of the edge between the i-th vertex and the j-th vertex.
3. The method for massive point cloud management and fast loading according to claim 1, characterized in that, When the search condition information is the search times, retrieving the target point cloud data based on the point cloud relationship undirected graph, the initial point cloud, and the search condition information specifically comprises the following steps: Add the initial point cloud to a first vertex set, and execute the following steps: S41, add the adjacent points of each vertex in the first vertex set to the first vertex set, and record the repeated points only once, and add 1 to the current search times; S42, repeatedly execute S41 until the current search times reaches the search times of the search condition information, to obtain all associated target point cloud data.
4. The method for massive point cloud management and fast loading according to claim 1, characterized in that, When the search condition information is the search range, retrieving the target point cloud data based on the point cloud relationship undirected graph, the initial point cloud, and the search condition information specifically comprises the following steps: Take the initial point cloud as the starting point, and execute the following steps: S43, record the vertices that have the undirected edge with the starting point and have a path weight less than or equal to the search range, and integrate them into a second vertex set, and take the first vertex that has not been searched as the starting point; S44, recursively performing S43, searching along a path all the way down until the sum of the weights of the undirected edges passed by the path is greater than the search range, backtracking to the previous step, setting the next unsearched vertex in the vertex set recorded in the previous step as the starting point; S45, repeatedly performing S43 and S44 until the sum of the weights of the undirected edges of all paths is greater than the search range, and repeatedly recording the vertex only once, obtaining the target point cloud data associated with the initial point cloud.
5. The method for massive point cloud management and fast loading according to claim 1, characterized in that, The binary files have the same name but different suffixes.
6. The method for massive point cloud management and fast loading according to claim 1, characterized in that, Loading and displaying the cuboid range frame specifically includes displaying all the cuboid range frames according to actual geographical positions in a three-dimensional window of an interface.
7. The method for massive point cloud management and fast loading according to claim 1, characterized in that, The point cloud data object is constructed in the memory by reading the las file.
8. The method for massive point cloud management and fast loading according to claim 1, characterized in that, After unloading the target point cloud data, only the cuboid range frame is displayed on the screen.
9. The method for massive point cloud management and fast loading according to claim 1, characterized in that, In the process of reading the member variables in the binary file corresponding to the point cloud data, the type and order of the read member variables are consistent with the type and order of the output member variables when the binary file is generated.
10. The method for massive point cloud management and fast loading according to claim 1, characterized in that, The member variables of the point cloud data object further include a custom member variable used for storing other information.
Citation Information
Patent Citations
Point cloud processing method and device, computer equipment and storage medium
CN115131449A
System and method for simultaneous consideration of edges and normals in image features by a vision system
US20210366153A1