A point cloud filtering method, apparatus, system, and storage medium
By preprocessing point cloud data and constructing triangular meshes, analyzing inconsistencies, and filtering out collinear and non-collinear points, the problem of insufficient filtering accuracy for multi-story buildings and the ground in existing technologies is solved, and higher precision point cloud filtering is achieved.
Patent Information
- Application Number
- CN202310152744.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-02-22
- Publication Date
- 2026-01-06
- Estimated Expiration
- 2043-02-22
AI Technical Summary
In existing technologies, existing point cloud processing methods, especially for steep slope filtering algorithms, cannot be effectively applied to multi-story buildings or ground surfaces in urban scenes, resulting in a decrease in filtering accuracy.
By preprocessing the raw point cloud data, a triangular mesh is constructed, inconsistencies in the triangular mesh group are analyzed, collinear and non-collinear points are filtered out, and the initial and target ground point clouds are selected based on the collinear and non-collinear points.
It effectively eliminates non-ground points, solving the problem that existing slope filtering algorithms cannot be applied to multi-story buildings or ground surfaces, thus improving filtering accuracy and closely resembling the actual physical model.
Smart Images

Figure CN116385282B_ABST
Abstract
Description
Technical Field
[0001] This invention mainly relates to the field of remote sensing image technology, specifically to a point cloud filtering method, device, system, and storage medium. Background Technology
[0002] LiDAR point clouds, containing a massive set of points representing the spectral characteristics of a target surface, are discretely distributed and measurable, making them of particular importance to humans. Due to their measurable nature, LiDAR point clouds are widely used in the surveying industry. However, the sheer volume of point cloud data makes its extraction process complex. Point cloud filtering primarily refers to extracting target point cloud data using specific algorithms. The fundamental purpose of non-ground point removal is to use point cloud filtering algorithms to separate non-ground points from ground points. After obtaining the ground points, information such as the DEM, contour lines, and earthwork volume of the measurement area can be calculated. Point cloud data extraction and segmentation remain an unavoidable part of point cloud data processing. The sheer volume of point clouds has made data segmentation a research focus of considerable interest.
[0003] Currently, the commonly used mainstream point cloud filtering algorithms mainly include the progressive triangulation filtering algorithm, the cloth simulation filtering algorithm, and the slope filtering algorithm. The progressive triangulation filtering algorithm is developed by Axel. Sson et al. proposed a method that first selects the lowest point in a local area as the seed point of the TIN, and then uses the remaining points to iteratively refine the triangular mesh. However, this method often fails to retain points on steep slopes and treats objects close to the ground as ground points. The cloth simulation filtering algorithm, proposed by Zhang et al., works by first flipping the original point cloud data vertically, then projecting the flipped point cloud data and the user-simulated cloth nodes onto the same horizontal plane. It finds the point corresponding to each node in the cloth in the point cloud data and records the height of that point before projection. Finally, it compares the distance between the laser point cloud and the cloth node on the same horizontal coordinate. If the distance exceeds a set threshold, it is marked as a non-ground point; otherwise, it is marked as a ground point. The cloth simulation point cloud filtering algorithm has five adjustable parameters to perform point cloud filtering. In actual filtering, the filtering effect is mainly improved by modifying the grid resolution and cloth stiffness parameters. However, the cloth simulation filtering algorithm does not perform well when dealing with multi-story buildings. The slope filtering algorithm, proposed by Vosse... Iman proposed a method that distinguishes ground points from non-ground points based on slope differences. However, this method, which uses a fixed slope, is not reasonable and cannot be applied globally. Many scholars have proposed improvements based on the three commonly used filtering methods. Sithole improved the slope filtering algorithm by changing the slope threshold according to the terrain, enhancing the algorithm's applicability. However, this method still requires setting multiple parameters manually. Wang Wenqi et al. also proposed a multi-scale adaptive point cloud slope filtering method. This method borrows the idea of multi-scale virtual networks and uses distance weighting to achieve multi-scale adaptive point cloud slope filtering. However, this method has poorer stability in urban scenes compared to triangular mesh filtering. Summary of the Invention
[0004] The technical problem to be solved by the present invention is to provide a point cloud filtering method, device, system and storage medium to address the shortcomings of the prior art.
[0005] The technical solution of this invention to solve the above-mentioned technical problems is as follows: A point cloud filtering method, comprising the following steps:
[0006] Import multiple raw point cloud data, and preprocess each of the raw point cloud data to obtain preprocessed point cloud data corresponding to each of the raw point cloud data.
[0007] Triangular meshes are constructed from multiple preprocessed point cloud data, and adjacent triangular meshes are grouped together to obtain multiple triangular mesh groups.
[0008] By analyzing the inconsistencies in each of the triangular mesh groups, multiple collinear points and multiple non-collinear points are obtained.
[0009] Multiple initial ground point clouds are selected from all the preprocessed point cloud data based on multiple collinear points;
[0010] Multiple target ground point clouds are selected from all the preprocessed point cloud data and all the initial ground point clouds based on multiple non-collinear points, and the multiple target ground point clouds are used as the point cloud filtering results.
[0011] Another technical solution of the present invention to solve the above-mentioned technical problems is as follows: A point cloud filtering device, comprising:
[0012] The preprocessing module is used to import multiple raw point cloud data and preprocess each of the raw point cloud data to obtain preprocessed point cloud data corresponding to each of the raw point cloud data.
[0013] The mesh construction module is used to construct triangular meshes from multiple preprocessed point cloud data, and to group adjacent triangular meshes into multiple triangular mesh groups.
[0014] The analysis module is used to analyze the inconsistencies of each of the triangular mesh groups, and obtain multiple collinear points and multiple non-collinear points;
[0015] The filtering module is used to filter out multiple initial ground point clouds from all the preprocessed point cloud data based on multiple collinear points;
[0016] The filtering result acquisition module is used to filter out multiple target ground point clouds from all the preprocessed point cloud data and all the initial ground point clouds based on multiple non-collinear points, and use the multiple target ground point clouds as the point cloud filtering result.
[0017] Based on the point cloud filtering method described above, the present invention also provides a point cloud filtering system.
[0018] Another technical solution of the present invention to solve the above-mentioned technical problems is as follows: a point cloud filtering system, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the point cloud filtering method as described above.
[0019] Based on the point cloud filtering method described above, the present invention also provides a computer-readable storage medium.
[0020] Another technical solution of the present invention to solve the above-mentioned technical problems is as follows: a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the point cloud filtering method as described above.
[0021] The beneficial effects of this invention are as follows: By preprocessing the original point cloud data, preprocessed point cloud data is obtained. Triangular meshes are constructed from the preprocessed point cloud data, and adjacent triangular meshes are grouped into multiple triangular mesh groups. Inconsistent points in the triangular mesh groups are analyzed to obtain collinear and non-collinear points. Initial ground point clouds are selected from the preprocessed point cloud data based on collinear points, and point cloud filtering results are selected from the preprocessed point cloud data and the initial ground point cloud based on non-collinear points. This achieves the purpose of eliminating non-ground points and solves the problem that slope filtering algorithms cannot be applied to multi-story buildings or ground. It can filter layer by layer based on the characteristics of non-ground points, which is closer to the actual physical model. At the same time, it also avoids the problem of decreased filtering accuracy caused by using a fixed slope threshold in slope filtering. Attached Figure Description
[0022] Figure 1 This is a flowchart illustrating a point cloud filtering method provided in an embodiment of the present invention.
[0023] Figure 2 This is a block diagram of a point cloud filtering device provided in an embodiment of the present invention. Detailed Implementation
[0024] The principles and features of the present invention are described below with reference to the accompanying drawings. The examples given are only for explaining the present invention and are not intended to limit the scope of the present invention.
[0025] Figure 1 This is a flowchart illustrating a point cloud filtering method provided in an embodiment of the present invention.
[0026] like Figure 1 As shown, a point cloud filtering method includes the following steps:
[0027] Import multiple raw point cloud data, and preprocess each of the raw point cloud data to obtain preprocessed point cloud data corresponding to each of the raw point cloud data.
[0028] Triangular meshes are constructed from multiple preprocessed point cloud data, and adjacent triangular meshes are grouped together to obtain multiple triangular mesh groups.
[0029] By analyzing the inconsistencies in each of the triangular mesh groups, multiple collinear points and multiple non-collinear points are obtained.
[0030] Multiple initial ground point clouds are selected from all the preprocessed point cloud data based on multiple collinear points;
[0031] Multiple target ground point clouds are selected from all the preprocessed point cloud data and all the initial ground point clouds based on multiple non-collinear points, and the multiple target ground point clouds are used as the point cloud filtering results.
[0032] It should be understood that the raw point cloud data may be LiDAR point cloud data.
[0033] Specifically, LiDAR point cloud data (i.e., the original point cloud data) is acquired and preprocessed to filter out outliers and thin out the data to reduce the amount of subsequent computation.
[0034] It should be understood that a corresponding three-dimensional triangular mesh (i.e., the triangular mesh) is generated based on the generated point cloud data (i.e., the preprocessed point cloud data), and the relationship between each triangle is confirmed.
[0035] In the above embodiments, preprocessed point cloud data is obtained by preprocessing the original point cloud data. Triangular meshes are constructed from the preprocessed point cloud data, and adjacent triangular meshes are grouped into multiple triangular mesh groups. Inconsistent points in the triangular mesh groups are analyzed to obtain collinear and non-collinear points. Initial ground point cloud is selected from the preprocessed point cloud data based on collinear points, and point cloud filtering results are selected from the preprocessed point cloud data and the initial ground point cloud based on non-collinear points. This achieves the purpose of eliminating non-ground points and solves the problem that slope filtering algorithms cannot be applied to multi-story buildings or ground. It can filter layer by layer based on the characteristics of non-ground points, which is closer to the actual physical model. At the same time, it also avoids the problem of decreased filtering accuracy caused by using a fixed slope threshold in slope filtering.
[0036] Optionally, as an embodiment of the present invention, the process of preprocessing each of the original point cloud data to obtain preprocessed point cloud data corresponding to each of the original point cloud data includes:
[0037] Each of the original point cloud data is filtered to obtain filtered point cloud data corresponding to each of the original point cloud data.
[0038] The filter point cloud data is thinned using the cl oudcompare component to obtain preprocessed point cloud data corresponding to the original point cloud data.
[0039] It should be understood that the aforementioned CloudCompare component, namely CloudCompare, is a 3D point cloud (Point Cloud) processing software that can easily perform functions such as calculating normal vectors, optimizing normal vectors, Poisson mesh construction, and filtering. CloudCompare provides interfaces for GL-based visualization plugins, IO-based reading plugins, and ordinary function plugins, and provides basic examples. By rewriting ordinary function plugins, a plugin project PointThinningPlugin can be obtained, which can achieve the function of point cloud thinning.
[0040] It should be understood that Gaussian filtering is used to filter each of the original point cloud data to obtain filtered point cloud data corresponding to each of the original point cloud data.
[0041] Specifically, Gaussian filtering is used to remove outliers and filter out abnormal data points in the original point cloud. Since the original point cloud is relatively dense, it is then thinned out based on equal distances.
[0042] It should be understood that a statistical filtering method is used on the thinned point cloud data to perform a statistical analysis on the neighborhood of each point and remove points that do not meet certain conditions.
[0043] Specifically, statistical filtering achieves the purpose of denoising point clouds through a two-iteration algorithm. The first iteration calculates the average distance from each point to its nearest neighbor and then determines its distance threshold. The second iteration calculates the average distance from each point to its nearest neighbor. If the average distance is less than the distance threshold, it is retained; if the average distance is greater than the distance threshold, it is regarded as a noise point and is removed.
[0044] In the above embodiments, preprocessing the original point cloud data to obtain preprocessed point cloud data can remove outliers and filter out abnormal data points in the original point cloud, thereby improving the accuracy of the data.
[0045] Optionally, as an embodiment of the present invention, the process of constructing triangular meshes from multiple preprocessed point cloud data, and grouping adjacent triangular meshes into multiple triangular mesh groups, includes:
[0046] The Delorne triangulation algorithm is used to construct triangular meshes from multiple preprocessed point cloud data, resulting in multiple triangular meshes and vertex coordinates corresponding to each triangular mesh.
[0047] Verify whether each vertex coordinate is pairwise equal to any remaining vertex coordinate. If the verification is successful, the triangular meshes corresponding to the pairwise equal vertex coordinates are taken as pairwise adjacent triangular meshes, thereby obtaining multiple pairwise adjacent triangular meshes. The remaining vertex coordinates are any vertex coordinates other than the vertex coordinates to be verified.
[0048] By grouping adjacent triangular meshes together, multiple triangular mesh groups are obtained.
[0049] It should be understood that the Delaunay triangulation algorithm, also known as the Delaunay triangulation algorithm, is an extremely important preprocessing technique for point set triangulation, particularly for numerical analysis (such as finite element analysis) and computer graphics. Due to its uniqueness, many geometric graphs related to point sets are associated with Delaunay triangulation, such as Voronoi diagrams, EMST trees, and Gabriel diagrams. Delaunay triangulation has two main characteristics: maximizing the minimum angle, producing a triangulated network that is "closest to regularization," and ensuring uniqueness (no four points can be concyclic).
[0050] It should be understood that the triangular mesh is generated based on the preprocessed point cloud (i.e., the preprocessed point cloud data) and the triangular mesh is generated by creating a triangulation relationship. The adjacency relationship between two triangles is determined by whether two triangles share the same common edge. Finding two adjacent triangles facilitates the subsequent calculation of discrepancies.
[0051] Specifically, a triangular mesh (i.e., the triangular grid) is a network-like planar control graphic composed of a series of continuous triangles. It is one of the two main extensions of laying out continuous triangles in triangulation and is an effective way to achieve three-dimensional visualization of terrain. This invention generates a series of connected but non-overlapping triangle sets from a three-dimensional point cloud based on the Deloitte triangulation method. The triangular mesh generated by this method has a good structure, simple data structure, low redundancy, and high storage efficiency.
[0052] It should be understood that after generating the corresponding non-overlapping triangulation, the triangles and their edges in the triangulation are numbered for subsequent calculations. The outermost triangles are removed from the numbered triangles to avoid duplication of subsequent calculations and improve the efficiency of the solution. Based on the previous numbering of the triangles, it is checked whether two triangles are adjacent. If they are adjacent, they are marked and recorded.
[0053] In the above embodiments, by constructing triangular meshes from the preprocessed point cloud data, and dividing adjacent triangular meshes into a group to obtain multiple triangular mesh groups, the structure of the triangular mesh is good, the data structure is simple, the redundancy is small and the storage efficiency is high, which facilitates the subsequent inconsistency point judgment calculation.
[0054] Optionally, as an embodiment of the present invention, any triangular mesh in the triangular mesh group includes a first corner point, a second corner point, a third corner point, and multiple triangular mesh coordinates.
[0055] The process of analyzing the discrepancies in each of the triangular mesh groups to obtain multiple collinear points and multiple non-collinear points includes:
[0056] The discrepancy points of each first corner point, second corner point, and third corner point in each of the triangular mesh groups are calculated respectively to obtain multiple original discrepancy points in each of the triangular mesh groups;
[0057] Calculate the difference between any two original inconsistencies in each of the triangular mesh groups to obtain the difference between multiple inconsistencies in each of the triangular mesh groups corresponding to each original inconsistency point;
[0058] According to the first screening condition, the unsightly points to be processed are selected from all the original unsightly points in each of the triangular mesh groups, thereby obtaining multiple unsightly points to be processed in each of the triangular mesh groups. The first screening condition is that the difference between any unsightly point corresponding to the original unsightly point is less than or equal to a preset difference.
[0059] Calculate the distance between any two non-processing points in each of the triangular mesh groups to obtain the distance between the non-processing points in each of the triangular mesh groups and the non-processing points.
[0060] Sort the distances of all the discrepancies in each of the triangular mesh groups in ascending order to obtain multiple sorted distances of discrepancies in each of the triangular mesh groups.
[0061] According to the second filtering condition, target inconsistencies are selected from all the inconsistencies to be processed in each of the triangular mesh groups, resulting in multiple target inconsistencies in each of the triangular mesh groups. The second filtering condition is the sorted distance between the first N inconsistencies to be processed.
[0062] Calculate the slope of any two target inconsistencies in each of the triangular mesh groups to obtain the slopes of multiple inconsistencies in each of the triangular mesh groups corresponding to each target inconsistency point;
[0063] Calculate the difference in slope between any two inconsistencies in each of the triangular mesh groups to obtain the difference in slope between multiple inconsistencies corresponding to each of the target inconsistencies in each of the triangular mesh groups;
[0064] Each triangular mesh group is determined to determine whether the difference in slope of all the discrepancies points is within a preset threshold range. If so, the target discrepancies point corresponding to the difference in slope of all the discrepancies points in each triangular mesh group is taken as a collinear point, thus obtaining multiple collinear points. If not, the target discrepancies point corresponding to the difference in slope of all the discrepancies points in each triangular mesh group is taken as a non-collinear point, thus obtaining multiple non-collinear points.
[0065] Preferably, N can be 2.
[0066] In the above embodiments, the analysis of the inconsistencies of each triangular mesh group yields multiple collinear points and multiple non-collinear points, which solves the problem that the slope filtering algorithm cannot be applied to multi-story buildings or the ground. It can filter layer by layer based on the characteristics of non-ground points, which is closer to the actual physical model.
[0067] Optionally, as an embodiment of the present invention, the process of calculating the discrepancy points of each of the first corner points, the second corner points, and the third corner points in each of the triangular mesh groups to obtain a plurality of original discrepancy points includes:
[0068] The first formula is used to calculate the plane normal vectors of each of the first corner points, the second corner points, and the third corner points, respectively, to obtain the plane normal vectors corresponding to each triangular mesh in each of the triangular mesh groups. The first formula is:
[0069]
[0070] Among them, (a n ,b n ,c n ) represents the plane normal vector corresponding to the nth triangular mesh, a n Let b be the X-axis plane normal vector corresponding to the nth triangular mesh. n c is the Y-axis plane normal vector corresponding to the nth triangular mesh. n Let be the Z-axis plane normal vector corresponding to the nth triangular mesh, where i is the X-axis unit vector, j is the Y-axis unit vector, and k is the Z-axis unit vector. Let X be the X-axis coordinate of the first corner point of the nth triangular grid. Let Y be the Y-coordinate of the first corner point of the nth triangular mesh. Let Z be the Z-axis coordinate of the first corner point of the nth triangular mesh. Let X be the x-coordinate of the second corner point of the nth triangular grid. Let Y be the Y-coordinate of the second corner point of the nth triangular grid. The Z-axis coordinate of the second corner point of the nth triangular mesh is... Let x be the x-coordinate of the nth triangular point in the nth triangular grid. Let z3 be the y-coordinate of the nth triangular point in the nth triangular mesh.n The coordinate of the nth triangular point in the nth triangular grid is shown on the Z-axis.
[0071] The angle between the plane normal vectors in each of the triangular mesh groups is calculated using the second equation, which is:
[0072]
[0073] Where, θ nm Let a be the angle between the normal vectors of the nth and mth triangular meshes. n Let b be the X-axis plane normal vector corresponding to the nth triangular mesh. n c is the Y-axis plane normal vector corresponding to the nth triangular mesh. n Let a be the Z-axis plane normal vector corresponding to the nth triangular mesh. m Let b be the X-axis plane normal vector corresponding to the m-th triangular mesh. m c is the Y-axis plane normal vector corresponding to the m-th triangular mesh. m This is the Z-axis plane normal vector corresponding to the m-th triangular mesh;
[0074] Verify whether the included angle of each of the normal vectors is greater than or equal to a preset angle. If the verification is successful, then select the maximum Z-axis value of multiple triangular mesh coordinates in each of the triangular mesh groups. Use the triangular mesh coordinates corresponding to the selected maximum Z-axis value as the original inconsistency point, thereby obtaining multiple original inconsistency points in each of the triangular mesh groups.
[0075] It should be understood that the discrepancy point is determined based on the normal vectors of the adjacent triangles (i.e., the plane normal vectors).
[0076] Specifically, the normal vectors (i.e., the plane normal vectors) between two adjacent triangles (i.e., the triangular mesh group) are compared to obtain the included angle between the two triangular planes (i.e., the included angle of the normal vectors). If the included angle between the two planes (i.e., the included angle of the normal vectors) exceeds a certain threshold (i.e., the preset included angle), the triangle is determined to be a discrepancy triangle. In the discrepancy triangle, the discrepancy point (i.e., the original discrepancy point) is determined by comparing the relative height and relative position.
[0077] Specifically, the normal vectors of the two adjacent triangles (i.e., the triangular mesh group) are calculated. The angle between the two normal vectors is the angle between the two triangular planes (i.e., the angle between the normal vectors). Then, it is determined whether the pair of triangles is a discordant triangle. If it is a discordant triangle, the highest point of the discordant triangle is taken as the discordant point.
[0078] In the above embodiments, the inconsistencies of each first corner point, second corner point, and third corner point in each triangular mesh group are calculated to obtain multiple original inconsistencies. This solves the problem that the slope filtering algorithm cannot be applied to multi-story buildings or the ground. It can filter layer by layer based on the characteristics of non-ground points, which is closer to the actual physical model.
[0079] Optionally, as an embodiment of the present invention, the process of selecting multiple initial ground point clouds from all the preprocessed point cloud data based on multiple collinear points includes:
[0080] Using all the collinear points as centers, the three-dimensional Euclidean clustering algorithm is used to cluster all the preprocessed point cloud data to obtain a collinear point cluster dataset.
[0081] The collinear point clustering dataset is filtered using the convex hull algorithm, resulting in multiple collinear point 3D outer contour points.
[0082] Draw the three-dimensional outer contour points of all the collinear points to obtain the three-dimensional outer contour lines of the collinear points;
[0083] The preprocessed point cloud data were filtered using MATLAB tools and the collinear point 3D outer contour lines to obtain multiple initial ground point clouds.
[0084] It should be understood that the convex hull algorithm, or convex hull, is a concept in computational geometry (graphics). In a real vector space V, for a given set X, the intersection S of all convex sets containing X is called the convex hull of X. The convex hull of X can be constructed using convex combinations of all points (X1, ..., Xn) in X. In two-dimensional Euclidean space, the convex hull can be imagined as a rubber band that just encloses all the points. In looser terms, given a set of points on a two-dimensional plane, the convex hull is a convex polygon formed by connecting the outermost points, which contains all the points in the set.
[0085] It should be understood that the inconsistency point cloud (i.e., the collinear points) is extracted and clustered to obtain the outer contour of the inconsistency point cloud (i.e., the three-dimensional outer contour points of the collinear points). Then, the cluster centers of each community are calculated to avoid clusters that should be merged into the same community being differentiated into multiple communities.
[0086] Specifically, the point cloud (i.e., the preprocessed point cloud data) is initially divided into communities using a three-dimensional Euclidean clustering method. Then, the outermost three-dimensional outer contour points of the community (i.e., the collinear three-dimensional outer contour points) are obtained based on the convex hull algorithm. This method can represent all non-ground point clouds through three-dimensional outer contours.
[0087] Specifically, the obtained incongruity point cloud (i.e., the preprocessed point cloud data) is classified based on the Euclidean clustering algorithm. The outer contour of the classified community (i.e., the three-dimensional outer contour points of the collinear points) is obtained using the convex hull algorithm. This method continuously inputs points through an iterative method. If a newly input point is outside the original outer contour, it is treated as one of the points of the outer contour and the outer contour is re-evaluated. Based on this method, the three-dimensional outer contour of the incongruity point cloud is obtained. The center point of the outer contour is calculated, and a threshold is set. If the number of point clouds within the set radius of the center point exceeds the threshold and there are no other outer contour center points within a certain radius around it, it is determined to be an independent feature. The remaining outer contours are judged. If there are other outer contour center points within the set radius around it, the regions are merged and determined to be the same feature.
[0088] In the above embodiments, multiple initial ground point clouds are selected from all preprocessed point cloud data based on multiple collinear points, which can achieve the purpose of eliminating non-ground points and solve the problem that the slope filtering algorithm cannot be applied to multi-story buildings or ground. At the same time, it also avoids the problem of decreased filtering accuracy caused by using a fixed slope threshold for slope filtering.
[0089] Optionally, as an embodiment of the present invention, the process of selecting multiple target ground point clouds from all the preprocessed point cloud data and all the initial ground point clouds based on multiple non-collinear points includes:
[0090] S51: Using all the non-collinear points as centers, cluster all the preprocessed point cloud data using a three-dimensional Euclidean clustering algorithm to obtain a non-collinear point clustering dataset.
[0091] S52: Count the total number of non-collinear point clusters in the non-collinear point clustering dataset to obtain the total number of clusters;
[0092] S53: Determine whether the total number of clustered data is greater than or equal to the preset total number. If yes, proceed to S54; otherwise, proceed to S57.
[0093] S54: The non-collinear point clustering dataset is filtered using the convex hull algorithm to obtain multiple non-collinear point 3D outer contour points.
[0094] S55: Draw the three-dimensional outer contour points of all the non-collinear points to obtain the three-dimensional outer contour lines of the non-collinear points;
[0095] S56: Based on the MATLAB tool and the non-collinear point three-dimensional outer contour line, all the preprocessed point cloud data are filtered to obtain multiple target ground point clouds;
[0096] S57: Verify whether each of the preprocessed point cloud data is different from the non-collinear point clustering data in all the non-collinear point clustering datasets. If the verification is successful, the preprocessed point cloud data is used as the target ground point cloud, thereby obtaining multiple target ground point clouds.
[0097] It should be understood that, based on the outer contour of each community (i.e., the non-collinear three-dimensional outer contour points), all original point clouds (i.e., the preprocessed point cloud data) belonging to the outer contour are removed, and the ground point cloud is completed by point cloud interpolation.
[0098] Specifically, the center point of the community (i.e., the non-collinear point) is obtained based on the outer contour. Inconsistent points within a certain radius are obtained. If the number of inconsistent points (i.e., the total number of clustering data) exceeds a certain threshold (i.e., the preset total number) and there are no other community center points within a certain range, the outer contour can be considered as an independent feature. If the number of inconsistent points at the community center does not exceed a certain value, the feature is considered as a small feature. If there are other community center points or more than a certain number of other community points around the community center point, the two communities are considered as overlapping communities or should belong to the same feature. The two communities are then merged into the same community.
[0099] It should be understood that the outer contour is used as the basis for judgment. If a point is inside the outer contour, it is considered a non-ground point and removed. After all point cloud filtering is completed, the remaining point cloud is the ground point cloud. Since point cloud holes will be generated after removing non-ground point clouds, the point cloud interpolation method is used to repair the point cloud holes.
[0100] In the above embodiments, multiple target ground point clouds are selected from all preprocessed point cloud data and all initial ground point clouds based on multiple non-collinear points. This achieves the purpose of eliminating non-ground points and solves the problem that slope filtering algorithms cannot be applied to multi-story buildings or ground. It can filter layer by layer based on the characteristics of non-ground points, which is closer to the actual physical model. At the same time, it also avoids the problem of decreased filtering accuracy caused by using a fixed slope threshold in slope filtering.
[0101] Optionally, as another embodiment of the present invention, the present invention records the coordinates of the outer contour point cloud obtained by the convex hull algorithm, performs equidistant interpolation of the point cloud based on the three-dimensional coordinates of the outer contour point cloud, generates a corresponding three-dimensional grid based on the interpolated point cloud and the point cloud with non-ground points removed, and then fits and adjusts the three-dimensional grid to generate a corresponding three-dimensional ground model.
[0102] Optionally, as another embodiment of the present invention, the present invention includes: Step 1, acquiring LiDAR point cloud data and performing preliminary preprocessing to filter out outliers and thin outliers to reduce subsequent computational load; Step 2, generating a corresponding three-dimensional triangular mesh based on the generated point cloud data and confirming the relationship between each triangle; Step 3, judging inconsistencies based on the normal vectors of adjacent triangles; Step 4, extracting inconsistencies in the point cloud and performing clustering to obtain the outer contour of the inconsistencies, then calculating the cluster centers of each community to avoid clusters that should be merged into the same community being differentiated into multiple communities; Step 5, removing all original point clouds belonging to the outer contour based on the outer contour of each community and completing the ground point cloud through point cloud interpolation. The main innovation of the present invention is that, compared with other ground point filtering methods, it adopts a triangular mesh method. It utilizes the fact that other ground features compared with ground points will generate a certain degree of inconsistencies. Through a clustering algorithm, non-ground point clouds are displayed and connected in a community manner to obtain the corresponding outer contour, and then the non-ground points inside are removed through the outer contour.
[0103] Optionally, as another embodiment of the present invention, after identifying discrepancies through triangular meshes, the present invention analyzes each non-ground point layer by layer according to its characteristics to eliminate non-ground points. This improves upon the slope filtering algorithm's inability to handle multi-story buildings or ground surfaces, and can determine and eliminate non-ground scattered points based on the angle and distance of the triangular mesh. Comparison with other filtering algorithms shows that the filtering accuracy of the present invention is generally higher than that of other algorithms in multiple samples. It can filter layer by layer based on the characteristics of non-ground points, which is closer to the actual physical model.
[0104] Optionally, as another embodiment of the present invention, the present invention first performs preliminary preprocessing on the point cloud data information to remove outliers and dilutes the point cloud density to a certain extent through point cloud thinning to reduce the amount of computation. After completing the preliminary preprocessing of the point cloud data, a three-dimensional triangular network needs to be constructed on the point cloud. Then, the adjacent triangles in the triangular network are judged to find the corresponding inconsistencies. The Euclidean clustering algorithm is used to cluster the inconsistencies of the point clouds belonging to the same ground feature and classify them into the same community. The convex hull algorithm is used to calculate the outer contour of each community and the outer contour points are recorded. After obtaining the community outer contour, the outer contour is re-judged to avoid dividing communities that should belong to the same ground feature into multiple communities and the phenomenon of multiple communities overlapping. After completing the second screening, the point cloud data within the outer contour can be removed. These point cloud data are non-ground points. Finally, the remaining ground point cloud data is interpolated using the interpolation method to achieve the purpose of hole repair.
[0105] As can be seen from the above technical solutions, in the process of segmenting non-ground points in point cloud, the technique of finding inconsistencies and eliminating non-ground points based on the triangulation method can realize point cloud segmentation and generate corresponding three-dimensional terrain point clouds.
[0106] Alternatively, as another embodiment of the present invention, the present invention utilizes point cloud data to obtain target data. During the process of obtaining target data, some incongruity points will be generated between different ground features. The incongruity points are used to generate corresponding outer contours to extract and remove non-ground point clouds, thereby achieving the purpose of extracting bare land terrain in the target area.
[0107] Figure 2 This is a block diagram of a point cloud filtering device provided in an embodiment of the present invention.
[0108] Alternatively, as another embodiment of the present invention, such as Figure 2 As shown, a point cloud filtering device includes:
[0109] The preprocessing module is used to import multiple raw point cloud data and preprocess each of the raw point cloud data to obtain preprocessed point cloud data corresponding to each of the raw point cloud data.
[0110] The mesh construction module is used to construct triangular meshes from multiple preprocessed point cloud data, and to group adjacent triangular meshes into multiple triangular mesh groups.
[0111] The analysis module is used to analyze the inconsistencies of each of the triangular mesh groups, and obtain multiple collinear points and multiple non-collinear points;
[0112] The filtering module is used to filter out multiple initial ground point clouds from all the preprocessed point cloud data based on multiple collinear points;
[0113] The filtering result acquisition module is used to filter out multiple target ground point clouds from all the preprocessed point cloud data and all the initial ground point clouds based on multiple non-collinear points, and use the multiple target ground point clouds as the point cloud filtering result.
[0114] Optionally, another embodiment of the present invention provides a point cloud filtering system, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the point cloud filtering method as described above. This system can be a computer or similar system.
[0115] Optionally, another embodiment of the present invention provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the point cloud filtering method as described above.
[0116] It should be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article, or apparatus.
[0117] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working process of the above-described apparatus and unit can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.
[0118] In the several embodiments provided in this application, it should be understood that the disclosed apparatus and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative. For instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed.
[0119] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of the embodiments of the present invention, depending on actual needs.
[0120] Furthermore, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0121] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of the various embodiments of this invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0122] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.
Claims
1. A method of filtering a point cloud, the method comprising: The method comprises the following steps: Importing a plurality of original point cloud data, and preprocessing each of the original point cloud data to obtain preprocessed point cloud data corresponding to each of the original point cloud data; Constructing a triangular mesh for the plurality of preprocessed point cloud data, dividing two adjacent triangular meshes into a group to obtain a plurality of triangular mesh groups; Analyzing the discomfort points of each of the triangular mesh groups to obtain a plurality of collinear points and a plurality of non-collinear points; Filtering a plurality of initial ground point clouds from all of the preprocessed point cloud data according to the plurality of collinear points; Filtering a plurality of target ground point clouds from all of the preprocessed point cloud data and all of the initial ground point clouds according to the plurality of non-collinear points, and taking the plurality of target ground point clouds as a point cloud filtering result; Any triangular mesh in the triangular mesh group comprises a first corner point, a second corner point, a third corner point, and a plurality of triangular mesh coordinates, The process of analyzing the discomfort points of each of the triangular mesh groups to obtain a plurality of collinear points and a plurality of non-collinear points comprises: Calculating the discomfort points of each of the first corner points, the second corner points, and the third corner points in each of the triangular mesh groups to obtain a plurality of original discomfort points in each of the triangular mesh groups; Calculating the difference between any two of the original discomfort points in each of the triangular mesh groups to obtain a plurality of differences between the discomfort points corresponding to each of the original discomfort points in each of the triangular mesh groups; According to a first filtering condition, filtering out to-be-processed discomfort points from all of the original discomfort points in each of the triangular mesh groups, thereby obtaining a plurality of to-be-processed discomfort points in each of the triangular mesh groups, and the first filtering condition is that any difference between the discomfort points corresponding to the original discomfort points is less than or equal to a preset difference value; Calculating the distance between any two of the to-be-processed discomfort points in each of the triangular mesh groups to obtain a plurality of discomfort point distances corresponding to each of the to-be-processed discomfort points in each of the triangular mesh groups; According to a first filtering condition, filtering out to-be-processed discomfort points from all of the original discomfort points in each of the triangular mesh groups, thereby obtaining a plurality of to-be-processed discomfort points in each of the triangular mesh groups, and the first filtering condition is that any difference between the discomfort points corresponding to the original discomfort points is less than or equal to a preset difference value; According to a first filtering condition, filtering out to-be-processed discomfort points from all of the original discomfort points in each of the triangular mesh groups, thereby obtaining a plurality of to-be-processed discomfort points in each of the triangular mesh groups, and the first filtering condition is that any difference between the discomfort points corresponding to the original discomfort points is less than or equal to a preset difference value; Calculating the slope of any two of the target discomfort points in each of the triangular mesh groups to obtain a plurality of discomfort point slopes corresponding to each of the target discomfort points in each of the triangular mesh groups; Calculating the difference between any two of the target discomfort point slopes in each of the triangular mesh groups to obtain a plurality of differences between the discomfort point slopes corresponding to each of the target discomfort points in each of the triangular mesh groups; respectively, if yes, the target violation points corresponding to the differences between the slopes of the violation points in each of the triangle mesh groups are regarded as collinear points, thereby obtaining a plurality of collinear points; if no, the target violation points corresponding to the differences between the slopes of the violation points in each of the triangle mesh groups are regarded as non-collinear points, thereby obtaining a plurality of non-collinear points.
2. The point cloud filtering method of claim 1, wherein, The process of respectively pre-processing each of the original point cloud data to obtain pre-processed point cloud data corresponding to each of the original point cloud data comprises: respectively filtering each of the original point cloud data to obtain filtered point cloud data corresponding to each of the original point cloud data; respectively filtering each of the original point cloud data to obtain filtered point cloud data corresponding to each of the original point cloud data; 3. The point cloud filtering method of claim 1, wherein, respectively filtering each of the original point cloud data to obtain filtered point cloud data corresponding to each of the original point cloud data. The process of constructing a triangle mesh for a plurality of the pre-processed point cloud data, grouping two-by-two adjacent triangle meshes, and obtaining a plurality of triangle mesh groups comprises: constructing a triangle mesh for a plurality of the pre-processed point cloud data using the Delaunay triangle mesh algorithm to obtain a plurality of triangle meshes and vertex coordinates corresponding to each of the triangle meshes; verifying whether each of the vertex coordinates is equal to any remaining vertex coordinate, if the verification is successful, the triangle mesh corresponding to the two-by-two equal vertex coordinates is regarded as two-by-two adjacent triangle meshes, thereby obtaining a plurality of two-by-two adjacent triangle meshes, and the any remaining vertex coordinate is any vertex coordinate other than the vertex coordinate to be verified; 4. The point cloud filtering method of claim 1, wherein, grouping the two-by-two adjacent triangle meshes to obtain a plurality of triangle mesh groups. The process of respectively calculating the violation points of each of the first corner point, the second corner point and the third corner point in each of the triangle mesh groups to obtain a plurality of original violation points comprises: , in, For the first The plane normal vectors corresponding to each triangular mesh For the first The X-axis plane normal vector corresponding to each triangular mesh For the first The Y-axis plane normal vector corresponding to each triangular mesh For the first The Z-axis plane normal vector corresponding to each triangular mesh The unit vector along the X-axis. The unit vector along the Y-axis. The Z-axis unit vector, For the first The X-axis coordinates of the first corner point of the triangular grid For the first The Y-axis coordinate of the first corner point of the triangular grid For the first The Z-axis coordinates of the first corner point of the triangular grid For the first The X-axis coordinates of the second corner point of the triangular grid For the first The Y-axis coordinates of the second corner point of the triangular grid For the first The Z-axis coordinates of the second corner point of the triangular grid. For the first The X-axis coordinate of the first triangular point in a triangular grid. For the first The Y-axis coordinate of the first triangular point in the triangular grid. For the first The Z-axis coordinate of the first triangular point of a triangular grid; calculating the plane normal vector of each of the first corner point, the second corner point and the third corner point by a first formula to obtain a plane normal vector corresponding to each of the triangle meshes in each of the triangle mesh groups, the first formula being: , in, For the first The triangular grid and the first The angle between the normal vectors of the triangular mesh. For the first The X-axis plane normal vector corresponding to each triangular mesh For the first The Y-axis plane normal vector corresponding to each triangular mesh For the first The Z-axis plane normal vector corresponding to each triangular mesh For the first The X-axis plane normal vector corresponding to each triangular mesh For the first The Y-axis plane normal vector corresponding to each triangular mesh For the first The Z-axis plane normal vector corresponding to each triangular mesh; calculating the included angle of a plurality of plane normal vectors in each of the triangle mesh groups by a second formula to obtain a normal vector included angle in each of the triangle mesh groups, the second formula being:
5. The method of claim 1, wherein, verifying whether each of the normal vector included angles is greater than or equal to a preset included angle, if the verification is successful, respectively screening the Z-axis maximum value of a plurality of triangle mesh coordinates in each of the triangle mesh groups, and regarding the triangle mesh coordinates corresponding to the screened Z-axis maximum value as original violation points, thereby obtaining a plurality of original violation points in each of the triangle mesh groups. The process of screening a plurality of initial ground point clouds from all the pre-processed point cloud data according to a plurality of the collinear points comprises: performing clustering on all the pre-processed point cloud data using a three-dimensional Euclidean clustering algorithm with all the collinear points as the center, thereby obtaining a collinear point clustering and clustering data set; screening the collinear point clustering and clustering data set using a convex hull algorithm, and obtaining a plurality of collinear point three-dimensional outer contour points after screening; Drawing all the collinear point three-dimensional outer contour points to obtain a collinear point three-dimensional outer contour line; Filtering all the pre-processed point cloud data according to the MATLAB tool and the collinear point three-dimensional outer contour line, and obtaining a plurality of initial ground point clouds after filtering.
6. The point cloud filtering method of claim 5, wherein, The process of filtering a plurality of target ground point clouds from all the pre-processed point cloud data and all the initial ground point clouds according to the plurality of non-collinear points comprises: S51: clustering all the pre-processed point cloud data by taking all the non-collinear points as the center of a circle and using a three-dimensional Euclidean clustering algorithm to obtain non-collinear point clustering cluster data sets; S52: counting the total number of non-collinear point clustering cluster data in the non-collinear point clustering cluster data set to obtain a total number of clustering cluster data; S53: determining whether the total number of clustering cluster data is greater than or equal to a preset total number, if yes, performing S54; if no, performing S57; S54: filtering the non-collinear point clustering cluster data set by using the convex hull algorithm to obtain a plurality of non-collinear point three-dimensional outer contour points after filtering; S55: drawing all the non-collinear point three-dimensional outer contour points to obtain a non-collinear point three-dimensional outer contour line; S56: filtering all the pre-processed point cloud data according to the MATLAB tool and the non-collinear point three-dimensional outer contour line to obtain a plurality of target ground point clouds after filtering; S57: verifying whether each pre-processed point cloud data is different from the non-collinear point clustering cluster data in all the non-collinear point clustering cluster data sets, if the verification is successful, the pre-processed point cloud data is taken as the target ground point cloud, thereby obtaining a plurality of target ground point clouds.
7. An apparatus for filtering a point cloud, the apparatus comprising: Comprise: A preprocessing module for importing a plurality of original point cloud data and preprocessing each of the original point cloud data to obtain pre-processed point cloud data corresponding to each of the original point cloud data; A grid construction module for constructing a triangular mesh on the plurality of pre-processed point cloud data, dividing two adjacent triangular meshes into a group to obtain a plurality of triangular mesh groups; An analysis module for analyzing the discomfort points of each of the triangular mesh groups to obtain a plurality of collinear points and a plurality of non-collinear points; A filtering module for filtering a plurality of initial ground point clouds from all the pre-processed point cloud data according to the plurality of collinear points; A filtering result obtaining module for filtering a plurality of target ground point clouds from all the pre-processed point cloud data and all the initial ground point clouds according to the plurality of non-collinear points, and taking the plurality of target ground point clouds as a point cloud filtering result; Any triangular mesh in the triangular mesh group comprises a first corner point, a second corner point, a third corner point, and a plurality of triangular mesh coordinates, The analysis module is specifically configured to: Calculate the discomfort points of each of the first corner points, the second corner points, and the third corner points in each of the triangular mesh groups to obtain a plurality of original discomfort points in each of the triangular mesh groups; Calculate the difference between any two of the original discomfort points in each of the triangular mesh groups to obtain a plurality of differences between the discomfort points corresponding to each of the original discomfort points in each of the triangular mesh groups; screening out to-be-processed inconsistency points from all the original inconsistency points in each of the triangle mesh groups according to a first screening condition, so as to obtain a plurality of to-be-processed inconsistency points in each of the triangle mesh groups, the first screening condition being that a difference of any inconsistency point corresponding to the original inconsistency point is less than or equal to a preset difference value; calculating distances of any two to-be-processed inconsistency points in each of the triangle mesh groups, so as to obtain inconsistency point distances corresponding to the to-be-processed inconsistency points in each of the triangle mesh groups; sequentially sorting all the inconsistency point distances in each of the triangle mesh groups in ascending order, so as to obtain a plurality of sorted inconsistency point distances in each of the triangle mesh groups; screening out target inconsistency points from all the to-be-processed inconsistency points in each of the triangle mesh groups according to a second screening condition, so as to obtain a plurality of target inconsistency points in each of the triangle mesh groups, the second screening condition being that the first N sorted inconsistency point distances corresponding to the to-be-processed inconsistency points; calculating slopes of any two target inconsistency points in each of the triangle mesh groups, so as to obtain a plurality of inconsistency point slopes corresponding to the target inconsistency points in each of the triangle mesh groups; calculating difference values of any two inconsistency point slopes in each of the triangle mesh groups, so as to obtain a plurality of inconsistency point slope differences corresponding to the target inconsistency points in each of the triangle mesh groups; respectively judging whether all the inconsistency point slope differences in each of the triangle mesh groups exist within a preset threshold range, if yes, taking the target inconsistency points corresponding to the inconsistency point slope differences in each of the triangle mesh groups as collinear points, so as to obtain a plurality of collinear points; if not, taking the target inconsistency points corresponding to the inconsistency point slope differences in each of the triangle mesh groups as non-collinear points, so as to obtain a plurality of non-collinear points.
8. A point cloud filtering system comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, the point cloud filtering method of any one of claims 1-6 is implemented.
9. A computer-readable storage medium storing a computer program, the computer program comprising instructions that, when executed by a computer, cause the computer to perform the method of any one of claims 1 to 8. When the computer program is executed by the processor, the point cloud filtering method of any one of claims 1-6 is implemented.