Interactive density denoising and reconstruction repair method for large-scale laser point cloud

By setting a point density threshold and using an interactive density denoising method, combined with voxel filtering and greedy projection triangulation reconstruction, the problem of noisy and sparse points in large-scale laser point clouds is solved, generating a high-quality 3D model and achieving effective noise point removal and sparse point recovery.

CN120876281APending Publication Date: 2025-10-31JIANGSU AVIATION VOCATIONAL & TECH COLLEGE
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510870114.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-06-26
Publication Date
2025-10-31

AI Technical Summary

Technical Problem

In large-scale laser point cloud data, the density of noise points and sparse points is similar, resulting in low quality of 3D model reconstruction. Existing technologies are unable to effectively remove noise points and repair sparse points.

Method used

By setting a point density threshold, an interactive density denoising method is used to distinguish between noise points, sparse points, and dense points. Combined with voxel filtering, Splats local surface regular sampling, and greedy projection triangulation reconstruction, a regular point cloud is generated. Noise points are deleted and sparse points are restored in an interactive manner. Finally, hole detection and repair are performed based on overlapping local space.

Benefits of technology

It improves the reconstruction quality of 3D models, reduces holes, improves time efficiency and reduces memory requirements, and achieves effective noise point removal and sparse point restoration.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120876281A_ABST
    Figure CN120876281A_ABST
Patent Text Reader

Abstract

The invention discloses an interactive density denoising and reconstruction repair method for large-scale laser point clouds. The method comprises the following steps: S1, distinguishing noise points, sparse points and dense points for an original laser point cloud, deleting the noise points by using an interactive density denoising method, and storing deletion information; s2, generating a three-dimensional model by using greedy projection triangulation reconstruction; s3, deleting missing noise points or recovering mistakenly deleted sparse points by using an interactive density denoising method until the noise points are deleted and the mistakenly deleted sparse points are recovered; s4, dividing an overlapped local space, and performing hole detection and repair; and S5, searching a plurality of points closest to the original laser point cloud in the original laser point cloud, and taking an average value obtained by adding texture color values of the plurality of points as a color value of the vertex of the three-dimensional model. The method has the advantages that noise points, sparse points and dense points are distinguished by setting the point density threshold value, the colors and the shapes of the points are different, and the noise points are effectively deleted in an interaction mode.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of laser point cloud application technology, and in particular relates to an interactive density denoising and reconstruction repair method for large-scale laser point clouds. Background Technology

[0002] Laser point cloud data plays a crucial role in 3D modeling for fields such as cultural relic preservation and historical site surveying, urban architecture and planning, industrial manufacturing, geology, and mining. Handheld LiDAR scanners can acquire high-precision 3D point cloud data of the surrounding environment under conditions of no light or GPS absence. However, large-scale laser point cloud data suffers from problems such as uneven density and similar densities of noisy and sparse points, resulting in low-quality 3D model reconstruction. Summary of the Invention

[0003] The technical problem to be solved by this invention is to provide an interactive density denoising and reconstruction repair method for large-scale laser point clouds, where the density of noise points and sparse points is similar and noise points cannot be effectively removed, resulting in poor quality of 3D model reconstruction.

[0004] To address the aforementioned technical problems, the interactive density denoising and reconstruction method for large-scale laser point clouds of the present invention includes the following steps:

[0005] S1: Set a point density threshold for the original laser point cloud to distinguish between noise points, sparse points and dense points, which have different colors and shapes. Use an interactive density denoising method to delete noise points and save the deletion information for future modification.

[0006] S2: The point cloud after removing noise points is processed by voxel filtering and regular sampling of local surfaces of Splats to generate a regular point cloud. It is then reconstructed using greedy projection triangulation to generate a 3D model.

[0007] S3: By comparing the original laser point cloud, the deletion information, and the 3D model, if there are noise points that are missed or sparse points that are mistakenly deleted, the previously saved deletion information is loaded. Based on this, the interactive density denoising method is used to delete the missed noise points or restore the mistakenly deleted sparse points until the noise points are deleted and the mistakenly deleted sparse points are restored.

[0008] S4: Based on the three-dimensional model, divide several overlapping local spaces and perform hole detection and repair;

[0009] S5: Based on the three-dimensional model after hole repair, for each vertex, search for the nearest points in the original laser point cloud, and use the average of the sum of the texture color values ​​of the nearest points as the color value of the vertex of the three-dimensional model.

[0010] The interactive density denoising method in steps S1 and S3 is as follows: Define the density radius r of a point in the point cloud, where r is the radius of the bounding sphere corresponding to the N nearest points to that point, and is inversely proportional to the density of that point. Set the threshold for r as follows:

[0011] r m =r a ·k r

[0012] Where, r a The average of r for all points, k r The radius coefficient is r, where r is greater than r m The points are noise points and sparse points, where r is less than or equal to r m The points are dense points.

[0013] The interactive density denoising method in steps S1 and S3 is as follows: Define the density radius r of a point in the point cloud, where r is the radius of the bounding sphere corresponding to the N nearest points to that point, and is inversely proportional to the density of that point. Set the threshold for r as follows:

[0014] r m =r a ·k r

[0015] Where, r a The average of r for all points, k r The radius coefficient is r, where r is greater than r m The points are noise points and sparse points, where r is less than or equal to r m The points are dense points.

[0016] The specific steps of step S2 are as follows:

[0017] (1) After the laser point cloud is processed by the interactive density denoising algorithm, voxel filtering is performed to obtain the corresponding point cloud model. Based on the 30 nearest points in the point cloud, the PCA method of the PCL point cloud library is used to calculate the normal vector n of all points in the point cloud. i ;

[0018] (2) Calculate Splats based on the local geometric features of the points in the point cloud. The Splats are calculated based on the local geometric features of the points p. i Centered on the center, with normal vector n i , radius r i The specific steps for making the disk are as follows:

[0019] ① Calculate the distance p i The k nearest neighbors p j Arranged from closest to furthest;

[0020] ② For each point p jThe symbolic distance is calculated as follows:

[0021]

