A method, system, device and medium for calculating volume based on point cloud data inside a sinkhole
By using a volume calculation method based on point cloud data, the problem of large calculation errors in the three-dimensional structure of loess sinkholes was solved, enabling more accurate volume calculation and soil erosion assessment, and supporting geological disaster risk assessment.
Patent Information
- Application Number
- CN202410157548.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-02-04
- Publication Date
- 2026-02-06
- Estimated Expiration
- 2044-02-04
AI Technical Summary
In existing technologies, there is a lack of detailed three-dimensional structural investigation and volume calculation methods for loess sinkholes, resulting in large calculation errors and an inability to accurately assess soil erosion.
A volume calculation method based on point cloud data inside sinkholes is adopted. Point cloud data is acquired by a handheld laser scanner, a three-dimensional space is constructed, sliced and projected onto a two-dimensional plane, the GiftWrapping algorithm is executed to obtain the convex hull of the two-dimensional point cloud, and the volume is calculated by meshing.
This improved the accuracy and precision of sinkhole volume calculations, providing a scientific basis for subsequent geological hazard risk assessments and reducing calculation errors.
Smart Images

Figure CN117876465B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of geological disaster investigation and evaluation, and more particularly to a method, system, device and medium for obtaining internal point cloud and volume of loess sinkhole based on a handheld laser scanner. BACKGROUND
[0002] There are tens of thousands of loess sinkholes in the Loess Plateau, which often cause road collapse, damage to buildings, destruction of farmland, piping of dams, and damage to roadbeds. In some cases, these sinkholes can have a significant impact on slope stability, even triggering landslides and other geological disasters. Furthermore, loess sinkholes are an important manifestation of underground soil erosion. A sinkhole is actually a complex three-dimensional structure occupying underground space, and existing methods for obtaining three-dimensional sinkhole data are all from a two-dimensional perspective for sinkhole detection and identification. Therefore, obtaining three-dimensional sinkhole data and calculating soil erosion volume is a very important scientific problem, and is of great significance for in-depth understanding of the morphology, structure, scale, connectivity and development law of sinkholes.
[0003] Currently, there is no established method for the detailed investigation of the three-dimensional structure of loess sinkholes and the calculation of sinkhole volume, which is a key technical method for assessing the amount of soil erosion caused by loess sinkholes. Therefore, the amount of underground soil erosion caused by loess sinkholes on the Loess Plateau is a pending scientific problem.
[0004] Existing technology mainly estimates the volume of sinkholes using a digital elevation model (DEM), which is a commonly used method both domestically and internationally. However, this estimation method has some obvious shortcomings: DEM is a solid ground model that represents ground elevation in the form of an ordered numerical array, but it is not a true three-dimensional model, so it cannot accurately depict sinkholes with complex morphology and internal structure; the algorithm for estimating sinkhole volume using DEM is relatively simple, which is a rough method of multiplying the area of each grid by the depth and then adding up the total volume. Since this traditional sinkhole volume calculation method does not take into account the true and complex three-dimensional structure of sinkholes, it results in large errors in the calculated sinkhole volume. When the DEM resolution is large, the error in the calculated sinkhole volume is even larger. SUMMARY
[0005] To address the problems in the above-mentioned field, the present application proposes a volume calculation method, system, device and medium based on internal point cloud data of sinkholes, which can replace the traditional sinkhole volume calculation method that does not take into account the true and complex three-dimensional structure of sinkholes, resulting in large errors in the calculated sinkhole volume.
[0006] To solve the above technical problems, the application discloses a volume calculation method based on point cloud data inside a sinkhole, comprising the following steps:
[0007] By scanning the internal structure of the sinkhole, point cloud data is obtained.
[0008] According to the obtained point cloud data, a three-dimensional space of the sinkhole is constructed; the point cloud data is sliced in the three-dimensional space, the sliced point cloud data is projected onto a two-dimensional plane to obtain two-dimensional point cloud data on the xy plane; the GiftWrapping algorithm is executed on each two-dimensional point cloud data to obtain a two-dimensional point cloud hull.
[0009] The plane where the two-dimensional point cloud hull is located is meshed, and it is determined whether it is a complete mesh; if it is a complete mesh, the mesh is classified; each row of the mesh is traversed in parallel, the type of each mesh is determined, the volume of the mesh of different types is calculated and added according to the different types of the mesh, and the volume of all the meshes in the slice is obtained; the volumes of the meshes of all the slices are added to obtain the total volume of the sinkhole.
[0010] Preferably, the point cloud data is obtained by the following steps:
[0011] A handheld laser scanner with a scanning angle of 270°*360°, a scanning speed of 300,000 points / s, a relative accuracy of 1.5-3 cm, and a maximum scanning distance of 100 m is used to collect field data of the sinkhole.
[0012] The handheld laser scanner is used to perform 360° circumferential scanning on each sinkhole to obtain three-dimensional laser point cloud data of each sinkhole.
[0013] The obtained three-dimensional laser point cloud data of each sinkhole is spliced and preprocessed, one sinkhole is taken as a research object, and volume calculation is performed.
[0014] Preferably, the two-dimensional point cloud data on the xy plane is obtained by the following steps:
[0015] The point cloud data is sorted in the three-dimensional space coordinates XYZ axis to determine the maximum and minimum values in the three dimensions.
[0016] The maximum value is subtracted from the minimum value to obtain the space span in the three dimensions.
[0017] The maximum span is taken as the side length of a cube to construct a three-dimensional space of the sinkhole.
[0018] The entire three-dimensional space is evenly divided into 20 parts according to the direction of the Z axis, all point cloud data is traversed, and each point cloud data is distributed to the corresponding interval according to the Z coordinate value of the point cloud data.
[0019] Project the three-dimensional point cloud data onto the xy plane, delete the z value in the (x, y, z) coordinates of each point, and retain the remaining (x, y) to form two-dimensional point cloud coordinates of each point cloud data.
[0020] Preferably, the Gift Wrapping algorithm is performed on each two-dimensional point cloud data, including the following steps:
[0021] Step 1: input the two-dimensional point cloud data in the slice, select the point with the smallest y value in all point sets as the starting point P0;
[0022] Step 2: rotate the ray with P0 as the vertex counterclockwise, and the first point appearing on the ray as the next starting point P1, and P0 forms the first edge of the convex hull;
[0023] Step 3: rotate the ray with P1 as the vertex counterclockwise, and the first point appearing on the ray as the next starting point P2, and P1 forms the second edge of the convex hull, and judges whether P2 coincides with P0; if coincides, the Gift Wrapping algorithm ends; if not, continue to execute the following steps;
[0024] Step 4: execute Step 3 multiple times until P i is the new starting point, judges whether P i coincides with P0; if not, rotates the ray with P i as the vertex counterclockwise, and the first point appearing on the ray as the next starting point P i+1 , and the previous starting point P i forms the i+1th edge of the convex hull, and the value of i+1 is assigned to i; if coincides, the Gift Wrapping algorithm ends;
[0025] Step 5: execute Step 4 multiple times until P i+1 coincides with P0, and the Gift Wrapping algorithm ends.
[0026] Preferably, the grid is classified, including the following steps:
[0027] Divide the square in which the two-dimensional point cloud convex hull is located into 20x20, a total of 400 grids of the same size;
[0028] The divided grid is divided into three types: type 0, type 1 and type 2, wherein:
[0029] Type 0 is the middle part of the sinkhole can cover the grid completely, directly using the volume formula to calculate the volume; Type 1 is the grid where the sinkhole convex point is located, the sinkhole in this grid does not occupy the entire grid space, the volume of the grid judged as type 1 is calculated by Monte Carlo algorithm; Type 2 is the grid that does not contain the sinkhole part.
[0030] Preferably, the type of each grid is determined, comprising the following steps:
[0031] Each row of grid is traversed to determine the type of each grid, wherein:
[0032] The leftmost grid of each row is taken as the starting grid, and the first type 1 grid is found from left to right: the upper and lower boundary information of the grid is obtained, the convex point set is traversed, and it is judged whether there is a point falling in the grid. If there is, the grid is determined as type 1; if not, it is determined as type 2;
[0033] When the second type 1 grid is not found in the row, the grids after the first type 1 are type 2; if the second type 1 grid is found after the first type 1 is found, the grids between the two type 1 grids are determined as type 0; if the second type 1 is not found until the row is traversed, the grids after the first type 1 are type 2;
[0034] When the second type 1 is found, the grids below are divided into type 1 or type 2 according to whether they contain convex points, and the grid type on the entire plane is determined by traversing the XY two dimensions.
[0035] Preferably, the calculation process of the total volume of the sinkhole comprises the following steps:
[0036] All the convex points in the grid are sequentially labeled and sequentially connected, and the left line of the grid close to the first and last points forms a closed polygon S;
[0037] N points are randomly sampled in the grid, assuming that X points fall inside S, the grid length is L, and according to the probability that all points fall inside S is equal to the proportion of S in the grid area, the area of S is obtained:
[0038]
[0039] The areas of the sinkholes in all grids are added and multiplied by the grid length L to obtain the volume of the sinkhole in a slice;
[0040] The volumes of the sinkholes in all slices are added to obtain the volume of the whole sinkhole:
[0041]
[0042] wherein i represents the number of layers of the whole space of the sinkhole, j represents the grid corresponding to the i layer, S ij represents the area of the jth grid in the i th slice.
[0043] Preferably, it further comprises a volume calculation system based on the point cloud data inside the sinkhole, comprising:
[0044] The data acquisition module is configured to acquire point cloud data by scanning the internal structure of the sinkhole.
[0045] The convex hull generation module is configured to construct a three-dimensional space of the sinkhole according to the acquired point cloud data, construct the three-dimensional space of the sinkhole by taking the maximum span as a reference, slice the point cloud data in the three-dimensional space, project the sliced point cloud data onto a two-dimensional plane to obtain two-dimensional point cloud data on the xy plane, and execute the GiftWrapping algorithm on each two-dimensional point cloud data to obtain a two-dimensional point cloud convex hull.
[0046] The volume calculation module is configured to grid the plane where the two-dimensional point cloud convex hull is located, determine whether it is a complete grid, classify the grid if it is a complete grid, traverse each row of the grid in parallel, determine the type of each grid, calculate the volume of the grid of the corresponding type according to different grid types, and add the volumes to obtain the volume of all grids in the slice, and add the volumes of the grids of all slices to obtain the total volume of the sinkhole.
[0047] Preferably, it further comprises a computer device comprising a memory and a processor, wherein the memory stores a computer program, and the computer program is executed by the processor to make the processor execute the following steps:
[0048] The data acquisition module is configured to acquire point cloud data by scanning the internal structure of the sinkhole.
[0049] The convex hull generation module is configured to construct a three-dimensional space of the sinkhole according to the acquired point cloud data, slice the point cloud data in the three-dimensional space, project the sliced point cloud data onto a two-dimensional plane to obtain two-dimensional point cloud data on the xy plane, and execute the GiftWrapping algorithm on each two-dimensional point cloud data to obtain a two-dimensional point cloud convex hull.
[0050] The volume calculation module is configured to grid the plane where the two-dimensional point cloud convex hull is located, determine whether it is a complete grid, classify the grid if it is a complete grid, traverse each row of the grid in parallel, determine the type of each grid, calculate the volume of the grid of the corresponding type according to different grid types, and add the volumes to obtain the volume of all grids in the slice, and add the volumes of the grids of all slices to obtain the total volume of the sinkhole.
[0051] Preferably, further comprising a computer readable storage medium, the computer readable storage medium stores a computer program, the computer program is executed by the processor, so that the processor executes the following steps:
[0052] By scanning the inside structure of the sinkhole, point cloud data is obtained;
[0053] According to the obtained point cloud data, a three-dimensional space of the sinkhole is constructed; the point cloud data is sliced in the three-dimensional space, the sliced point cloud data is projected onto a two-dimensional plane to obtain two-dimensional point cloud data on the xy plane; the GiftWrapping algorithm is executed on each two-dimensional point cloud data to obtain a two-dimensional point cloud convex hull;
[0054] The plane where the two-dimensional point cloud convex hull is located is meshed, whether it is a complete mesh is judged, if it is a complete mesh, the mesh is classified; each row of mesh is traversed in parallel, the type of each mesh is judged, the volume of the mesh of different types is calculated and added according to different mesh types to obtain the volume of all meshes in the slice; the volumes of the meshes of all slices are added to obtain the total volume of the sinkhole.
[0055] Compared with the prior art, the present application has the following beneficial effects:
[0056] The present application obtains accurate spatial information of the sinkhole in the form of three-dimensional point cloud data, not only improves the stereoscopic sense of the data, but also lays a solid foundation for subsequent volume calculation. The point cloud data obtained is processed by slicing and meshing, which can more accurately capture the morphology of the sinkhole, the GiftWrapping algorithm is used to obtain the convex hull of the two-dimensional point cloud, which effectively solves the bottleneck problem of traditional methods in processing convex hull and mesh volume calculation, and through the point cloud data, the three-dimensional structure of the sinkhole can be fully obtained, which greatly improves the accuracy of the volume calculation result of the sinkhole. Through the slicing and meshing processing of the point cloud data of the sinkhole, it is possible to accurately calculate the sinkhole with complex three-dimensional structure, improve the calculation accuracy, and provide accurate data basis for subsequent volume calculation. BRIEF DESCRIPTION OF DRAWINGS
[0057] Figure 1 The flow chart of the volume calculation method based on the internal point cloud data of the sinkhole of the present application;
[0058] Figure 2 The original point cloud data of the sinkhole obtained by the present application;
[0059] Figure 3 The two-dimensional point cloud data obtained by slicing of the present application is shown in the schematic diagram;
[0060] Figure 4 The specific step flow chart of the GiftWrapping algorithm provided by the embodiment of the present application;
[0061] Figure 5 Incomplete grid sketch obtained for the present invention;
[0062] Figure 6 Incomplete grid sketch obtained for the present invention;
[0063] Figure 7 Actual scene sketch of a cave-in by hand-held laser radar. DETAILED DESCRIPTION
[0064] The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application. Figures 1-7 The terms described in the present application are only for describing the specific embodiments, and are not intended to limit the present application.
[0065] As Figure 1 shown, the embodiment of the present application provides a volume calculation method based on point cloud data inside a cave-in, comprising the following steps:
[0066] S1: Obtain point cloud data by scanning the internal structure of the cave-in;
[0067] S2: Construct a three-dimensional space of the cave-in according to the obtained point cloud data; take the largest span as a reference to construct a three-dimensional space of the cave-in; slice the point cloud data in the three-dimensional space, project the sliced point cloud data onto a two-dimensional plane to obtain two-dimensional point cloud data on the xy plane; execute the GiftWrapping algorithm on each two-dimensional point cloud data to obtain a two-dimensional point cloud convex hull;
[0068] S3: Grid the plane where the two-dimensional point cloud convex hull is located, determine whether it is a complete grid, if it is a complete grid, classify the grid; traverse each row of grid in parallel, determine the type of each grid, calculate the volume of the grid of different types and add them up to obtain the volume of all grids in the slice;
[0069] S4: Add the volumes of all the grids of all the slices to obtain the total volume of the cave-in.
[0070] In step S1, a hand-held laser scanner with a scanning angle of 270°x360°, a scanning speed of 300,000 points / s, a relative accuracy of 1.5-3 cm, and a maximum scanning distance of 100 m is used to collect field data of the cave-in;
[0071] The hand-held laser scanner is used to perform 360° circumferential scanning on each cave-in to obtain three-dimensional laser point cloud data of each cave-in;
[0072] The data splicing and preprocessing of the obtained three-dimensional laser point cloud data of each sinkhole are completed using GeoSLAM Connect and CloudCompare v2.12.4 software, one sinkhole is taken as the research object, and volume calculation is performed.
[0073] In step S2, the point cloud data is sorted in the three-dimensional space coordinates XYZ axis, and the maximum and minimum values in the three dimensions are determined;
[0074] The maximum value is subtracted from the minimum value, and the space span in the three dimensions is obtained;
[0075] The maximum span is taken as the side length of the cube, and the three-dimensional space of the sinkhole is constructed;
[0076] The whole three-dimensional space is evenly divided into 20 parts according to the direction of the Z axis, all point cloud data is traversed, and each point cloud data is allocated to the corresponding interval according to the Z coordinate value of the point cloud data;
[0077] The three-dimensional point cloud data is projected onto the xy plane, the z value in the (x, y, z) coordinates of each point is deleted, and the remaining (x, y) is retained to form the two-dimensional point cloud coordinates of each point cloud data;
[0078] The GiftWrapping algorithm is executed on the two-dimensional point cloud coordinates of each point cloud data to obtain the convex hull of the two-dimensional point cloud.
[0079] Specifically, the GiftWrapping algorithm is executed on the two-dimensional point cloud coordinates of each point cloud data, including the following steps:
[0080] Step 1: input the two-dimensional point cloud data in the slice, select the point with the minimum y value in the point set as the starting point P0;
[0081] Step 2: rotate the ray with P0 as the vertex counterclockwise, the first point appearing on the ray as the next starting point P1, and P0 forms the first edge of the convex hull;
[0082] Step 3: rotate the ray with P1 as the vertex counterclockwise, the first point appearing on the ray as the next starting point P2, and P1 forms the second edge of the convex hull, and it is judged whether P2 coincides with P0; if coincides, the GiftWrapping algorithm ends; if not coincides, continue to execute the following steps;
[0083] Step 4: execute Step 3 multiple times until P i is taken as the new starting point, it is judged whether P i coincides with P0; if not coincides, the ray with P i as the vertex is rotated counterclockwise, the first point appearing on the ray as the next starting point Pi+1 and the last starting point P i the (i+1)th edge of the convex hull, i+1 is assigned to i; if coincident, the Gift Wrapping algorithm ends;
[0084] Step 5: Step 4 is executed multiple times until P i+1 and P0 coincide, the Gift Wrapping algorithm ends.
[0085] In step S3, the square in which the convex hull of the two-dimensional point cloud is located is divided into 20x20, a total of 400 grids of the same size;
[0086] The divided grid is divided into three types: type 0, type 1 and type 2, wherein:
[0087] Type 0 is the middle part of the sinkhole that can completely cover the grid, and the volume is directly calculated using the cylinder volume formula; type 1 is the grid where the convex hull point of the sinkhole is located, and the sinkhole in this grid does not occupy the entire grid space, and the volume of the grid determined as type 1 is calculated by the Monte Carlo algorithm; type 2 is a grid that does not contain a sinkhole part.
[0088] Each row of grids is traversed to determine the type of each grid, wherein:
[0089] The leftmost grid in each row is taken as the starting grid, and the first type 1 grid is found from left to right: the upper and lower boundary information of the grid is obtained, the convex hull point set is traversed, and it is determined whether there is a point in the grid. If so, the grid is determined to be type 1; if not, it is determined to be type 2;
[0090] When the row is traversed and no second type 1 grid is found, the grids after the first type 1 are type 2; if the first type 1 grid is found and continues to be traversed to the right, if a second type 1 grid is found, the grids between the two type 1 grids are determined to be type 0; if no second type 1 is found until the row is traversed, the grids after the first type 1 are type 2;
[0091] When the second type 1 is found, the grids below are divided into type 1 or type 2 according to whether they contain convex hull points, and the grid type on the entire plane is determined through XY two-dimensional traversal.
[0092] The total volume of the sinkhole is calculated, including the following steps:
[0093] All convex hull points in the grid are sequentially labeled and sequentially connected, and the left edge of the grid close to the first and last points forms a closed polygon S;
[0094] Randomly sample N points in the grid, assume that finally X points fall inside S, the grid side length is L, according to the probability that all points fall inside S is equal to the proportion of S in the grid area, the area of S is obtained as follows:
[0095]
[0096] Add the area of the sinkhole in all grids and multiply by the grid side length L to obtain the volume of the sinkhole in a slice;
[0097] Add the volume of the sinkhole in all slices to obtain the volume of the whole sinkhole:
[0098]
[0099] Wherein, i represents the number of layers of the whole space of the sinkhole, j represents the grid corresponding to the i layer, S ij represents the area of the jth grid in the i layer slice.
[0100] The application also provides a volume calculation system based on internal point cloud data of a sinkhole, comprising:
[0101] A data acquisition module is configured to acquire point cloud data by scanning the internal structure of the sinkhole.
[0102] A convex hull generation module is configured to construct a three-dimensional space of the sinkhole according to the acquired point cloud data, to construct the three-dimensional space of the sinkhole by taking the largest span as a reference, to slice the point cloud data in the three-dimensional space, to project the sliced point cloud data onto a two-dimensional plane to obtain two-dimensional point cloud data on the xy plane, and to execute a GiftWrapping algorithm on each two-dimensional point cloud data to obtain a two-dimensional point cloud convex hull.
[0103] A volume calculation module is configured to grid the plane where the two-dimensional point cloud convex hull is located, to determine whether it is a complete grid, to classify the grid if it is a complete grid, to parallelly traverse the grid of each row, to calculate the volume of the grid of each type according to different grid types by judging the type of each grid, to add the volume of the grid of each type to obtain the volume of all grids in the slice, and to add the volume of the grid of all slices to obtain the total volume of the sinkhole.
[0104] The volume calculation method and system based on internal point cloud data of a sinkhole provided by the application can accurately determine the soil erosion amount of the sinkhole, so as to facilitate the scientific formulation of geological disaster risk assessment and corresponding prevention measures.
[0105] Embodiment
[0106] As Figure 4 shown, the embodiment of the application provides a volume calculation method based on internal point cloud data of a sinkhole, comprising the following steps:
[0107] Step (1): use a handheld laser scanner to scan the internal structure of the sinkhole to obtain point cloud data and pre-process;
[0108] Step (2): slice the point cloud data in three-dimensional space;
[0109] Step (3): project the point cloud of each slice to a two-dimensional plane to obtain two-dimensional point cloud data of xy;
[0110] Step (4): execute the GiftWrapping algorithm on each two-dimensional point cloud to obtain a closed convex hull of the point cloud;
[0111] Step (5): divide the plane into a 20x20 grid and traverse each row of the grid in parallel;
[0112] Step (6): determine the grid type as 0, 1 or 2;
[0113] Step (7): calculate the volume of the incomplete grid determined by the convex hull points;
[0114] Step (8): calculate the total volume of the sinkhole.
[0115] Specifically, in step (1), the laser scanner used in the application is a mobile handheld scanner of ZEB-HORIZON type developed by GeoSLAM company based on Simultaneous Localization and Mapping (SLAM) algorithm, the scanning angle of the device is 270°x360°, the scanning speed is 300,000 points / s, the relative accuracy is 1.5-3cm, and the maximum scanning distance is 100m.
[0116] Use a handheld laser scanner to perform 360° around scanning on each sinkhole to obtain three-dimensional laser point cloud of each sinkhole, as shown in Figure 7 .
[0117] In order to ensure the scanning accuracy and data splicing accuracy of the whole area, 61 scanning operations were carried out in the study area, and control point measurement was carried out using RTK (X / Y error ±5cm, Z error ±10cm), 20GB of original point cloud data of the study area was obtained, and data splicing and pre-processing work was completed in GeoSLAM Connect and CloudCompare v2.12.4 software, and one sinkhole was taken as a research object for volume calculation.
[0118] The application adopts advanced laser radar technology to obtain accurate spatial information of the sinkhole in the form of three-dimensional point cloud data, which not only improves the stereoscopic feeling of the data, but also lays a solid foundation for subsequent volume calculation.
[0119] In step (2), first sort the point cloud data on the XYZ axis, determine the maximum and minimum values in the three dimensions, subtract the minimum value from the maximum value to get the spatial span in the three dimensions, and take the maximum span as the side length of the cube to construct the three-dimensional space of the sinkhole. The entire three-dimensional space is evenly divided into 20 parts according to the direction of the Z axis, and the point cloud data is traversed. According to the Z coordinate value of each point, it is allocated to the corresponding interval, as shown in Figure 3 .
[0120] In step (3), in order to facilitate the subsequent GiftWrapping algorithm, the three-dimensional point cloud data is projected onto the xy plane, that is, the Z value in the (x, y, z) coordinates of each point is deleted, and the remaining (x, y) is retained to form a two-dimensional point cloud coordinate.
[0121] In step (4), the GiftWrapping algorithm is used to obtain the convex hull of the two-dimensional point cloud.
[0122] Among them, the GiftWrapping algorithm, also known as the Jarvis March algorithm, is an algorithm for finding the convex hull of a point set. The convex hull can be regarded as the vertex set of the smallest convex polygon that can contain all the point clouds, and these vertices also belong to the point cloud data. The application adopts a two-dimensional GiftWrapping algorithm that is faster than the three-dimensional GiftWrapping algorithm. The basic idea is to select a starting point from the point set, and from the current point, select the next point that forms the smallest polar angle with the current point, and continue to loop until the starting point is returned.
[0123] The specific steps of the GiftWrapping algorithm used in the application are as follows, as shown in Figure 4 .
[0124] Step (4.1): Select the starting point point0: Select one from the two-dimensional point set as the starting point, usually select the point with the smallest y value in the point set to ensure that the starting point of the convex hull is at the bottom of the entire convex hull.
[0125] Step (4.2): Traverse the point set and compare the polar angle: select a point from the point set such that the angle between the line connecting the current point and the horizontal line is the smallest. If there are multiple points with the same minimum angle, take the point farthest from the starting point as the next point.
[0126] Step (4.3): Update the current point: take the point found in step (4.2) as the new current point.
[0127] Step (4.4): Repeat steps (4.2) and (4.3) until point0 becomes the current point again, the algorithm ends, and the convex hull is constructed.
[0128] Step (4.5): Store the points that form the convex hull in order.
[0129] In step (4), the convex hull of the two-dimensional point cloud was obtained, such as Figure 5 As shown, it is a closed envelope formed by edge points.
[0130] In step (5), the square containing the convex hull is divided into 20×20 grids, totaling 400 grids of the same size; these grids are classified into three types, among which:
[0131] Type 0 represents the middle part of the sinkhole that completely covers the grid, and the volume can be calculated directly using the cylinder volume formula; Type 1 represents the grid where the sinkhole convex hull point is located, and the sinkhole in these grids does not fill the entire grid space, so the volume needs to be calculated further; Type 2 represents the grid that does not contain the sinkhole part.
[0132] In step (6), each row of the grid is traversed, and the type of each grid is determined. The specific steps are as follows:
[0133] The leftmost grid in each row is used as the starting grid. From left to right, the first grid of type 1 is searched: First, the top, bottom, left and right boundary information of the grid is obtained. The convex hull point set is traversed to determine whether there is a point falling in the grid. If there is, the grid is determined to be type 1; otherwise, it is determined to be type 2.
[0134] If no second type 1 grid is found until the entire row is traversed, then all grids after the first type 1 grid are type 2. If the first type 1 grid is found, continue traversing to the right. If a second type 1 grid is found, then the grid between the two type 1 grids is classified as type 0. If no second type 1 grid is found until the entire row is traversed, then all grids after the first type 1 grid are type 2.
[0135] If a second type 1 is found, the mesh below is classified as either type 1 or type 2 based on whether it contains a convex hull point.
[0136] The specific steps for traversing each row of the grid are as follows: Figure 1 As shown, by traversing the X and Y dimensions, the mesh type on the entire plane can be determined, and the determination result is as follows. Figure 6 As shown, red grids represent type 0, green grids represent type 1, and white grids represent type 2.
[0137] This invention innovatively introduces the concept of calculus, and through slicing and meshing the point cloud data of sinkholes, it makes it possible to accurately calculate the complex three-dimensional structure of sinkholes. This not only improves the calculation accuracy, but also provides an accurate data foundation for subsequent volume calculations.
[0138] Step (7) uses Monte Carlo algorithm to calculate the volume of the grid judged as 1, and the specific steps are as follows:
[0139] As Figure 6 As shown in the enlarged small grid on the right side of the middle, all the convex points in the grid are sequentially labeled as 0-6 and sequentially connected, and the left edge line of the grid close to the 0th and 6th points forms a closed polygon S.
[0140] Randomly take points in the grid, and make a ray, judge the intersection point number of S, take points P1, P2, P3 and P4, wherein P1 and P2 are inside S, and the intersection point number of S is 1 and 3 respectively; P3 and P4 are outside S, and the intersection point number of S is 2 and 4 respectively. Through enumeration, we can easily draw the conclusion that the intersection point number of S inside the point is odd, and the intersection point number of S outside the point is even.
[0141] Randomly take N points in the grid, assume that finally X points fall inside S, the grid side length is L, according to the probability that all points fall inside S is equal to the proportion of S in the grid area, the area of S can be obtained as:
[0142]
[0143] The step of calculating the total volume in step (8) is as follows:
[0144] Add the area of the sinkhole in all grids in step (7) and multiply by the grid side length L to obtain the sinkhole volume in a slice;
[0145] Add the sinkhole volume in all slices to obtain the volume of the whole sinkhole:
[0146]
[0147] In the whole calculation process, the Gift Wrapping and Monte Carlo algorithm are innovatively used to obtain the convex hull of the two-dimensional point cloud, and the Monte Carlo algorithm is introduced to calculate the volume of the grid judged as 1. The organic combination of the two algorithms effectively solves the bottleneck problem of the traditional method in processing the convex hull and the grid volume calculation, and improves the accuracy of the calculation.
[0148] The method uses a new type of laser radar mapping technology (SLAM) to obtain point cloud data and preprocesses the point cloud data with related software, slices and grids the point cloud data, and calculates the volume through Gift Wrapping and Monte Carlo algorithm. Compared with the traditional method, the method has the following advantages:
[0149] 1. High measurement accuracy of laser radar: handheld laser scanner can obtain high-precision three-dimensional point cloud data of the sinkhole with centimeter level, which can more accurately capture the internal morphological characteristics of the sinkhole.
[0150] 2. The accuracy of the calculation of the volume of the sinkhole: The method discards the traditional two-dimensional DEM method for calculating the volume, and directly uses the three-dimensional laser point cloud data of the sinkhole, greatly improving the accuracy of the calculation result of the volume of the sinkhole.
[0151] 3. Fast data processing speed: The Monte Carlo algorithm is used to calculate the volume, combining numerical calculation and probability method, which can more efficiently calculate the volume of the sinkhole. This method can significantly improve the calculation speed and efficiency, especially when dealing with a large amount of point cloud data.
[0152] The above is only the preferred specific implementation of the present application, but the protection scope of the present application is not limited to this, any skilled person in the art can make equivalent replacement or change according to the technical scheme and the inventive concept of the present application within the technical range disclosed by the present application, which should be covered within the protection scope of the present application.
[0153] In addition, unless otherwise specified, all technical and scientific terms used in the present application have the same meaning as generally understood by those skilled in the art to which the present application belongs. All documents mentioned in the specification are incorporated by reference to disclose and describe the methods related to the documents. In the event of any conflict with any incorporated document, the content of the specification shall prevail.
Claims
1. A method for calculating volume based on point cloud data inside a sinkhole, characterized in that, The method comprises the following steps: Obtain point cloud data by scanning the internal structure of the sinkhole; Construct a three-dimensional space of the sinkhole according to the obtained point cloud data; The point cloud data is sliced in a three-dimensional space, the sliced point cloud data is projected onto a two-dimensional plane, and two-dimensional point cloud data on the plane is obtained xy the plane; Perform a GiftWrapping algorithm on each two-dimensional point cloud data to obtain a two-dimensional point cloud convex hull; Grid the plane where the two-dimensional point cloud convex hull is located, and judge whether it is a complete grid; if it is a complete grid, classify the grid; Parallelly traverse each row of the grid, judge the type of each grid, calculate the volume of the grid of different types and add them up to obtain the volume of all the grids in the slice; add the volume of the grids in all the slices to obtain the total volume of the sinkhole; The classification of the grid comprises the following steps: Divide the square where the two-dimensional point cloud convex hull is located into 20*20, i.e. 400 grids of the same size; Divide the grids into three types, i.e. type 0, type 1 and type 2, wherein: Type 0 is the middle part of the sinkhole which can completely cover the grid, and the volume is directly calculated by using the volume formula of a cylinder; type 1 is the grid where the convex hull point of the sinkhole is located, and the volume of the grid judged as type 1 is calculated by using the Monte Carlo algorithm; type 2 is the grid which does not contain the part of the sinkhole; The judgment of the type of each grid comprises the following steps: Traverse each row of the grid, and judge the type of each grid, wherein: The leftmost grid in each row is taken as a starting grid, and the first type 1 grid is found from left to right: obtain the upper and lower boundary information of the grid, traverse the convex hull point set, and judge whether there is a point falling in the grid; if there is, the grid is judged as type 1; if not, the grid is judged as type 2; When no second type 1 grid is found after the traversal of the row, the grids after the first type 1 grid are all type 2; if a second type 1 grid is found after the first type 1 grid is found, the grids between the two type 1 grids are judged as type 0; if no second type 1 grid is found after the traversal of the row, the grids after the first type 1 grid are all type 2; When the second type 1 is found, the grids below are divided into type 1 or type 2 according to whether they contain the convex hull point, and the type of the grid on the whole plane is judged through the traversal of the XY two dimensions; The calculation process of the total volume of the sinkhole comprises the following steps: All the convex points in the grid are labeled in order and connected in sequence, and the left edge line of the grid with the first and last points close to each other forms a closed polygon S ; Randomly sample points in a grid N Suppose that eventually X points fall inside S The grid has side length L According to the probability that all points fall inside S is equal to S the proportion of the grid area, we get S The area of is: The area of all the sinkholes in the grid is added and multiplied by the grid side length to obtain the sinkhole volume in a slice. L , Add the volumes of the sinkholes in all the slices to obtain the volume of the whole sinkhole: wherein, i represents the number of layers of the whole space of the sinkhole, j represents the grid of the layer corresponding i to the layer, S ij represents the area of the grid of the layer i corresponding to the layer, j corresponding to the layer.
2. The method of claim 1, wherein, The obtaining of the point cloud data comprises the following steps: Use a handheld laser scanner with a scanning angle of 270*360, a scanning speed of 300,000 points / s, a relative accuracy of 1.5-3 cm and a maximum scanning distance of 100 m to collect field data of the sinkhole; Use the handheld laser scanner to perform 360° circumferential scanning on each sinkhole to obtain three-dimensional laser point cloud data of each sinkhole; Complete data splicing and preprocessing of the obtained three-dimensional laser point cloud data of each sinkhole, take one sinkhole as a research object, and perform volume calculation.
3. The method of claim 2, wherein, The obtained xy Two-dimensional point cloud data on a plane, comprising the following steps: Sort the point cloud data on the three-dimensional space coordinate XYZ axis, determine the maximum and minimum values in the three dimensions; Subtract the minimum value from the maximum value to obtain the space span in the three dimensions; Take the maximum span as the edge length of the cube to construct the three-dimensional space of the sinkhole; Divide the entire three-dimensional space into 20 parts according to the direction of the Z axis, traverse all the point cloud data, and distribute each point cloud data to the corresponding interval according to the Z coordinate value of the point cloud data; Projecting 3D point cloud data onto The GiftWrapping algorithm is performed on each two-dimensional point cloud data, including the following steps: On the plane, delete each point ( x , y , z In coordinates z Value, retain the remaining ( x , y This forms the two-dimensional point cloud coordinates of each point cloud data.
4. The method of claim 3, wherein, It includes: Step 1: Input the 2D point cloud data from the slice, and select all point sets. y The point with the smallest value is taken as the starting point. P 0; Step 2: With P Draw a ray with vertex 0 and rotate it counterclockwise. The first point that appears on the ray becomes the starting point for the next ray. P 1, and P 0 forms the first edge of the convex hull; Step 3: With P Draw a ray from vertex 1 and rotate it counterclockwise. The first point that appears on the ray becomes the starting point for the next ray. P 2, and P 1. Form the second edge of the convex hull and determine... P 2. Is it the same as P 0 overlaps; if they overlap, the GiftWrapping algorithm ends; if they do not overlap, continue with the following steps. Step4: repeat Step3 until P i as a new starting point, determine P i whether and P 0 coincide; if not, cast a ray from P i , rotate counterclockwise, and the first point on the ray becomes the next starting point P i+1 , and the previous starting point P i form the first edge of the convex hull i+1 i +1 to i ; if they coincide, the Gift Wrapping algorithm ends; Step 5: Repeat Step 4 multiple times until P i+1 and P 0 coincidences, the GiftWrapping algorithm ends.
5. A system for calculating volume based on point cloud data inside a sinkhole, characterized in that, The data acquisition module is used to obtain the point cloud data by scanning the internal structure of the sinkhole; The convex hull generation module is used to construct the three-dimensional space of the sinkhole according to the obtained point cloud data; Take the maximum span as the reference to construct the three-dimensional space of the sinkhole; The GiftWrapping algorithm is performed on each two-dimensional point cloud data to obtain a two-dimensional point cloud convex hull; The point cloud data is sliced in a three-dimensional space, the sliced point cloud data is projected onto a two-dimensional plane, and two-dimensional point cloud data on the plane is obtained The volume calculation module is used to grid the plane where the two-dimensional point cloud convex hull is located, judge whether it is a complete grid, if it is a complete grid, classify the grid; traverse each row of grid in parallel, judge the type of each grid, calculate the volume of the grid of different types and add them up to obtain the volume of all grids in the slice; add the volume of all grid slices to obtain the total volume of the sinkhole; The classification of the grid includes the following steps: Divide the square where the two-dimensional point cloud convex hull is located into 20x20, a total of 400 grids of the same size; The divided grid is divided into three types: type 0, type 1 and type 2, wherein: Type 0 is the middle part of the sinkhole that can completely cover the grid, and the volume is calculated directly using the cylinder volume formula; type 1 is the grid where the sinkhole convex point is located, and the sinkhole in this grid does not occupy the entire grid space, the volume of the grid judged as type 1 is calculated by Monte Carlo algorithm; type 2 is the grid that does not contain the sinkhole part; The type of each grid is judged, including the following steps: Traverse each row of grid, judge the type of each grid, wherein: The leftmost grid of each row is taken as the starting grid, and the first type 1 grid is found from left to right: obtain the upper and lower boundary information of the grid, traverse the convex point set, and judge whether there is a point in the grid, if there is, the grid is judged as type 1; if not, it is judged as type 2; When the row is traversed and no second type 1 grid is found, the grids after the first type 1 are type 2; if the first type 1 is found and continues to be traversed to the right, if the second type 1 is found, the grid between the two type 1 is judged as type 0; if no second type 1 is found until the row is traversed, the grids after the first type 1 are type 2; When the second type 1 is found, the grids below are divided into type 1 or type 2 according to whether they contain convex points, and the type of the grid on the entire plane is determined through the traversal of XY two dimensions; The calculation process of the total volume of the sinkhole includes the following steps: All the convex points in the grid are labeled in order and connected in sequence, and the left edge line of the grid with the first and last points close to each other forms a closed polygon S ; Randomly sample points in the grid N Suppose that eventually there are X points that fall inside S The grid has side length L According to the probability that all points fall inside S is equal to S the proportion of the grid area, we get S The area of is: The area of all the sinkholes in the grid is added and multiplied by the grid side length to obtain the sinkhole volume in a slice. L , Adding up the volume of the sinkhole in all the slices to obtain the total volume of the sinkhole: wherein, i represents the number of layers of the whole space of the sinkhole, j represents the grid of the layer corresponding i to the layer, S ij represents the area of the grid of the layer corresponding i to the layer, j to the layer.
6. A computer device, comprising: The computer device comprises a memory and a processor, the memory stores a computer program, and the computer program is executed by the processor to enable the processor to perform the following steps: Obtain point cloud data by scanning the internal structure of the sinkhole; According to the acquired point cloud data, a three-dimensional space of the sinkhole is constructed; the point cloud data is sliced in the three-dimensional space, and the sliced point cloud data is projected onto a two-dimensional plane to obtain two-dimensional point cloud data on the plane xy the plane Perform a GiftWrapping algorithm on each two-dimensional point cloud data to obtain a two-dimensional point cloud convex hull; Grid the plane where the two-dimensional point cloud convex hull is located, and determine whether it is a complete grid. If it is a complete grid, classify the grid; Parallelly traverse each row of the grid, determine the type of each grid, calculate the volume of the grid of different types, and add up the volume of all the grids in the slice to obtain the volume of the sinkhole; The classification of the grid comprises the following steps: Divide the square where the two-dimensional point cloud convex hull is located into 20x20, i.e. 400 grids of the same size; Divide the classified grid into three types: type 0, type 1 and type 2, wherein: Type 0 is the middle part of the sinkhole which can completely cover the grid, and the volume is directly calculated by using the volume formula of a cylinder; type 1 is the grid where the convex hull point of the sinkhole is located, and the volume of the grid determined as type 1 is calculated by using the Monte Carlo algorithm; type 2 is the grid which does not contain the sinkhole part; The determination of the type of each grid comprises the following steps: Traverse each row of the grid, and determine the type of each grid, wherein: The leftmost grid in each row is taken as a starting grid, and the first type 1 grid is found from left to right: obtain the upper and lower boundary information of the grid, traverse the convex hull point set, and determine whether there is a point falling in the grid. If there is, the grid is determined as type 1; if not, the grid is determined as type 2; When no second type 1 grid is found after the first type 1 grid is found, the grids after the first type 1 grid are determined as type 2; if a second type 1 grid is found after the first type 1 grid is found, the grid between the two type 1 grids is determined as type 0; if no second type 1 grid is found after the first type 1 grid is found, the grids after the first type 1 grid are determined as type 2; When the second type 1 is found, the grids below are divided into type 1 or type 2 according to whether they contain convex hull points, and the type of the grid on the whole plane is determined through the traversal of the XY two dimensions; The calculation process of the total volume of the sinkhole comprises the following steps: All the convex points in the grid are labeled in order and connected in sequence, and the left edge line of the grid with the first and last points close to each other forms a closed polygon S ; Randomly sample points in a grid N Assume that eventually X points fall inside S The grid has side length L The probability that all S points fall inside S is equal to the fraction of the grid area that is inside S The area of a circle with radius is The area of all the sinkholes in the grid is added and multiplied by the grid side length to obtain the sinkhole volume in a slice. L , Adding up the volume of the sinkhole in all the slices to obtain the total volume of the sinkhole: wherein, i represents the number of layers of the whole space of the sinkhole, j represents the grid corresponding i to the layer, S ij represents the area of the grid of the i layer slice, j th grid.
7. A computer-readable storage medium, characterized in that, The computer readable storage medium stores a computer program, and the computer program is executed by the processor to enable the processor to perform the following steps: Obtain point cloud data by scanning the internal structure of the sinkhole; According to the acquired point cloud data, a three-dimensional space of the sinkhole is constructed; the point cloud data is sliced in the three-dimensional space, and the sliced point cloud data is projected onto a two-dimensional plane to obtain two-dimensional point cloud data on the plane xy the plane Perform a GiftWrapping algorithm on each two-dimensional point cloud data to obtain a two-dimensional point cloud convex hull; Grid the plane where the two-dimensional point cloud convex hull is located, and determine whether it is a complete grid. If it is a complete grid, classify the grid; Parallelly traversing each row of the grid, judging the type of each grid, calculating the volume of the corresponding type of grid according to different grid types and adding them up to obtain the volume of all grids in the slice; adding the volume of the grids of all slices to obtain the total volume of the sinkhole; The step of classifying the grid comprises the following steps: Divide the square in which the two-dimensional point cloud convex hull is located into 20*20, i.e. 400 grids of the same size; The divided grid is divided into three types, i.e. type 0, type 1 and type 2, wherein: Type 0 is the middle part of the sinkhole which can completely cover the grid, and the volume is directly calculated by using the cylinder volume formula; type 1 is the grid in which the convex hull point of the sinkhole is located, and the sinkhole in the grid does not occupy the entire grid space, and the volume of the grid determined as type 1 is calculated by using the Monte Carlo algorithm; type 2 is the grid which does not contain the sinkhole part; The step of judging the type of each grid comprises the following steps: Traverse each row of the grid, and judge the type of each grid, wherein: The leftmost grid in each row is taken as a starting grid, and the first type 1 grid is found from left to right: the upper and lower boundary information of the grid is obtained, the convex hull point set is traversed, and it is judged whether there is a point falling in the grid, if there is, the grid is determined as type 1; if not, it is determined as type 2; When the row is traversed and no second type 1 grid is found, the grids after the first type 1 are type 2; if the first type 1 grid is found and continues to be traversed to the right, if a second type 1 grid is found, the grids between the two type 1 grids are determined as type 0; if no second type 1 is found until the row is traversed, the grids after the first type 1 are type 2; When the second type 1 is found, the grids below are divided into type 1 or type 2 according to whether they contain the convex hull point, and the type of the grid on the whole plane is determined through the traversal of the XY two dimensions; The calculation process of the total volume of the sinkhole comprises the following steps: All the convex points in the grid are labeled in order and connected in sequence, and the left edge line of the grid with the first and last points close to each other forms a closed polygon S ; Randomly sample points in the grid N Assume that eventually X points fall inside S The grid has side length L The probability that all S points fall inside S is equal to the fraction of the grid area that is S The area of a circle with radius is The area of all the sinkholes in the grid is added and multiplied by the grid side length to obtain the sinkhole volume in a slice. L , Add the volumes of the sinkholes in all slices to obtain the volume of the whole sinkhole: wherein, i represents the number of layers of the whole space of the sinkhole, j represents the grid of the layer corresponding i to the layer, S ij represents the area of the grid of the layer corresponding i to the layer, j to the layer.