[0022] When the interval [h min ,h max When the radius of Splats is greater than 2ε, the radius stops growing, i.e., r i ≈║p j -p i ║, By setting an appropriate ε, the radius of the Splats can be adapted to the geometry of the local surface;

[0023] (3) Based on the Splats model, generate the corresponding rule point cloud. The specific steps are as follows:

[0024] A. Construct a KD-tree based on the Splats model, where each non-empty leaf node contains a number of Splats;

[0025] B. Calculate the regular point cloud in the local space based on the Splats in the leaf nodes;

[0026] (4) Based on the regular point cloud, normal vector estimation is performed using MLS, and the smoothed point cloud and normal vector are output. Greedy projection triangulation reconstruction is performed to generate a three-dimensional mesh model. Most of the holes are small in size and regular in shape, and can be effectively repaired.

[0027] The specific steps for calculating the regular point cloud in the local space are as follows:

[0028] ① Establish a local rectangular coordinate system for the leaf nodes, with the local spatial center of the leaf node as the origin, the unit normal vector of the sum of all Splats normal vectors in the leaf node as the Z-axis vector, and the Y and X-axis vectors determined by the right-hand rule.

[0029] ② On the Y and X planes of the local rectangular coordinate system, regularly distributed sampling points are given. If a straight line passing through the regular sampling points with the Z-axis as its direction intersects the Splats of the leaf nodes, resulting in several intersection points, the intersection point of the i-th Splat is s. i , where the center is p i The radius is r i If the intersection point lies within the corresponding Splat, then based on the cubic spline weight function, with ║p i -s i ║ / r i Calculate s as a variable. i The weights of the points are used to weight and fuse the intersections of the regular sampling points to calculate the coordinates of the points. If the point is inside the leaf node space, it is a regular point.

[0030] In step S3, the saved deletion information is used, combined with the original laser point cloud and the generated 3D model, to search for and delete missing noise points and restore misdeleted sparse points. The specific operation process is as follows:

[0031] (1) Load a large-scale laser point cloud; the background is white, the points are blue, and a deletion marker array bcloud is set. The sequence number of an element in the array corresponds to the sequence number of the point, and the element value indicates whether the point has been deleted; for the same original point cloud model, when the interactive density denoising program is executed for the first time, the deletion marker array bcloud is initially 0; for the second, third... Nth time, the saved array bcloud is loaded, and based on the previous deletions, the missing noise points are deleted and the misdeleted sparse points are restored;

[0032] Calculate the density radius r of the points and save it in the point density radius array rArr; points with r greater than the threshold r m correspond to noise points and sparse points, and load the corresponding black rendering blocks; points with r less than or equal to the threshold r m correspond to dense points, have no rendering blocks, and appear as blue points; against the background of the blue dense points, the black rendering blocks show the specific positions of the noise points and sparse points, facilitating mouse interaction to delete most of the noise points using Shift+left mouse button; establish a point cloud model containing the deleted points and a stack for storing deletion operations; when Shift+left mouse button is clicked, the operation variable is set to 1 initially to determine whether the current operation is to delete noise points or restore sparse points; register the mouse movement callback function, the Shift+left mouse button point selection callback function, and the keyboard event callback function;

[0033] (2) The main functions of the Shift+left mouse button point selection callback function are as follows: If the value of the operation variable is 1, that is, to delete noise points, traverse all points in the original laser point cloud, select the point Pt0 closest to the mouse position. The point Pt0 simultaneously satisfies the point density radius rArr[i]>r m and the deletion marker bcloud[i]=0; in the original point cloud, search for the n0 closest points with Pt0 as the center. If the closest point satisfies rArr[i]>r m and bcloud[i]=0, then the actual n^1 closest points (0 < n^1 ≤ n^0) are added to the point cloud of the deleted points, and bcloud[i] is set to 1 (0 ≤ i < n^1 ≤ n^0); the deleted points load the corresponding red rendering blocks, and the number of points in the point cloud model of the deleted points increases, and the corresponding red rendering blocks increase; the sequence numbers of the n^1 deleted points in the original laser point cloud and the number n^1 are pushed into the stack of deletion operations for later execution of the deletion withdrawal operation;

[0034] If the value of the operation variable is 0, that is, to restore the accidentally deleted sparse points, traverse all points in the original point cloud, select the point Pt0 closest to the mouse position, and the deletion flag bcloud[i] value of this point is 1; in the original point cloud, with Pt0 as the center, search for the n0 closest points to it. If the closest point satisfies that the bcloud[i] value is 1, then for the actual n1 closest points (0 < n1 ≤ n0), their bcloud[i] is set to 0 (0 ≤ i < n1 ≤ n0); clear the point cloud model of the deleted points, and add all points in the original point cloud with the deletion flag of 1 to the point cloud model of the deleted points; the number of points in the point cloud model of the deleted points decreases, and its corresponding red rendering blocks decrease; clear the stack storing the deletion operations.

[0035] (3) The main functions of the keyboard event callback function are as follows:

[0036] If the key is 'x', that is, to cancel the deletion operation, pop the number and serial number of the deleted points of the most recent deletion operation from the stack of deletion operations, remove the above-mentioned deleted points from the point cloud model of the deleted points, and set the deletion flag of the corresponding points to 0; the number of points in the point cloud model of the deleted points decreases, and its corresponding red rendering blocks decrease, that is, to restore the accidentally deleted noise points.

[0037] If the key is 'd', the operation variable is inverted, that is, from 1 to 0, or from 0 to 1; where 1 means to delete noise points, and 0 means to restore the accidentally deleted sparse point operation.

[0038] If the key is'm', set the number n0 of the closest points searched in the original point cloud with the mouse position as the center.

[0039] If the key is 'b', save the deletion flag array bcloud of the original laser point cloud to a file, so that later, based on this, the missed-deleted noise points can be deleted, or the accidentally deleted sparse points can be restored.

[0040] If the key is 'w', save the laser point cloud after deleting noise points to a file.

[0041] The specific steps of step S4 are as follows:

[0042] (1) Based on the vertices of the 3D model, divide the grid space. The detection and repair of holes are based on the local space of the adjacent 8 grids. The local spaces overlap with each other, and the overlapping part is 4 grids. The number of grids occupied by the adjacent local spaces 1, 2, 3, and 4 is 8 each. The overlapping parts of local space 1 with 2 in the Y direction, 3 in the X direction, and 4 in the Z direction are all 4 grids; the triangular patches of the 3D model are stored in the corresponding grids according to the positions of their three vertices.

[0043] (2) Detect and repair holes in the local spaces of the 8 grids; the specific steps for detecting and repairing holes in the current local space are as follows:

[0044] A. Each triangular facet corresponds to at most three grids, and the minimum serial number of the grids in its current local space is ID min ; for each of the current 8 grids, if and only if the ID of the triangular facet it contains min is equal to the grid serial number, it is added to the current local space;

[0045] B. Based on the initial vertex order, calculate the normal vector n of all triangular facets in the local space i , and the average n of the triangular facets n i and; if the direction of n a is inconsistent with that of n i , change the vertex order of the triangular facet; a

[0046] C. Based on all vertices in the local space, define a two-dimensional array nArr[0…n - 1, 0…n - 1], where n is the number of vertices and nArr[i, j] is initially 0; for the current vertex serial numbers i0, i1, i2 of the triangular facet, nArr[i0, i1] is incremented by 1, nArr[i1, i2] is incremented by 1, and nArr[i2, i0] is incremented by 1, and this operation is performed for all facets in the local space; if there are multiple facets with different serial numbers but the same three vertex serial numbers, the corresponding nArr[i, j] is incremented only once; after performing the operation, if nArr[i, j] = 0 and nArr[j, i] = 1 (i ≠ j), then the edge between vertices i and j is a half-edge;

[0047] D. After performing the operation, obtain all half-edges in the local space and perform hole detection and repair. The specific steps are as follows:

[0048] ① Set a half-edge mark array bArr[0…n - 1], whose element subscripts correspond to the half-edges, where n is the number of half-edges and bArr[i] is initially 1 (0 ≤ i < n); set a doubly linked list for storing the half-edges of the current hole, initially empty; let c be the number of times of cycling through bArr[0…n - 1], c = 10; the initial value of variable i0 is 0;

[0049] ② If 0 ≤ i0 < n and bArr[i0] = 0, then increment i0 and go to ②; otherwise, if i0 = n, then the holes in the current overlapping local space have been detected and repaired, return, otherwise, that is, bArr[i0] = 1, take the half-edge corresponding to bArr[i0] as the first half-edge of the current hole and use it as the first node of the doubly linked list, set bArr[i0] to 0, set variable j0 to i0, j k ​Set the value to i0 + n * c, and increment i0 by 1;

[0050] ③ Add 1 to j0, if j0 = j k If the set of half-sides corresponding to the current doubly linked list is not a hole or an island, set all the elements corresponding to the half-sides of the doubly linked list in bArr[0…n-1] to 1, and go to step ②; otherwise, assign the value of j0 modulo n to the variable j. If bArr[j] ≠ 0, then set the half-side L corresponding to bArr[j] to 1. j If the above steps are not taken, proceed to step ④ for execution; otherwise, proceed to step ③.

[0051] ④If L j If L is only connected to half of the head node of the doubly linked list, then j If L is the head node of the doubly linked list, set bArr[j] to 0, and proceed to step ③; j If L is only connected to half of the tail node of the doubly linked list, then j If L is the tail node, set bArr[j] to 0, then proceed to step ③; j If L can be connected to both the head and tail nodes simultaneously, then j Connected to the head and tail nodes, the doubly linked list currently storing half of the side is a hole or an island, bArr[j] is set to 0, go to step ⑤ to execute; L j If the head and tail vertices of L are swapped, then... j If the node is connected to the head or tail node of the doubly linked list, proceed to step ④; otherwise, proceed to step ③.

[0052] ⑤ If the current hole has already been detected and repaired in the adjacent overlapping local space, proceed to ②; otherwise, repair the hole; let n be the number of half-sides stored in the doubly linked list; the specific steps are as follows: if n L =3, then calculate the vertices of the holes or islands corresponding to the 3 half-sides. If the number of vertices greater than 180° is >3*0.6, the half-side corresponds to an island and is not processed for now; otherwise, add the corresponding triangular facets to the 3D model; if n L If n ≥ 4, then calculate n. L The half-side corresponds to the apex of a hole or an island. If the apex angle is greater than 180°, the number of such apex angles is greater than n. L *0.6, the half-side corresponds to an isolated island, which is not processed for the time being; otherwise, the half-side corresponds to a hole, and each time the two half-sides with the smallest vertices are selected for repair, that is, the half-sides form a new triangular facet, and the half-sides of the hole are updated until the hole is completely repaired.

[0053] Advantages of this invention:

[0054] (1) By setting a point density threshold, noise points, sparse points and dense points are distinguished. Their colors and shapes are different. Noise points are effectively deleted through interactive means.

[0055] (2) To address the problem that the 3D model directly generated by greedy projection triangulation has holes that are difficult to repair and large holes in sparse areas of point cloud, we propose to generate regular point cloud by deleting noise points, voxel filtering, and regular sampling of local Splats surfaces, and then reconstruct the 3D model using greedy projection triangulation. The holes in the 3D model are small and easy to repair.

[0056] (3) A hole detection and repair method based on overlapping local space is proposed, which can improve time efficiency and reduce memory requirements, facilitate parallel processing, and avoid the failure to repair holes at the edge of local space due to missed detection. Attached Figure Description

[0057] Figure 1 This is a general block diagram of the interactive density denoising and reconstruction repair method for large-scale laser point clouds of the present invention;

[0058] Figure 2 This is a schematic diagram of Splats radius growth in the interactive density denoising and reconstruction repair method for large-scale laser point clouds of the present invention.

[0059] Figure 3 This is a schematic diagram of the overlapping grid pattern in the interactive density denoising and reconstruction repair method for large-scale laser point clouds of the present invention.

[0060] Figure 4 This is a schematic diagram of the point cloud model of the south gate site of the Iron Walled City according to the present invention;

[0061] Figure 5 A schematic diagram of noise points and sparse points (black rendering blocks) in the point cloud of the archaeological site;

[0062] Figure 6 This is a schematic diagram of a local area of ​​the site, mainly composed of noise points (black rendered blocks).

[0063] Figure 7 This is a schematic diagram of a local area of ​​the site, mainly composed of sparse dots (black rendered blocks);

[0064] Figure 8 A diagram illustrating the change in the number of noise points (red rendering blocks) when performing Shift+left mouse button and delete undo operations;

[0065] Figure 9 A diagram illustrating the change in the number of noise points (red rendering blocks) when performing the Shift+left mouse button and variable inversion operations;

[0066] Figure 10 A diagram illustrating the effects of different values ​​of the search number n0 for the nearest point at the mouse position center;

[0067] Figure 11 This is a schematic diagram illustrating noise point selection based on an interactive density denoising method.

[0068] Figure 12 A comparative diagram of three-dimensional reconstruction models of voxel filtering + greedy projection triangulation, density denoising + voxel filtering + greedy projection triangulation, and interactive density denoising + voxel filtering + regular sampling + greedy projection triangulation.

[0069] Figure 13 This is a schematic diagram of hole detection based on overlapping local space.

[0070] Figure 14 This is a schematic diagram of hole repair based on overlapping local spaces;

[0071] Figure 15 The images show a before-and-after comparison of hole repair based on overlapping local spaces.

[0072] Figure 16 A schematic diagram of the 3D model after the vertices have been colored. Detailed Implementation

[0073] The interactive density denoising and reconstruction method for large-scale laser point clouds of the present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments.

[0074] Example:

[0075] In this embodiment of the invention, the interactive density denoising and reconstruction method for large-scale laser point clouds is based on point cloud registration using a novel feature point matching method, such as... Figure 1 As shown, it includes the following steps:

[0076] S1: Set a point density threshold for the original laser point cloud. To distinguish between noise points, sparse points, and dense points, which have different colors and shapes, use an interactive density denoising method to delete noise points and save the deletion information for future modification.

[0077] The interactive density denoising method is as follows: Define the density radius *r* of a point in the point cloud, where *r* is the radius of the bounding sphere corresponding to the N nearest points to that point, and is inversely proportional to the density of that point. Set the threshold for *r* as follows:

[0078] r m =r a ·k r

[0079] Where, r a The average of r for all points, k r The radius coefficient is r, where r is greater than r m The points are noise points and sparse points, where r is less than or equal to r m The points are dense points.

[0080] S2: The point cloud after removing noise points is processed through voxel filtering and regular sampling of local surfaces using Splats to generate a regular point cloud. Greedy projection triangulation is then used to reconstruct the 3D model. For example... Figure 2 As shown, the specific steps are as follows:

[0081] (1) After the laser point cloud is processed by the interactive density denoising algorithm, voxel filtering is performed to obtain the corresponding point cloud model. Based on the 30 nearest points in the point cloud, the PCA method of the PCL point cloud library is used to calculate the normal vector n of all points in the point cloud. i ;

[0082] (2) Calculate Splats based on the local geometric features of the points in the point cloud. The Splats are calculated based on the local geometric features of the points p. i Centered on the center, with normal vector n i , radius r i The specific steps for making the disk are as follows:

[0083] ① Calculate the distance p i The k nearest neighbors p j Arranged from closest to furthest;

[0084] ② For each point p j The symbolic distance is calculated as follows:

[0085]

[0086] When the interval [h min ,h max When the radius of Splats is greater than 2ε, the radius stops growing, i.e., r i ≈║p j -p i By setting an appropriate ε, the radius of the Splats can be adapted to the geometry of the local surface. That is, when the ε value is small, the radius of the Splats is small, which is more suitable for the sharp geometry of the local surface; when the ε value is large, the radius of the Splats is large, which is more suitable for the smooth geometry of the local surface; when the ε value is moderate, the radius of the Splats is moderate, which is suitable for both sharp and smooth geometry of the local surface.

[0087] (3) Based on the Splats model, generate the corresponding rule point cloud. The specific steps are as follows:

[0088] A. Construct a KD-tree based on the Splats model, where each non-empty leaf node contains a number of Splats;

[0089] B. Calculate the regular point cloud in the local space based on the Splats in the leaf nodes;

[0090] The specific steps for calculating the regular point cloud in the local space are as follows:

[0091] ① Establish a local rectangular coordinate system for the leaf nodes, with the local spatial center of the leaf node as the origin, the unit normal vector of the sum of all Splats normal vectors in the leaf node as the Z-axis vector, and the Y and X-axis vectors determined by the right-hand rule.

[0092] ② On the Y and X planes of the local rectangular coordinate system, regularly distributed sampling points are given. If a straight line passing through the regular sampling points with the Z-axis as its direction intersects the Splats of the leaf nodes, resulting in several intersection points, the intersection point of the i-th Splat is s. i , where the center is p i The radius is r i If the intersection point lies within the corresponding Splat, then based on the cubic spline weight function, with ║p i -s i ║ / r i Calculate s as a variable. i The weights of the points are used to weight and fuse the intersections corresponding to the regular sampling points to calculate the coordinates of the points. If the point is inside the leaf node space, it is a regular point.

[0093] (4) Based on the regular point cloud, normal vector estimation is performed using MLS, and the smoothed point cloud and normal vector are output. Greedy projection triangulation reconstruction is performed to generate a three-dimensional mesh model. Most of the holes are small in size and regular in shape, and can be effectively repaired.

[0094] S3: By comparing the original laser point cloud, the deletion information, and the 3D model, if there are noise points that are missed or sparse points that are mistakenly deleted, the previously saved deletion information is loaded. Based on this, the interactive density denoising method is used to delete the missed noise points or restore the mistakenly deleted sparse points until the noise points are deleted and the mistakenly deleted sparse points are restored.

[0095] Using the saved deletion information, combined with the original laser point cloud and the generated 3D model, missed noise points are searched for and deleted, and erroneously deleted sparse points are restored. The specific operation process is as follows:

[0096] (1) Load a large-scale laser point cloud; the background is white and the points are blue. Set up a deletion marker array bcloud, where the index of each element in the array corresponds to the index of the point, and the element value indicates whether the point has been deleted. For the same original point cloud model, execute the interactive density denoising program for the first time and delete the deletion marker array bcloud, which is initially set to 0. For the second, third...Nth times, load the saved array bcloud and delete the noise points that were missed in the previous deletion, as well as restore the sparse points that were mistakenly deleted.

[0097] Calculate the density radius r of the points and store it in the point density radius array rArr; if r is greater than the threshold rm The points corresponding to noise points and sparse points load the corresponding black rendering blocks; r is less than or equal to the threshold r m The points corresponding to dense points have no rendering blocks and appear as blue points; against the background of the blue dense points, the black rendering blocks show the specific positions of the noise points and sparse points, facilitating the use of Shift+left mouse button for mouse interaction to delete most of the noise points; establish a point cloud model containing the deleted points and a stack for storing deletion operations; when clicking Shift+left mouse button, set the operation variable to 1 initially to determine whether the current operation is to delete noise points or restore sparse points; register the mouse movement callback function, the Shift+left mouse button point selection callback function, and the keyboard event callback function;

[0098] (2) The main functions of the Shift+left mouse button point selection callback function are as follows: If the value of the operation variable is 1, that is, to delete noise points, traverse all points in the original laser point cloud, select the point Pt0 closest to the mouse position, and the point Pt0 simultaneously satisfies the point density radius rArr[i]>r m and the deletion flag bcloud[i]=0; in the original point cloud, search for the n0 points closest to Pt0 as the center. If the closest point satisfies rArr[i]>r m and bcloud[i]=0, then the actual n1 closest points (0 < n1 ≤ n0) are added to the point cloud of the deleted points, and bcloud[i] is set to 1 (0 ≤ i < n1 ≤ n0); the deleted points load the corresponding red rendering blocks, the number of points in the point cloud model of the deleted points increases, and the corresponding red rendering blocks increase; the serial numbers and the number n1 of the n1 deleted points in the original laser point cloud are pushed into the stack of deletion operations for facilitating the subsequent execution of the deletion withdrawal operation;

[0099] If the value of the operation variable is 0, that is, to restore the misdeleted sparse points, traverse all points in the original point cloud, select the point Pt0 closest to the mouse position, and the value of the deletion flag bcloud[i] of this point is 1; in the original point cloud, search for the n0 points closest to Pt0 as the center. If the closest point satisfies the value of bcloud[i] being 1, then the actual n1 closest points (0 < n1 ≤ n0), and their bcloud[i] are set to 0 (0 ≤ i < n1 ≤ n0); clear the point cloud model of the deleted points, and add all points with the deletion flag 1 in the original point cloud to the point cloud model of the deleted points; the number of points in the point cloud model of the deleted points decreases, and the corresponding red rendering blocks decrease; clear the stack for storing deletion operations;

[0100] (3) The main functions of the keyboard event callback function are as follows: If the key is 'x', that is, the deletion reversal operation, pop the number of deletion points and the sequence number of the most recent deletion operation from the stack of the deletion operation, remove the above deletion points from the point cloud model of the deletion points, and set the deletion mark of the corresponding points to 0; the number of points in the point cloud model of the deletion points is reduced, and the corresponding red rendering blocks are reduced, that is, the noise points that were accidentally deleted are restored.

[0101] If the key is 'd', the operation variable is inverted, that is, changed from 1 to 0, or from 0 to 1; where 1 means deleting noise points, and 0 means restoring sparse points that were accidentally deleted.

[0102] If the key is 'm', then the number of nearest points to search in the original point cloud, n0, is set with the mouse position as the center.

[0103] If the key is 'b', the deletion marker array bcloud of the original laser point cloud will be saved to a file so that the missed noise points can be deleted or the accidentally deleted sparse points can be restored based on this.

[0104] If the key is 'w', the laser point cloud after removing noise points will be saved to a file.

[0105] S4: Based on the aforementioned 3D model, divide it into several overlapping local spaces, such as... Figure 13-15 As shown, hole detection and repair are performed; the specific steps are as follows:

[0106] (1) Based on the vertices of the 3D model, the grid space is divided. The detection and repair of holes are based on the local space of 8 adjacent grids. The local spaces overlap with each other, with the overlapping part being 4 grids. The number of grids occupied by the adjacent local spaces 1, 2, 3, and 4 is 8 each. The overlapping part of local space 1 with 2 in the Y direction, 3 in the X direction, and 4 in the Z direction is 4 grids each. The triangular facets of the 3D model are stored in the corresponding grid according to the position of their three vertices.

[0107] (2) Detect and repair holes in the local space of the eight grids; the specific steps for detecting and repairing holes in the current local space are as follows:

[0108] A. Each triangular facet corresponds to at most three grid cells, and the smallest index of the grid cell in its current local space is ID. min For each of the current 8 grid cells, if and only if the ID of the triangle it contains is... min If the value is equal to the raster index, then add it to the current local space;

[0109] B. Based on the initial vertex order, calculate the normal vector n of all triangular faces in the local space. i and the triangular facet n i The average of na ; if n i is not in the same direction as n a , change the vertex order of this triangular patch;

[0110] C. Based on all vertices in the local space, define a two-dimensional array nArr[0…n - 1, 0…n - 1], where n is the number of vertices, and nArr[i, j] is initially 0; for the current vertex numbers i0, i1, i2 of the triangular patch, increment nArr[i0, i1] by 1, increment nArr[i1, i2] by 1, and increment nArr[i2, i0] by 1, and perform this operation for all patches in the local space; if there are multiple patches with different numbers but the same three vertex numbers, the corresponding nArr[i, j] is incremented only once; after performing the operation, if nArr[i, j] = 0 and nArr[j, i] = 1 (i ≠ j), then the edge between vertex i and j is a half-edge;

[0111] D. After performing the operation, obtain all half-edges in the local space and perform hole detection and repair. The specific steps are as follows:

[0112] ① Set a half-edge mark array bArr[0…n - 1], whose element subscripts correspond to the half-edges, n is the number of half-edges, and bArr[i] is initially 1 (0 ≤ i < n); set a doubly linked list for storing the half-edges of the current hole, initially empty; let c be the number of times to loop through bArr[0…n - 1], c = 10; the variable i0 is initially 0;

[0113] ② If 0 ≤ i0 < n and bArr[i0] = 0, then increment i0 and go to ②; otherwise, if i0 = n, then the holes in the current overlapping local space have been detected and repaired, return, otherwise, that is, bArr[i0] = 1, take the half-edge corresponding to bArr[i0] as the first half-edge of the current hole and use it as the first node of the doubly linked list, set bArr[i0] to 0, set the variable j0 to i0, and set j k to i0 + n * c, and increment i0 by 1;

[0114] ③ Increment j0 by 1. If j0 = j k , then the set of half-edges corresponding to the current doubly linked list is not a hole or an island. Set the elements corresponding to all half-edges of the doubly linked list in bArr[0…n - 1] to 1 and go to ② to execute; otherwise, assign the value of j0 modulo n to the variable j. If bArr[j] ≠ 0, then process the half-edge L j corresponding to bArr[j], go to ④ to execute, otherwise go to ③;

[0115] ④ If L j is only connected to the half-edge of the head node of the doubly linked list, then L jIf L is the head node of the doubly linked list, set bArr[j] to 0, and proceed to step ③; j If L is only connected to half of the tail node of the doubly linked list, then j If L is the tail node, set bArr[j] to 0, then proceed to step ③; j If L can be connected to both the head and tail nodes simultaneously, then j Connected to the head and tail nodes, the doubly linked list currently storing half of the side is a hole or an island, bArr[j] is set to 0, go to step ⑤ to execute; L j If the head and tail vertices of L are swapped, then... j If the node is connected to the head or tail node of the doubly linked list, proceed to step ④; otherwise, proceed to step ③.

[0116] ⑤ If the current hole has already been detected and repaired in the adjacent overlapping local space, proceed to ②; otherwise, repair the hole; let n be the number of half-sides stored in the doubly linked list; the specific steps are as follows: if n L =3, then calculate the vertices of the holes or islands corresponding to the 3 half-sides. If the number of vertices greater than 180° is >3*0.6, the half-side corresponds to an island and is not processed for now; otherwise, add the corresponding triangular facets to the 3D model; if n L If n ≥ 4, then calculate n. L The half-side corresponds to the apex of a hole or an island. If the apex angle is greater than 180°, the number of such apex angles is greater than n. L *0.6, the half-side corresponds to an isolated island, which is not processed for the time being; otherwise, the half-side corresponds to a hole, and each time the two half-sides with the smallest vertices are selected for repair, that is, the half-sides form a new triangular facet, and the half-sides of the hole are updated until the hole is completely repaired.

[0117] S5: Based on the three-dimensional model after hole repair, for each vertex, search for the 5 nearest points in the original laser point cloud, and use the average of the sum of the texture color values ​​of the aforementioned points as the color value of the vertex of the three-dimensional model.

[0118] experiment:

[0119] The experimental platform for this invention consisted of an Intel(R) Core(TM) i7-7700HQ CPU @ 2.80GHz, 8.00GB of memory, a 64-bit Windows 10 operating system, Visual Studio 2022, and the third-party point cloud library PCL 1.11.1. A handheld SLAM100 LiDAR scanner was used to scan the site of the south gate of the Iron Walled City, obtaining a large-scale, non-uniform, and noisy point cloud model. After cropping out excess parts, the original LiDAR point cloud contained 15,983,674 textured points, as shown below. Figure 4 As shown;

[0120] This invention removes noisy points from the aforementioned archaeological site point cloud model using an interactive density denoising method, based on a threshold r for calculating the density radius r. m Where the number of nearest neighbors N = 30, and the radius coefficient k r =2; Load the original laser point cloud, all points are blue; for r greater than r m For noise points and sparse points, load the corresponding black rendering blocks; such as Figure 5 As shown, there are black rendering blocks on noise points and sparse points, while dense points appear as blue dots. They can be easily distinguished by color and shape. There are a total of 581,443 noise points and sparse points, accounting for 3.64% of the original laser point cloud (15,983,674 points).

[0121] like Figure 6 As shown, in the area dominated by noise points, the noise points (black rendering blocks) are far from the surface where the dense points (blue points) are located, making them easy to identify and delete. Furthermore, only the noise points closest to the mouse position are searched, and the dense points are not processed, meaning that dense points will not be deleted accidentally. Figure 7 In the middle, the areas dominated by sparse points and the surfaces where sparse points (black rendering blocks) are located are close to the surfaces where dense points (blue points) are located, making them easy to identify and not requiring deletion;

[0122] like Figure 8 As shown, the number of search points n0 for the nearest point at the center of the mouse position is set to 100, and the operation variable value is 1, which means deleting noise points; (a) shows that 100 noise points were selected in the first Shift+left mouse button; (b) shows that 50 noise points were selected in the second Shift+left mouse button, for a total of 150; (c) shows that the 'x' key was pressed twice in a row, which means that the deletion undo operation of the keyboard event callback function was executed, and the noise points selected in the previous two times were canceled, that is, the current noise points are 0; (d) shows that 48 noise points were selected in the third Shift+left mouse button, that is, the current noise points are 48.

[0123] like Figure 9 As shown, the number of searches n0 for the nearest point at the center of the mouse position is set to 100, and it is assumed that... Figure 9 (c) The points to be restored are the sparse points that were accidentally deleted, in order to illustrate the operation process. Figure 9(a) With the operation variable value set to 1, noise points are deleted. The first time Shift + left mouse button selects 100 noise points. (b) The second time Shift + left mouse button selects 61 noise points, increasing the number of noise points to 161. (c) With the key set to 'd', the operation variable takes the opposite value, changing from 1 to 0, which means restoring the operation of accidentally deleted sparse points. The third time Shift + left mouse button restores 98 accidentally deleted sparse points, reducing the current number of noise points to 63. (d) With the key set to 'd', the operation variable takes the opposite value, changing from 0 to 1, which means deleting noise points. The fourth time Shift + left mouse button deletes 79 noise points, increasing the number of noise points to 142.

[0124] By pressing the 'm' key, a keyboard event callback function is executed. Setting the search count n0 for the nearest point centered on the mouse position can produce different effects; for example... Figure 10 As shown, when the operation variable value is 1, i.e., deleting noise points, and n0 is set to 500, 192 noise points are found, which are displayed as the red rendering blocks in the upper half; when n0 is set to 100, 100 noise points are found, which are displayed as the red rendering blocks in the lower half. The upper half has significantly more noise points than the lower half. Therefore, when there are many or obvious noise points, n0 can be set larger, and vice versa. When the operation variable value is 0, i.e., restoring accidentally deleted sparse points, different n0 values ​​result in different numbers of sparse points being restored, producing different restoration effects. Figure 10 similar.

[0125] like Figure 11 As shown, the original laser point cloud contains 15,983,674 points. Using the interactive density denoising method, 122,284 noise points were selected by Shift + left mouse button, accounting for 0.765% of the total. A large number of sparse points (black rendering blocks) were preserved. For a large range of noise points, the number of points n0 to search for the nearest point at the center of the mouse position can be set to 500, 1000, etc. For a small range of noise points, values ​​of 1, 5, 10, 100, etc. can be set. During the interaction, there is an undo operation, which is done by pressing 'x', which deletes and undoes the most recent accidental deletion operation, and the sparse points that were accidentally deleted can be selected by Shift + left mouse button for restoration.

[0126] After interactive density denoising, most noise points have been removed. The current deletion marker array `bcloud` can be saved to a file for later use in deleting any missed noise points or restoring any accidentally deleted sparse points. Figure 1The overall block diagram is shown. The original laser point cloud with noise points removed is used to generate a 3D model through steps such as Splats model generation, regular point cloud generation, and greedy projection triangulation. The original laser point cloud, the saved deletion information, and the 3D model are compared for judgment. If a small number of noise points are missed or a small number of sparse points are mistakenly deleted, the previously saved deletion information is loaded. Based on this, the missed noise points are deleted, or the mistakenly deleted sparse points are restored. The above steps are repeated until most of the noise points are deleted and a small number of sparse points are mistakenly deleted.

[0127] Figure 12 (a), (d), and (g) show the effect of generating a 3D model from the point cloud model of the site after voxel filtering and greedy projection triangulation. (a) shows that a large area of ​​holes appears in the sparse point cloud region in the upper right part of the model. Local (d) and (g) show that there are extra triangular facets and a large number of complex holes due to noise points. Figure 12 (b), (e) and (h) show the effect of generating a 3D model from the site's point cloud model after density denoising, voxel filtering and greedy projection triangulation. Due to the use of conventional density denoising, the upper right part of the site has large areas of holes due to the deletion of sparse point clouds. Local (e) and (h) show that due to the removal of noise points, there are no extra triangular facets, but no regular sampling is performed, resulting in a large number of complex holes. Figure 12 (c), (f), and (i) show the effect of generating a 3D model from the site point cloud model after interactive density denoising + voxel filtering + regular sampling + greedy projection triangulation according to the present invention. (c) shows that because the sparse point cloud in the upper right part of the site point cloud was not deleted while deleting points, and regular point clouds were generated by regular sampling of the local surface of Splats for 3D reconstruction, no large-area holes appeared. Locally (f) and (i) show that because noise points were deleted, no redundant triangular facets appeared. At the same time, as Figure 2 As shown, by setting an appropriate ε, the radius of the Splats is adapted to the geometric features of the local surface. The Splats overlap with each other, and the local surface of the Splats is sampled at equal intervals to generate regular point clouds for 3D reconstruction. Therefore, there are no large number of complex holes, only some small, regular, and easy-to-repair holes, which mainly come from the areas of large curvature changes of the local surface corresponding to the Splats.

[0128] The three methods—voxel filtering + greedy projection triangulation, density denoising + voxel filtering + greedy projection triangulation, and interactive density denoising + voxel filtering + regular sampling + greedy projection triangulation—all use a voxel filtering grid length of 3 times the point cloud resolution. After voxel filtering, the number of points in the cloud is similar, at 4,553,241, 4,585,165, and 4,668,052 respectively. The vertices of the 3D model generated by greedy projection triangulation are 4,523,086, 4,698,248, and 5,087,752, and the triangular facets are 8,346,825, 8,773,746, and 9,795,419 respectively.

[0129] Using the model distance calculation function of CloudCompare software, the distances between the reconstructed models of voxel filtering + greedy projection triangulation, density denoising + voxel filtering + greedy projection triangulation, and the interactive density denoising + voxel filtering + regular sampling + greedy projection triangulation of the present invention and the point cloud model of interactive density denoising are 5.37e-5, 1.45e-3, and 3.87e-5, respectively. Through the above distance quantification comparison, the objective quality of the 3D model generated by the method of the present invention is better than the other two methods.

[0130] like Figure 1 As shown, this invention generates a 3D model by greedily projecting and triangulating a regular point cloud. If there are no missed noise points or erroneously deleted sparse points, the hole detection and repair based on overlapping local space improves time efficiency and reduces memory requirements, which is beneficial for parallel computing. Figure 13-15 As shown, the 3D model is rasterized using 30 times the point cloud resolution of the vertices of the above 3D model as the grid side length. The number of grids in the X, Y, and Z directions are 121, 41, and 24, respectively. The vertices of the 3D model in adjacent grids are displayed in blue or green to distinguish them. Holes inside the grid and at the boundary can be effectively detected and repaired because an overlapping local space containing 8 grids is used. Figure 13 The above 3D model shows that 14,836 holes (black) were detected. Figure 14 Add 85,546 triangular facets (red) for hole repair; through Figure 15 The comparison before and after the repair shows that the vast majority of holes can be repaired.

[0131] This invention uses grid side lengths of 30, 40, and 45 times the point cloud resolution of the 3D model vertices as the basis for 3D model detection and repair. The computation times are 741s, 1,395s, and 10,143s, respectively. Increasing the grid side length from 30 times the point cloud resolution to 45 times the resolution (i.e., a 1.5-fold increase in grid side length, a 3.375-fold increase in volume, and a corresponding 13.69-fold increase in computation time) demonstrates that the hole repair method based on overlapping local space, using an appropriate grid side length (30 times the resolution), can significantly improve time efficiency while ensuring the hole repair effect. Figure 15 When the grid side length is 80 times the resolution (i.e., the number of grid cells in the X, Y, and Z directions are 46, 16, and 9 respectively), the computer's 8GB of memory overflows, preventing the program from running. However, using 30 times the resolution as the grid length, as mentioned above, already achieves good hole repair results. Figure 15 Therefore, with limited memory space, reducing the grid side length can effectively reduce the required memory without affecting the hole repair effect.

[0132] like Figure 16 As shown, based on the original laser point cloud, the vertices of the 3D model after hole repair are colored. That is, for each vertex, the 5 nearest points in the original laser point cloud are searched, and the average of the texture color values ​​of the above 5 points is the color of the vertex, generating a textured 3D mesh model.

[0133] Experimental results show that the number of point clouds at the south gate site of Tiewengcheng is approximately 16 million. The distances between the reconstructed models of voxel filtering + greedy projection triangulation and interactive density denoising + voxel filtering + regular sampling + greedy projection triangulation and the point cloud models after interactive density denoising are 5.37e-5 and 3.87e-5, respectively. This demonstrates that the method proposed in this invention has better quality in both subjective and objective aspects.

Claims

1. An interactive density denoising and reconstruction method for large-scale laser point clouds, characterized in that, Includes the following steps: S1: Set a point density threshold for the original laser point cloud to distinguish between noise points, sparse points and dense points, which have different colors and shapes. Use an interactive density denoising method to delete noise points and save the deletion information for future modification. S2: The point cloud after removing noise points is processed by voxel filtering and regular sampling of local surfaces of Splats to generate a regular point cloud. It is then reconstructed using greedy projection triangulation to generate a 3D model. S3: By comparing the original laser point cloud, the deletion information, and the 3D model, if there are noise points that are missed or sparse points that are mistakenly deleted, the previously saved deletion information is loaded. Based on this, the interactive density denoising method is used to delete the missed noise points or restore the mistakenly deleted sparse points until the noise points are deleted and the mistakenly deleted sparse points are restored. S4: Based on the three-dimensional model, divide several overlapping local spaces and perform hole detection and repair; S5: Based on the three-dimensional model after hole repair, for each vertex, search for the nearest points in the original laser point cloud, and use the average of the sum of the texture color values ​​of the above-mentioned points as the color value of the vertex of the three-dimensional model.

2. The interactive density denoising and reconstruction method for large-scale laser point clouds according to claim 1, characterized in that: The interactive density denoising method in steps S1 and S3 is as follows: Define the density radius r of a point in the point cloud, where r is the radius of the bounding sphere corresponding to the N nearest points to that point, and is inversely proportional to the density of that point. Set the threshold for r as follows: r m =r a ·k r Where, r a The average of r for all points, k r The radius coefficient is r, where r is greater than r m The points are noise points and sparse points, where r is less than or equal to r m The points are dense points.

3. The interactive density denoising and reconstruction method for large-scale laser point clouds according to claim 1, characterized in that, The specific steps of step S2 are as follows: (1) After the laser point cloud is processed by the interactive density denoising algorithm, voxel filtering is performed to obtain the corresponding point cloud model. Based on the nearest points in the point cloud, the PCA method of the PCL point cloud library is used to calculate the normal vector n of all points in the point cloud. i ; (2) Calculate Splats based on the local geometric features of the points in the point cloud. The Splats are calculated based on the local geometric features of the points p. i Centered on the center, with normal vector n i , radius r i The specific steps for making the disk are as follows: ① Calculate the distance p i The k nearest neighbors p j Arranged from closest to furthest; ② For each point p j The symbolic distance is calculated as follows: When the interval [h min ,h max When the radius of Splats is greater than 2ε, the radius stops growing, i.e., r i ≈║p j -p i ║, By adjusting the ε value, the radius of the Splats is adapted to the geometry of the local surface; (3) Based on the Splats model, generate the corresponding rule point cloud. The specific steps are as follows: A. Construct a KD-tree based on the Splats model, where each non-empty leaf node contains a number of Splats; B. Calculate the regular point cloud in the local space based on the Splats in the leaf nodes; (4) Based on the regular point cloud, normal vector estimation is performed using MLS, and the smoothed point cloud and normal vector are output. Greedy projection triangulation reconstruction is performed to generate a three-dimensional mesh model. Most of the holes are small in size and regular in shape, and can be effectively repaired.

4. The interactive density denoising and reconstruction method for large-scale laser point clouds according to claim 3, characterized in that: The specific steps for calculating the regular point cloud in the local space are as follows: ① Establish a local rectangular coordinate system for the leaf nodes, with the local spatial center of the leaf node as the origin, the unit normal vector of the sum of all Splats normal vectors in the leaf node as the Z-axis vector, and the Y and X-axis vectors determined by the right-hand rule. ② On the Y and X planes of the local rectangular coordinate system, regularly distributed sampling points are given. If a straight line passing through the regular sampling points with the Z-axis as its direction intersects the Splats of the leaf nodes, resulting in several intersection points, the intersection point of the i-th Splat is s. i , where the center is p i The radius is r i If the intersection point lies within the corresponding Splat, then based on the cubic spline weight function, with ║p i -s i ║ / r i Calculate s as a variable. i The weights of the points are used to weight and fuse the intersections of the regular sampling points to calculate the coordinates of the points. If the point is inside the leaf node space, it is a regular point.

5. The interactive density denoising and reconstruction method for large-scale laser point clouds according to claim 1, characterized in that: In step S3, the saved deletion information is used in conjunction with the original laser point cloud and the generated 3D model to search for and delete missed noise points and restore mistakenly deleted sparse points. The specific operation process is as follows: (1) Load a large-scale laser point cloud; the background is white and the points are blue. Set up a deletion marker array bcloud, where the index of each element in the array corresponds to the index of the point, and the element value indicates whether the point has been deleted. For the same original point cloud model, execute the interactive density denoising program for the first time and delete the deletion marker array bcloud, which is initially set to 0. For the second, third...Nth times, load the saved array bcloud and delete the noise points that were missed in the previous deletion, as well as restore the sparse points that were mistakenly deleted. Calculate the density radius r of the points and store it in the point density radius array rArr; if r is greater than the threshold r m Points correspond to noise points and sparse points, and the corresponding black rendering blocks are loaded; r is less than or equal to the threshold r m The points correspond to dense points, which have no rendering blocks and appear as blue points; against the background of blue dense points, black rendering blocks show the specific locations of noise points and sparse points, making it easy to use Shift+left mouse button to interact with the mouse and delete most of the noise points; a point cloud model containing the deleted points is built, as well as a stack to store the deletion operation; when Shift+left mouse button is clicked, the operation variable is initially set to 1 to determine whether the current operation is to delete noise points or restore sparse points; Register the mouse movement callback function, the Shift+left mouse button point selection callback function, and the keyboard event callback function; (2) The main functions of the Shift+left mouse button point selection callback function are as follows: If the operation variable value is 1, that is, to delete noise points, traverse all points in the original laser point cloud, select the point Pt0 closest to the mouse position, and the point Pt0 simultaneously satisfies the point density radius rArr[i]>r m and the deletion flag bcloud[i]=0; in the original point cloud, with Pt0 as the center, search for the n0 closest points to it. If the closest point satisfies rArr[i]>r m and bcloud[i]=0, then the actual n1 closest points (0 < n1 ≤ n0) are added to the point cloud of the deleted points, and bcloud[i] is set to 1 (0 ≤ i < n1 ≤ n0); the deleted points load the corresponding red rendering blocks, the number of points in the point cloud model of the deleted points increases, and the corresponding red rendering blocks increase; the serial numbers and the number n1 of the n1 deleted points in the original laser point cloud are pushed into the stack of the deletion operation for facilitating the subsequent execution of the deletion withdrawal operation; If the operation variable value is 0, that is, to restore the accidentally deleted sparse points, traverse all points in the original point cloud, select the point Pt0 closest to the mouse position, and the deletion flag bcloud[i] value of this point is 1; in the original point cloud, centered on Pt0, search for the n0 closest points to it. If the closest point satisfies that the bcloud[i] value is 1, then there are actually n1 closest points (0 < n1 ≤ n0), and their bcloud[i] is set to 0 (0 ≤ i < n1 ≤ n0); clear the point cloud model of the deleted points, and add all points with a deletion flag of 1 in the original point cloud to the point cloud model of the deleted points; The number of points in the point cloud model of the deleted points decreases, and its corresponding red rendering blocks decrease; the stack storing the deletion operations is cleared; (3) The main functions of the keyboard event callback function are as follows: If the key pressed is 'x', that is, to cancel the deletion operation, pop the number and sequence number of the deleted points of the most recent deletion operation from the stack of deletion operations, remove the above-mentioned deleted points from the point cloud model of the deleted points, and set the deletion flag of the corresponding points to 0; the number of points in the point cloud model of the deleted points decreases, and its corresponding red rendering blocks decrease, that is, to restore the accidentally deleted noise points; If the key pressed is 'd', then the operation variable is inverted, that is, from 1 to 0, or from 0 to 1; where 1 means deleting noise points and  0 means restoring accidentally deleted sparse points; If the key pressed is'm', then set the number n0 of the closest points searched in the original point cloud centered on the mouse position; If the key pressed is 'b', save the deletion flag array bcloud of the original laser point cloud to a file, so that later, based on this, the missed-deleted noise points can be deleted or the accidentally deleted sparse points can be restored; If the key pressed is 'w', then save the laser point cloud after deleting noise points to a file.

6. The interactive density denoising and reconstruction method for large-scale laser point clouds according to claim 1, characterized in that: The specific steps of step S4 are as follows: (1) Based on the vertices of the 3D model, divide the grid space. The detection and repair of holes are based on the local space of 8 adjacent grids. The local spaces overlap with each other, and the overlapping part is 4 grids. The number of grids occupied by adjacent local spaces 1, 2, 3, and 4 is 8 each. The overlapping parts of local space 1 with 2 in the Y direction, 3 in the X direction, and  4 in the Z direction are all 4 grids; the triangular patches of the 3D model are stored in the corresponding grids according to the positions of their three vertices; (2) Detect and repair holes in the local space of the 8 grids; the specific steps for detecting and repairing holes in the current local space are as follows: A. Each triangular facet corresponds to at most three grid cells, and the smallest index of the grid cell in its current local space is ID. min For each of the current 8 grid cells, if and only if the ID of the triangle it contains is... min If the value is equal to the raster index, then add it to the current local space; B. Based on the initial vertex order, calculate the normal vector n of all triangular faces in the local space. i and the triangular facet n i The average of n a If n i With n a If the directions are inconsistent, change the vertex order of the triangle. C. Based on all vertices in the local space, define a two-dimensional array nArr[0…n-1,0…n-1], where n is the number of vertices and nArr[i,j] is initially 0; for the current vertex indices of the triangular patch being i0, i1, i2, increment nArr[i0,i1] by 1, increment nArr[i1,i2] by 1, and increment nArr[i2,i0] by 1, and perform this operation for all patches in the local space; if there are multiple patches with different indices but the same three vertex indices, the corresponding nArr[i,j] is incremented only once; after performing the operation, if nArr[i,j] = 0 and nArr[j,i] = 1 (i≠j), then the edge between vertices i and j is a half-edge. D. After performing the operation, obtain all half-edges in the local space and perform hole detection and repair. The specific steps are as follows: ① Set a half-edge mark array bArr[0…n-1], whose element subscripts correspond to the half-edges, where n is the number of half-edges and bArr[i] is initially 1 (0≤i<n); set a doubly linked list for storing the half-edges of the current hole, initially empty; let c be the number of times to loop through bArr[0…n-1], c = 10; the initial value of variable i0 is 0. ② If 0≤i0<n and bArr[i0] = 0, then increment i0 by 1 and go to ②. Otherwise, if i0 = n, then the holes in the current overlapping local space have been detected and repaired, and the process returns; otherwise, i.e., bArr[i0] = 1, take the half-side corresponding to bArr[i0] as the first half-side of the current hole, and use it as the first node of the doubly linked list, set bArr[i0] to 0, and set the variable j0 to i0. k Set the value to i0 + n * c, and increment i0 by 1; ③ Add 1 to j0, if j0 = j k If the set of half-sides corresponding to the current doubly linked list is not a hole or an island, set all the elements corresponding to the half-sides of the doubly linked list in bArr[0…n-1] to 1, and go to step ②; otherwise, assign the value of j0 modulo n to the variable j. If bArr[j] ≠ 0, then set the half-side L corresponding to bArr[j] to 1. j If the above steps are not taken, proceed to step ④ for execution; otherwise, proceed to step ③. ④If L j If L is only connected to half of the head node of the doubly linked list, then j If L is the head node of the doubly linked list, set bArr[j] to 0, and proceed to step ③; j If L is only connected to half of the tail node of the doubly linked list, then j If L is the tail node, set bArr[j] to 0, then proceed to step ③; j If L can be connected to both the head and tail nodes simultaneously, then j Connected to the head and tail nodes, the doubly linked list currently storing half of the side is a hole or an island, bArr[j] is set to 0, go to step ⑤ to execute; L j If the head and tail vertices of L are swapped, then... j Connect to the head or tail node of the doubly linked list, then proceed to step ④. Otherwise, go to ③ for execution. ⑤ If the current hole has already been detected and repaired in the adjacent overlapping local space, proceed to ②; otherwise, repair the hole; let n be the number of half-sides stored in the doubly linked list; the specific steps are as follows: if n L =3, then calculate the vertices of the holes or islands corresponding to the 3 half-sides. If the number of vertices greater than 180° is >3*0.6, the half-side corresponds to an island and is not processed for now; otherwise, add the corresponding triangular facets to the 3D model; if n L If n ≥ 4, then calculate n. L The half-side corresponds to the apex of a hole or an island. If the apex angle is greater than 180°, the number of such apex angles is greater than n. L *0.6, the half-side corresponds to an isolated island, which is not processed for the time being; otherwise, the half-side corresponds to a hole, and each time the two half-sides with the smallest vertices are selected for repair, that is, the half-sides form a new triangular facet, and the half-sides of the hole are updated until the hole is completely repaired.