Large-scale point cloud data processing method based on improved random forest segmented projection

By improving the random forest segmented projection method and combining it with the Delaunay algorithm to process large-scale point cloud data, the problems of low computational efficiency and poor mesh quality are solved, and efficient and accurate 3D mesh generation is achieved, which is applicable to fields such as digital city modeling and smart mine surveying.

CN121639979APending Publication Date: 2026-03-10KUNMING UNIV OF SCI & TECH
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-12-11
Publication Date
2026-03-10

AI Technical Summary

Technical Problem

Traditional methods are computationally inefficient and produce poor mesh quality when processing large-scale point cloud data, especially in engineering scenarios such as terrain surveying and 3D scanning of mines, which can result in distorted triangles.

Method used

An improved random forest segmented projection method is adopted. The optimal projection direction and segment height are calculated by uniform random forest, and a high-quality 3D mesh is generated by combining it with the Delaunay algorithm. The point cloud data is segmented, projected and stitched using uniform random forest and Delaunay algorithm to generate an efficient 3D mesh model.

Benefits of technology

It improves the efficiency and mesh quality of large-scale point cloud data processing, and is applicable to fields such as digital city modeling, smart mine surveying, and geological exploration, realizing efficient and accurate meshing and 3D modeling of massive point cloud data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121639979A_ABST
    Figure CN121639979A_ABST
Patent Text Reader

Abstract

The invention relates to a large-scale point cloud data processing method based on improved random forest segmented projection, and belongs to the technical field of computer graphics and three-dimensional reconstruction. The method comprises the steps of obtaining to-be-processed point cloud data, and determining segmented projection heights according to user settings; calculating a spatial distribution uniformity score SDUS and a projection dispersion score PDS of each projection angle according to the uniformity random forest, and determining an optimal projection direction based on the total score of the distribution uniformity score SDUS and the projection dispersion score PDS; performing coordinate conversion on the point cloud data according to the optimal projection direction, and converting world coordinates into local three-dimensional coordinates; based on the optimal projection direction and the projection height, projecting the to-be-processed point cloud data to the 2D image in a segmented manner, generating a 2D grid for the projected 2D image data by adopting a Delaunay algorithm, and then performing back projection on the 2D grid to construct and generate a plurality of 3D grid data segments; and performing splicing processing on all the 3D grid data segments based on a preset splicing point cloud proportion threshold value and the splicing tolerance to generate a three-dimensional grid model.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to a method for processing large-scale point cloud data based on improved random forest piecewise projection, belonging to the field of computer graphics and 3D reconstruction technology. Background Technology

[0002] Delaunay triangulation is a classic algorithm in computer graphics for generating high-quality triangular meshes. The resulting meshes possess maximum and minimum angle properties, demonstrating excellent performance in numerical computation and rendering. However, when directly applied to large-scale, high-density, or drastically varying depth 3D point cloud data, traditional methods often suffer from the problem of discarding certain parameters in the projection direction. z Axial projection causes data overlap, resulting in distorted triangles. This problem is particularly pronounced when processing point clouds generated in engineering scenarios such as terrain surveying and 3D mine scanning, limiting the efficiency and practicality of algorithms. Therefore, providing a method that can efficiently process large-scale point clouds and generate high-quality 3D meshes is of significant practical importance. Summary of the Invention

[0003] To address the issues of low computational efficiency and poor mesh quality in traditional methods when processing large-scale point clouds, this invention proposes a large-scale point cloud data processing method based on improved random forest piecewise projection. This method achieves a balance between speed and accuracy, is suitable for post-processing of point cloud data such as roads, railways, and pipelines, and can realize efficient and accurate extraction and application of laser point cloud data.

[0004] A method for processing large-scale point cloud data based on improved random forest piecewise projection, the specific steps of which are as follows: S1. Obtain the point cloud data to be processed, parse the point cloud data, read the coordinate information of the point cloud data, and determine the segmented projection height according to the user settings; S2. Project the point cloud data into segments. Calculate the Spatial Distribution Uniformity Score (SDUS) for each projection angle using Uniform Random Forest (URF). Calculate the Projection Dispersion Score (PDS) for each projection angle using the same URF. Calculate the total score of the SDUS and PDS. The projection direction with the highest total score is the optimal projection direction. Perform coordinate transformation on the point cloud data based on the optimal projection direction, converting world coordinates to local 3D coordinates. S3. Based on the optimal projection direction and segmented projection height, the point cloud data to be processed is segmented and projected onto a 2D image. The Delaunay algorithm is used to generate a 2D mesh from the projected 2D image data. Then, the 2D mesh is back-projected to construct multiple 3D mesh data segments. S4. Based on the preset splicing point cloud ratio threshold and splicing tolerance, all 3D mesh data segments are spliced ​​to generate a three-dimensional mesh model.

[0005] Preferably, the point cloud data in S1 is acquired by laser scanning or a depth camera.

[0006] Preferably, S2. Calculate the spatial distribution uniformity score (SDUS) for each projection angle based on the uniformity random forest, specifically including: S211. Based on the user-defined segmented projection height h Given the current projection direction, calculate the number of segments N = H / h, in, H The point cloud height in the current projection direction. h The segmented projection height is set by the user; the volume occupied by the bounding box of each segment in the current projection direction is calculated. V This describes the maximum possible spatial range occupied by the point cloud of each segment in the current segment. S212. Count the number of point clouds in each bounding box at the current segmentation. n ; S213. Calculate the space fill rate, i.e., the number of point clouds. n Divide by the volume occupied by the bounding box V The obtained ratio reflects the density of the point cloud in the current volume. The larger the value, the denser the point cloud distribution in the current projection direction; the smaller the value, the sparser the point cloud distribution in the segment of the current projection direction. S214. Calculate the coefficient of variation of the average distance between each point and its nearest neighbor. CV Coefficient of variation CV The local point density reflects the distance between points. If the distribution of points in the current segment is uniform, the distance variation coefficient is small. Conversely, if the distribution is uneven, the distance variation is sparse and large, indicating that the distribution of points in the current segment is not uniform. S215. Multiply the spatial density of all segments in the current projection direction by the coefficient of variation to calculate the spatial distribution uniformity score (SDUS), i.e.: ; In the formula, N The number of segments into which the point cloud is divided according to the projection direction and segment height. what For the first i The number of point clouds in each segment Vi For the firsti The bounding box volume of each segment. CV For the first i The coefficient of variation of the average distance between each point in each segment and its nearest neighbor; The Spatial Distribution Uniformity Score (SDUS) describes the spatial distribution pattern of points. It also considers the spatial distribution and point density of the segmented data under the current projection direction, providing a quantitative evaluation standard for the quality of point cloud segmentation.

[0007] Preferably, S2. Calculate the projection dispersion score (PDS) for each projection angle based on the uniform random forest, specifically including: S221. Based on the user-defined segmented projection height, project the point cloud data according to the current projection direction to obtain a two-dimensional point set of the 2D image; specifically including: S2211. Along the current projection direction, using the user-defined segmented projection height as the step size, divide the transformed point cloud data into multiple height intervals; S2212. Define the point cloud data within each height interval as a point cloud data segment; S2213. Project the segmented point cloud data segments onto the projection direction based on the projection direction, and transform multiple point cloud data segments into two-dimensional data points of multiple 2D images; S222. Calculate the proportion of discrete points to the total number of points. Routlier,i ; S223. Calculate the compactness ratio of the current projected shape. Third ; S224. Calculate the overall score PDS under the current projection direction, specifically including: S2241. For each segment, calculate the proportion of discrete points taking into account. Routlier,i Ratio to compact Third The overall score is calculated as follows: the overall score for each segment is (1 - the proportion of discrete points). Routlier,i ) × Compact ratio Third ; S2242. The average of the comprehensive scores of all segments is taken to obtain the comprehensive score PDS under the current projection direction. The calculation formula is as follows: ; In the formula, PDS represents the proportion of discrete points considered in the current projection direction. Routlier,i Ratio to compact Third The overall score, N The number of segments into which the point cloud is divided according to the projection direction and segment height. Routlier,i Let be the proportion of discrete points in the i-th segment. Third Let be the compactness ratio of the i-th segment.

[0008] More preferably, step S221 involves calculating the proportion of discrete points to the total number of points. Routlier,i Specifically, it includes: S2221. Construct a KD-tree (K-Dimensional Tree) on a two-dimensional point set of a 2D image, and utilize... k The nearest neighbor algorithm calculates the average distance between each point and its 5 nearest neighbors; S2222. Using the IQR (Interquartile Range) method to detect discrete points: Calculate the first quartile of all mean distances. and the third and fourth quartiles The interquartile range (ICM) is calculated using the interquartile range formula: ; In the formula, This is the first quartile, which is the number of boundaries at the 25th percentile of the mean distance. The third quartile is the value that represents 75% or more of the data. IQR It is the interquartile range, that is and The difference is used to define the distribution range of 50% of the data; S2223. Set the outlier threshold as OT (OutlierThreshold). Points exceeding the threshold OT are considered discrete points. The formula for calculating OT is: ; In the formula, OT is the discrete point threshold ( OutlierThreshold Points exceeding this value are considered discrete points. It is the third quartile. IQR Interquartile range; S2224. Calculate the proportion of discrete points in the current projection direction relative to the total number of points. Routlier,i It is used to quantify the degree of fragmentation of the point cloud data after projection.

[0009] More preferably, step S223 involves calculating the compactness ratio of the current projected shape. Third Specifically, it includes: S2231. Calculate the area occupied by the 2D image after projection. St. ; S2232. Calculate the area of ​​the bounding box occupied by the projected 2D image. Sh ; S2233. Calculate the compactness ratio of the current projected 2D image shape. Third Compact ratio Third The calculation formula is: ; In the formula, ThirdFor compact ratios, St. The area occupied by the 2D image. Sh The area of ​​the bounding box occupied by the 2D image.

[0010] Preferably, step S2, which involves performing coordinate transformation on the point cloud data according to the optimal projection direction to convert world coordinates into local three-dimensional coordinates, specifically includes: S231. Based on the optimal projection direction, save the three-dimensional coordinates (X, Y, F) of the lower left corner of the point cloud data in the optimal projection direction. min ,Y min Z min And change the 3D coordinates of the point cloud data in the lower left corner to (0,0, 0); S232. Replace the 3D coordinates of all other point cloud data, changing the coordinate values ​​of the point cloud data to (XX). min YY min ZZ min ).

[0011] Preferably, step S3, based on the optimal projection direction and segmented projection height, involves segmenting the point cloud data to be processed and projecting it onto a 2D image. The Delaunay algorithm is then used to generate a 2D mesh from the projected 2D image data. Finally, the 2D mesh is back-projected to construct multiple 3D mesh data segments. Specifically, this includes: S31. Along the optimal projection direction, using the user-defined segmented projection height as the step size, divide the transformed point cloud data into multiple height intervals; S32. Define the point cloud data within each height interval as a point cloud data segment; S33. Project the segmented point cloud data segments onto the projection direction based on the projection direction, and transform multiple point cloud data segments into two-dimensional data points of multiple 2D images; S34. Using the Delaunay algorithm, set the boundaries and minimum angle threshold for 2D images. θ The settings convert 2D data points of a 2D image into multiple 2D grid data segments; specifically including: S341. Set the minimum angle threshold for the triangle. θ min Perform Delaunay triangulation on the 2D image and iterate through all the generated triangles; S342. Calculate the three interior angles of each triangle. , , The formula for calculating the angle is: ; ; ; In the formula, a, b, and c are the lengths of the three sides of the triangle, and the formula is used to determine whether the minimum angle of the triangle is less than the minimum angle threshold. θ If the minimum angle of the triangle is less than the minimum angle threshold θ If so, vertex optimization or deletion is performed on the triangle to ensure that the generated 2D mesh data segment has good geometric properties; S35. Back-project the 2D mesh data segment along the opposite direction of the user-confirmed direction in the segmented projection to transform it into multiple 3D mesh data segments.

[0012] More preferably, the vertex optimization processing specifically includes: S3421. Detect whether the vertex of a triangle corresponding to the smallest angle is a boundary point; specifically including: S34211. Construct a neighborhood graph of two-dimensional data points in a 2D image, and set the search radius. r ; S34212. For each two-dimensional data point pi In radius r Internal search for its neighboring two-dimensional data point set What? ; S34213. Calculate two-dimensional data points pi The angular coverage range of neighboring two-dimensional data points: The neighboring two-dimensional data points are arranged relative to the two-dimensional data points. pi Sort by polar angle and calculate the maximum angular interval between adjacent two-dimensional data points. θ max ;like θ max Greater than the preset boundary detection threshold θboundary (usually set to π), then determine pi For boundary points, generate a boundary point identifier array for boundary protection during subsequent vertex optimization. S3422. If the vertex of a triangle corresponding to the smallest angle is a boundary point, delete the triangle while keeping the vertex positions unchanged; if the vertex of a triangle corresponding to the smallest angle is not a boundary point, calculate the angle bisector direction vector of that vertex. The formula for calculating the angle bisector direction is: ; In the formula, and Let be the vector pointing from this vertex to the two adjacent vertices; S3423. Move the vertex along the angle bisector direction, the distance moved is... d The calculation formula is: ; In the formula, d For the distance traveled, From the perspective of the target , From the current perspective, For adjustment coefficients, The average length of adjacent sides; S3424. Recalculate the angle of the triangle after the move. If the angle threshold requirement is met, keep the triangle; otherwise, delete the triangle.

[0013] Preferably, step S4, based on a preset point cloud stitching ratio threshold and stitching tolerance, stitches all 3D mesh data segments to generate a 3D mesh model, specifically includes: S41. Confirm whether to use mesh stitching. The user decides whether to use mesh stitching mode through the window. If mesh stitching is not used, the system directly outputs multiple mesh segments; if mesh stitching is used, all 3D mesh data segments are stitched together. S42. Calculate the percentage of points near the dividing line set by the user. If this percentage is not greater than the point cloud stitching ratio threshold, the 3D mesh data segment will merge and stitch duplicate vertices according to the stitching tolerance to generate a 3D mesh model; specifically including: S421. Perform vertex matching on adjacent 3D mesh data segments and set a spatial distance threshold. ; S422. Identify duplicate vertices located near the segmentation boundary and calculate the Euclidean distance between the vertices using the following formula: ; In the formula, distance Let be the Euclidean distance between the two points. x 1, y 1, z 1 represents the three-dimensional coordinates of the first point. x 2, y 2, z 2 represents the three-dimensional coordinates of the second point; If the distance is less than If so, mark it as a repeating vertex; S423. Use the mesh simplification algorithm from the VCG library to merge duplicate vertices in order to maintain the integrity of the mesh topology; S424. Perform Laplacian smoothing on the merged mesh to generate a 3D mesh model; S425. Verify the manifold properties of the stitched 3D mesh model to ensure that the final generated 3D mesh model has good geometric quality.

[0014] The beneficial effects of this invention are: (1) The method of the present invention improves efficiency by automatically determining the projection direction and segmenting the processing, and ensures the quality of the grid by combining coordinate system transformation and two-dimensional projection calculation. It also has high flexibility and is applicable to fields that require processing massive point cloud data, such as digital city modeling, smart mine surveying, and geological exploration, as well as three-dimensional modeling and spatial analysis in geographic information systems (GIS). It realizes efficient and accurate gridding and application of large-scale point cloud data. (2) By segmenting and projecting large-scale point cloud data into two dimensions, the present invention decomposes the complex three-dimensional Delaunay triangulation problem into multiple simple two-dimensional triangulation problems, which significantly reduces computational complexity and memory usage and improves processing efficiency. Furthermore, a configurable point cloud overlap ratio threshold (splicing point cloud ratio threshold) is introduced for mesh splicing, which realizes the seamless fusion of multiple mesh segments and ensures the integrity and accuracy of the final three-dimensional model. Attached Figure Description

[0015] Figure 1 This is a schematic diagram of the process of the present invention; Figure 2 Original rock image for Example 2; Figure 3 This is a point cloud image of the rock obtained by laser scanning in Example 2; Figure 4 This is the optimal projection pattern for Example 2; Figure 5 This is a diagram showing the division of height intervals in Example 2; Figure 6 Generate a mesh diagram segmented for Example 2; Figure 7 This is the final mesh diagram for Example 2; Figure 8 Example 3: Stanford Rabbit Point Cloud Map (Stanford Dataset). Figure 9 This is the optimal projection pattern for Example 3; Figure 10 This is a diagram showing the height intervals for Example 3; Figure 11 Generate a mesh diagram for segmentation in Example 3; Figure 12 This is a grid mosaic diagram of Example 3; Figure 13 This is the final mesh diagram for Example 3. Detailed Implementation

[0016] Various non-limiting embodiments of this application will now be described in detail with reference to the accompanying drawings. It should be understood that the specific embodiments described herein are merely illustrative of this application and are not intended to limit this application.

[0017] Example 1: As Figure 1As shown, a method for processing large-scale point cloud data based on improved random forest piecewise projection is described, with the following specific steps: A method for processing large-scale point cloud data based on improved random forest piecewise projection, the specific steps of which are as follows: S1. Acquire point cloud data to be processed, parse the point cloud data, read the coordinate information of the point cloud data, and determine the segmented projection height according to user settings; the point cloud data is acquired by laser scanning or a depth camera.

[0018] S2. Segmented projection of point cloud data, specifically including: Extracting point cloud geometric parameters and calculating segmented projection height: For 3D point cloud data, extract the point cloud bounding box coordinates and calculate the total height of the point cloud in the projection direction; specifically, the CCCoreLib library of CloudCompare can be used to calculate the key geometric information of each input point cloud data, then perform coordinate system normalization, identify the minimum vertex of the point cloud data bounding box in the current projection direction, and save the coordinate information of the minimum vertex of the point cloud data bounding box as (X... min ,Y min Z min Then, the coordinates of the smallest vertex of the point cloud data bounding box were changed to (0,0,0), and the world coordinate system was changed to the local coordinate system. The coordinates of the remaining points were converted to (X-X). min ,Y - Y min ,Z - Z min For a point cloud bounding box, the maximum coordinate value Z, which has been changed from world coordinates to local coordinates, is used. max and minimum coordinate Z min Calculate the total height using the difference H = |Z max - Z min For segmented processing, the segment projection height is set by the user. h Calculate the number of segments N based on parameters such as projection direction. H / h ; The point cloud data is segmented based on the number of segments and the segment projection height determined by user settings. During segmentation, all points in the transformed point cloud coordinates are ignored. Z Coordinates, projected to XY On a plane, a set of two-dimensional data points forms multiple 2D images.

[0019] The Spatial Distribution Uniformity Score (SDUS) for each projection angle is calculated using the Uniform Random Forest (URF), specifically including: S211. Based on the user-defined segmented projection heighth Given the current projection direction, calculate the number of segments N = H / h, in, H The point cloud height in the current projection direction. h The segmented projection height is set by the user; the volume occupied by the bounding box of each segment in the current projection direction is calculated. V This describes the maximum possible spatial range occupied by the point cloud of each segment in the current segment. S212. Count the number of point clouds in each bounding box at the current segmentation. n ; S213. Calculate the space fill rate, i.e., the number of point clouds. n Divide by the volume occupied by the bounding box V The obtained ratio reflects the density of the point cloud in the current volume. The larger the value, the denser the point cloud distribution in the current projection direction; the smaller the value, the sparser the point cloud distribution in the segment of the current projection direction. S214. Calculate the coefficient of variation of the average distance between each point and its nearest neighbor. CV Coefficient of variation CV The local point density reflects the distance between points. If the distribution of points in the current segment is uniform, the distance variation coefficient is small. Conversely, if the distribution is uneven, the distance variation is sparse and large, indicating that the distribution of points in the current segment is not uniform. S215. Multiply the spatial density of all segments in the current projection direction by the coefficient of variation to calculate the spatial distribution uniformity score (SDUS), i.e.: ; In the formula, N The number of segments into which the point cloud is divided according to the projection direction and segment height. what For the first i The number of point clouds in each segment Vi For the first i The bounding box volume of each segment. CV For the first i The coefficient of variation of the average distance between each point in each segment and its nearest neighbor; The Spatial Distribution Uniformity Score (SDUS) describes the spatial distribution pattern of points. It also considers the spatial distribution and point density of the segmented data under the current projection direction, providing a quantitative evaluation standard for the quality of point cloud segmentation.

[0020] The Projection Dispersion Score (PDS) for each projection angle is calculated based on a uniform random forest, specifically including: S221. Based on the user-defined segmented projection height, project the point cloud data according to the current projection direction to obtain a two-dimensional point set of the 2D image; specifically including: S2211. Along the current projection direction, using the user-defined segmented projection height as the step size, divide the transformed point cloud data into multiple height intervals; S2212. Define the point cloud data within each height interval as a point cloud data segment; S2213. Project the segmented point cloud data segments onto the projection direction based on the projection direction, and transform multiple point cloud data segments into two-dimensional data points of multiple 2D images; S222. Calculate the proportion of discrete points to the total number of points. Routlier,i Specifically, it includes: S2221. Construct a KD-tree (K-Dimensional Tree) on a two-dimensional point set of a 2D image, and utilize... k The nearest neighbor algorithm calculates the average distance between each point and its 5 nearest neighbors; S2222. Using the IQR (Interquartile Range) method to detect discrete points: Calculate the first quartile of all mean distances. and the third and fourth quartiles The interquartile range (ICM) is calculated using the interquartile range formula: ; In the formula, This is the first quartile, which is the boundary number of the 25th percentile in the mean distance. The third quartile is the value that represents 75% or more of the data. IQR It is the interquartile range, that is and The difference is used to define the distribution range of 50% of the data; S2223. Set the outlier threshold as OT (OutlierThreshold). Points exceeding the threshold OT are considered discrete points. The formula for calculating OT is: ; In the formula, OT is the discrete point threshold ( OutlierThreshold Points exceeding this value are considered discrete points. It is the third quartile. IQR Interquartile range; S2224. Calculate the proportion of discrete points in the current projection direction relative to the total number of points. Routlier,i This is used to quantify the degree of fragmentation in the projected point cloud data. S223. Calculate the compactness ratio of the current projected shape. Third Specifically, it includes: S2231. Calculate the area occupied by the 2D image after projection. St. ; S2232. Calculate the area of ​​the bounding box occupied by the projected 2D image. Sh ; S2233. Calculate the compactness ratio of the current projected 2D image shape. Third Compact ratio Third The calculation formula is: ; In the formula, Third For compact ratios, St. The area occupied by the 2D image. Sh The area of ​​the bounding box occupied by the 2D image; S224. Calculate the overall score PDS under the current projection direction, specifically including: S2241. For each segment, calculate the proportion of discrete points taking into account. Routlier,i Ratio to compact Third The overall score is calculated as follows: the overall score for each segment is (1 - the proportion of discrete points). Routlier,i ) × Compact ratio Third ; S2242. The average of the comprehensive scores of all segments is taken to obtain the comprehensive score PDS under the current projection direction. The calculation formula is as follows: ; In the formula, PDS represents the proportion of discrete points considered in the current projection direction. Routlier,i Ratio to compact Third The overall score, N The number of segments into which the point cloud is divided according to the projection direction and segment height. Routlier,i Let be the proportion of discrete points in the i-th segment. Third Let be the compactness ratio of the i-th segment.

[0021] Calculate the total score of the Distribution Uniformity Score (SDUS) and the Projection Dispersion Score (PDS). The projection direction with the highest total score is the optimal projection direction. Based on the optimal projection direction, perform coordinate transformation on the point cloud data, converting world coordinates to local 3D coordinates. Specifically, this includes: S231. Based on the optimal projection direction, save the three-dimensional coordinates (X, Y, F) of the lower left corner of the point cloud data in the optimal projection direction. min ,Y min Z min And change the 3D coordinates of the point cloud data in the lower left corner to (0,0, 0); S232. Replace the 3D coordinates of all other point cloud data, changing the coordinate values ​​of the point cloud data to (XX). min YY min ZZ min ).

[0022] S3. Based on the optimal projection direction and segmented projection height, the point cloud data to be processed is segmented and projected onto a 2D image. The Delaunay algorithm is used to generate a 2D mesh from the projected 2D image data. Then, the 2D mesh is back-projected to construct multiple 3D mesh data segments; specifically including: S31. Along the optimal projection direction, using the user-defined segmented projection height as the step size, divide the transformed point cloud data into multiple height intervals; S32. Define the point cloud data within each height interval as a point cloud data segment; S33. Project the segmented point cloud data segments onto the projection direction based on the projection direction, and transform multiple point cloud data segments into two-dimensional data points of multiple 2D images; S34. Using the Delaunay algorithm, set the boundaries and minimum angle threshold for 2D images. θ The settings convert 2D data points of a 2D image into multiple 2D grid data segments; specifically including: S341. Set the minimum angle threshold for the triangle. θ min Perform Delaunay triangulation on the 2D image and iterate through all the generated triangles; S342. Calculate the three interior angles of each triangle. , , The formula for calculating the angle is: ; ; ; In the formula, a, b, and c are the lengths of the three sides of the triangle, and the formula is used to determine whether the minimum angle of the triangle is less than the minimum angle threshold. θ If the minimum angle of the triangle is less than the minimum angle threshold θ If the triangle is not properly optimized, then vertex optimization or deletion is performed to ensure that the generated 2D mesh data segment has good geometric properties; the vertex optimization specifically includes: S3421. Detect whether the vertex of a triangle corresponding to the smallest angle is a boundary point; specifically including: S34211. Construct a neighborhood graph of two-dimensional data points in a 2D image, and set the search radius. r ; S34212. For each two-dimensional data point pi In radius r Internal search for its neighboring two-dimensional data point set What? ; S34213. Calculate two-dimensional data points piThe angular coverage range of neighboring two-dimensional data points: The neighboring two-dimensional data points are arranged relative to the two-dimensional data points. pi Sort by polar angle and calculate the maximum angular interval between adjacent two-dimensional data points. θ max ;like θ max Greater than the preset boundary detection threshold θboundary (usually set to π), then determine pi For boundary points, generate a boundary point identifier array for boundary protection during subsequent vertex optimization. S3422. If the vertex of a triangle corresponding to the smallest angle is a boundary point, delete the triangle while keeping the vertex positions unchanged; if the vertex of a triangle corresponding to the smallest angle is not a boundary point, calculate the angle bisector direction vector of that vertex. The formula for calculating the angle bisector direction is: ; In the formula, and Let be the vector pointing from this vertex to the two adjacent vertices; S3423. Move the vertex along the angle bisector direction, the distance moved is... d The calculation formula is: ; In the formula, d For the distance traveled, From the perspective of the target , From the current perspective, For adjustment coefficients, The average length of adjacent sides; S3424. Recalculate the angle of the triangle after the move. If the angle threshold requirement is met, keep the triangle; otherwise, delete the triangle.

[0023] S35. Back-project the 2D mesh data segment along the opposite direction of the user-confirmed direction in the segmented projection to transform it into multiple 3D mesh data segments.

[0024] S4. Based on the preset point cloud stitching ratio threshold and stitching tolerance, stitch all 3D mesh data segments to generate a 3D mesh model; specifically including: S41. Confirm whether to use mesh stitching. The user decides whether to use mesh stitching mode through the window. If mesh stitching is not used, the system directly outputs multiple mesh segments; if mesh stitching is used, all 3D mesh data segments are stitched together. S42. Calculate the percentage of points near the dividing line set by the user. If this percentage is not greater than the point cloud stitching ratio threshold, the 3D mesh data segment will merge and stitch duplicate vertices according to the stitching tolerance to generate a 3D mesh model; specifically including: S421. Perform vertex matching on adjacent 3D mesh data segments and set a spatial distance threshold. ; S422. Identify duplicate vertices located near the segmentation boundary and calculate the Euclidean distance between the vertices using the following formula: ; In the formula, distance Let be the Euclidean distance between the two points. x 1, y 1, z 1 represents the three-dimensional coordinates of the first point. x 2, y 2, z 2 represents the three-dimensional coordinates of the second point; If the distance is less than If so, mark it as a repeating vertex; S423. Use the mesh simplification algorithm from the VCG (Visual and Computer Graphics) library to merge duplicate vertices in order to maintain the integrity of the mesh topology; S424. Perform Laplacian smoothing on the merged mesh to generate a 3D mesh model; S425. Verify the manifold properties of the stitched 3D mesh model to ensure that the final generated 3D mesh model has good geometric quality.

[0025] Specifically, the input 3D mesh data segments are format-converted. The `convertCCMeshToVCG` function converts CloudCompare's ccMesh mesh format to the VCG library's vcg::tri::TriMesh mesh format; the `detectMeshBoundaries` function is called to detect mesh boundaries, and `vcg::tri::UpdateTopology` is used to update the topology. <mymesh>::FaceFace updates the mesh adjacency relationship, traverses all mesh edges, identifies edges without adjacent faces as boundary edges, and constructs a set of boundary loops; After format conversion and boundary detection, the mesh topology needs to be updated and the geometric quality verified. This mainly involves updating the mesh topology at the connection and split points to connect them into a global mesh. Then, the geometric quality of the generated mesh is verified. An angle threshold is used to avoid distorted triangles caused by the connection at the split points after connecting them into a global mesh, thus ensuring that the final generated mesh model has good geometric quality. The convertVCGToCCMesh function is used to convert the VCG format mesh back to CloudCompare's ccMesh format, completing the entire mesh stitching process.

[0026] Example 2: Taking a rock block as an example, a method for processing large-scale point cloud data based on improved random forest piecewise projection is described below: S1. In this embodiment, point cloud data of the rock is acquired using a laser scanner. Before scanning, the rock is as follows: Figure 2 As shown, after denoising and other processing, the point cloud data is in .pcd file format, containing 1056 points. It can be opened using the CloudCompare open-source software. Figure 3 As shown, the segmented projection height is then determined. Based on the rock morphology analysis, the segmented projection height is set to 0.02m. S2. Segment the point cloud data for projection, extract the geometric parameters of the rock point cloud and calculate the segment projection height: Use CloudCompare's CCCoreLib library to calculate the key geometric information for each input point cloud data. S21. As Figure 4 As shown, the Spatial Distribution Uniformity Score (SDUS) for each projection angle is calculated using the Uniform Random Forest (URF), and the Projection Dispersion Score (PDS) for each projection angle is calculated using the Uniform Random Forest. The total score of the Spatial Distribution Uniformity Score (SDUS) and the Projection Dispersion Score (PDS) is calculated, and the projection direction with the highest total score is the optimal projection direction. With an XY rotation angle of 15°, SDUS is 0.023 and PDS is 0.72; with an XZ rotation angle of 90°, SDUS is 0.012 and PDS is 0.65; with a positive Z-axis rotation angle of 28°, SDUS is 0.35 and PDS is 0.86; therefore, the optimal projection direction is with a positive Z-axis rotation angle of 28°. S22. Based on the optimal projection direction, normalize the coordinate system of the point cloud data, identify the smallest vertex of the point cloud data bounding box under the current projection direction, and save the coordinate information of the smallest vertex of the point cloud data bounding box as (X... min ,Y min Z min Then, the coordinates of the smallest vertex of the point cloud data bounding box were changed to (0,0,0), and the world coordinate system was changed to the local coordinate system. The coordinates of the remaining points were converted to (X-X). min ,Y - Y min ,Z - Z min For a point cloud bounding box, the maximum coordinate value Z, which has been changed from world coordinates to local coordinates, is used. max and minimum coordinate Z min Calculate the total height using the difference H = |Z max - Z min For segmented processing, the segment projection height is set by the user. h Calculate the number of segments N based on parameters such as projection direction. H / h ; S23. For example Figure 5 As shown, the point cloud data is segmented according to the number of segments and the segment projection height determined by the user settings; S3. For example Figure 6 As shown, based on the optimal projection direction and segmented projection height, the rock point cloud data to be processed is segmented and projected onto a 2D image. The Delaunay algorithm is used to generate a 2D mesh from the projected 2D image data. Then, the 2D mesh is back-projected to construct multiple 3D mesh data segments. The minimum angle threshold for triangles is set to 15°. The interior angles of each generated triangle are calculated. If the minimum angle of a triangle in the generated triangular mesh is less than 15°, vertex optimization is performed, specifically including: S31. Detect whether the vertex corresponding to the minimum angle is a rock boundary point; S32. If the corresponding vertex is a rock boundary point, then the vertex is not optimized and the corresponding triangular mesh is removed. If the corresponding vertex is not a rock boundary point, then the current angle bisector is calculated, and the current vertex is moved along the angle bisector and continuously checked until the interior angle of the triangle is greater than or equal to 15°. S4. Based on the preset point cloud stitching ratio threshold and stitching tolerance, stitch all 3D mesh data segments to generate a 3D mesh model; specifically including: S41. Confirm that mesh stitching is used, calculate the proportion of nearby point clouds between mesh segments. In this embodiment, the point cloud fusion ratio is selected as 4%, and the spatial distance threshold is 0.001m. That is, in each mesh segment, the point clouds within 4% of the bounding box of the area to be stitched participate in the stitching fusion. If the distance is less than the spatial distance threshold, it is marked as a duplicate vertex. S42. For example Figure 7 As shown, the mesh simplification algorithm of the VCG (Visual and Computer Graphics) library is used to merge duplicate vertices to maintain the integrity of the mesh topology. The merged mesh is then smoothed using Laplacian smoothing. In this embodiment, the number of iterations is 5. Finally, the mesh manifold properties are verified by checking whether there are independent vertices and non-manifold edges in the stitched mesh to verify the correctness of the rock mesh topology and generate the final mesh.

[0027] Example 3: Taking the Stanford dataset's point cloud data as an example, a method for processing large-scale point cloud data based on improved random forest piecewise projection is presented, with the following specific steps: S1. As Figure 8 As shown, the Stanford dataset point cloud data to be processed is obtained, the point cloud data is parsed, the coordinate information of the point cloud data is read, and the segmented projection height is determined according to the user settings. In this embodiment, the point cloud data is obtained through a public dataset. The data format is .pcd file, containing 35947 points. It is opened with CloudCompare open source software. According to the dataset morphology analysis, the segmented projection height is set to 0.3m. S2. For example Figure 9 As shown, the point cloud data is segmented and projected, the optimal projection direction is determined, and coordinate transformation is performed. Based on the CCCoreLib library of CloudCompare, the key geometric information of each input point cloud data is calculated. S21. Calculate the spatial distribution uniformity score (SDUS) for each projection angle using the Uniform Random Forest (URF), and calculate the projection dispersion score (PDS) for each projection angle using the Uniform Random Forest. Calculate the total score of the distribution uniformity score (SDUS) and the projection dispersion score (PDS). The projection direction with the highest total score is the optimal projection direction. S22. Based on the optimal projection direction, normalize the coordinate system of the point cloud data, identify the smallest vertex of the point cloud data bounding box under the current projection direction, and save the coordinate information of the smallest vertex of the point cloud data bounding box as (X... min ,Y min Z min Then, the coordinates of the smallest vertex of the point cloud data bounding box were changed to (0,0,0), and the world coordinate system was changed to the local coordinate system. The coordinates of the remaining points were converted to (X-X). min ,Y - Y min ,Z - Z min For a point cloud bounding box, the maximum coordinate value Z, which has been changed from world coordinates to local coordinates, is used. max and minimum coordinate Z min Calculate the total height using the difference H = |Z max - Z min For segmented processing, the segment projection height is set by the user. h Calculate the number of segments N based on parameters such as projection direction. H / h ; S23. The point cloud data is segmented according to the number of segments and the segment projection height determined by the user settings. In this embodiment, it is divided into 7 segments; S3. For example Figure 10 As shown, based on the optimal projection direction and projection height, the Stanford rabbit point cloud data is segmented and projected onto a 2D image to generate 7 2D meshes. The Delaunay algorithm is used to generate 2D meshes from the projected 2D image data, and then the 2D meshes are back-projected to construct 7 3D mesh data segments, as shown. Figure 11 As shown; the minimum angle threshold for triangles is set to 15°. The interior angles of each generated triangle are calculated. If the minimum angle of a triangle in the generated triangular mesh is less than 15°, vertex optimization is performed, specifically including: reprojection to generate 3D mesh data segments; specifically including: S31. Detect whether the vertex corresponding to the minimum angle is a boundary point of the dataset; S32. If the corresponding vertex is a boundary point of the dataset, then the vertex is not optimized and the corresponding triangular mesh is removed. If the corresponding vertex is not a boundary point of the dataset, then the current angle bisector is calculated, the current vertex is moved along the angle bisector, and the detection continues until the interior angle of the triangle is greater than or equal to 15°. S4. Based on the preset point cloud stitching ratio threshold and stitching tolerance, stitch all 3D mesh data segments to generate a 3D mesh model; specifically including: S41. For example Figure 12 As shown, it is confirmed that mesh stitching is used, and the proportion of nearby point clouds between mesh segments is calculated. In this embodiment, the point cloud fusion ratio is selected as 3%, and the spatial distance threshold is 0.01m. That is, in each mesh segment, the point clouds within 3% of the bounding box of the area to be stitched participate in the stitching fusion. If the distance is less than the spatial distance threshold, it is marked as a duplicate vertex. S42. Use the mesh simplification algorithm from the VCG (Visual and Computer Graphics) library to merge duplicate vertices, maintaining the integrity of the mesh topology. Perform Laplacian smoothing on the merged mesh. In this embodiment, the iteration count is 5. Finally, verify the mesh manifold properties by checking for independent vertices and non-manifold edges in the merged mesh, verifying the correctness of the dataset mesh topology, and generating the final mesh. Figure 13 As shown.

[0028] The specific embodiments of the present invention have been described in detail above. However, the present invention is not limited to the above embodiments. Within the scope of knowledge possessed by those skilled in the art, various changes can be made without departing from the spirit of the present invention.< / mymesh>

Claims

1. A method for processing large-scale point cloud data based on improved random forest segmentation projection, characterized in that, The specific steps are as follows: S1. Obtain the point cloud data to be processed, parse the point cloud data, read the coordinate information of the point cloud data, and determine the segmented projection height according to the user setting; S2. Project the point cloud data, calculate the spatial distribution uniformity score SDUS of each projection angle according to the uniformity random forest, calculate the projection dispersion score PDS of each projection angle according to the uniformity random forest, calculate the total score of the distribution uniformity score SDUS and the projection dispersion score PDS, and the projection direction with the highest total score is the best projection direction; coordinate conversion is performed on the point cloud data according to the best projection direction, and the world coordinates are converted into local three-dimensional coordinates; S3. Based on the best projection direction and the segmented projection height, the point cloud data to be processed is projected into a 2D image, a 2D grid is generated by using a Delaunay algorithm on the projected 2D image data, and a plurality of 3D grid data segments are generated by performing inverse projection on the 2D grid; S4. Based on the preset splicing point cloud proportion threshold and the splicing tolerance, all 3D grid data segments are spliced to generate a three-dimensional grid model.

2. The method of claim 1, wherein: S1. The point cloud data is obtained from a laser scanning public data set or a depth camera.

3. The method of claim 1, wherein: S2. Calculate the spatial distribution uniformity score SDUS of each projection angle according to the uniformity random forest, which specifically includes: S211. Calculate the number of segments N according to the user-set segment projection height and the current projection direction h H h, wherein, H is the point cloud height in the current projection direction, h is the user-set segment projection height; calculate the volume occupied by the bounding box in each projection direction when segmented according to the current projection direction V to describe the maximum possible spatial range occupied by each segmented point cloud in the current segment;​​ S212. Count the number of point clouds in each bounding box at the current segmentation time n ; S213. Calculate the space filling rate, i.e. the number of point clouds n Divide by the volume occupied by the bounding box V The obtained ratio; S214. Calculate the coefficient of variation of the average distance of each point from its nearest neighbors CV ; S215. Multiply the spatial density of all segments of the current projection direction by the coefficient of variation to calculate the spatial distribution uniformity score SDUS, that is: ; wherein, N is the number of segments into which the point cloud is divided according to the projection direction and the segment height, n i is the number of points in the first i segment, V i is the bounding box volume of the first i segment, CV i is the coefficient of variation of the average distance of each point in the first i segment to its nearest neighbor.

4. The method of claim 1, wherein: S2. Calculate the projection dispersion score PDS of each projection angle according to the uniformity random forest, which specifically includes: S221. Based on the user-set segmented projection height, project the point cloud data according to the current projection direction to obtain a two-dimensional point set of a 2D image; specifically including: S2211. Divide the transformed point cloud data into multiple height intervals along the current projection direction with the user-set segmented projection height as the step; S2212. Define the point cloud data in each height interval as a point cloud data segment; S2213. Project the segmented point cloud data segments along the projection direction to convert the multiple point cloud data segments into multiple two-dimensional data points of a 2D image; S222. Calculate the proportion of the total number of points occupied by the discrete points R outlier,i ; S223. Calculate compactness ratio of current projected shape C i ; S224. Calculate the comprehensive score PDS under the current projection direction, which specifically includes: S2241. For each segment, calculate a score that takes into account the proportion of discrete points R outlier,i with respect to the compactness ratio C i of the segment; the score for each segment is (1 - the proportion of discrete points R outlier,i ) x the compactness ratio C i of the segment; S2242. Take the average of the comprehensive scores of all segments to obtain the comprehensive score PDS under the current projection direction, and the calculation formula is: ; In the formula, PDS represents the proportion of discrete points considered in the current projection direction. R outlier,i Ratio to compact C i The overall score, N The number of segments into which the point cloud is divided according to the projection direction and segment height. R outlier,i Let be the proportion of discrete points in the i-th segment. C i Let be the compactness ratio of the i-th segment.

5. The method of claim 4, wherein: The S221. calculates the proportion of the total number of points occupied by the discrete points R outlier,i , specifically comprising: S2221. Construct a KD-tree on the 2D point set of the 2D image, using k The nearest neighbor algorithm computes the average distance of each point to its 5 nearest neighbors; S2222. Use IQR Quartile range method to detect outliers: Calculate the first quartile of all mean distances and the third quartile Calculate the quartile range by the quartile range formula: ; wherein is the first quartile, i.e. the boundary number of which 25% of the average distances are smaller than, is the third quartile, i.e. the number of which 75% of the data are smaller than or equal to, IQR is the interquartile range, i.e. is the difference between the first and third quartile, used to define the range of 50% of the data, is the difference between the first and third quartile, used to define the range of 50% of the data, S2223. Set the threshold value of the outlier point as OT, and the point exceeding the threshold value OT is the discrete point; the OT calculation formula is: ; where OT is a discrete point threshold Outlier Threshold , is the third quartile, IQR is the interquartile range; S2224. Calculate the proportion of the total number of points occupied by the discrete points in the current projection direction R outlier,i .

6. The method of claim 4, wherein: The S223. calculates a compactness ratio of the current projected shape C i Specifically includes: S2231. Calculate area occupied by current post-projection 2D image S ty ; S2232. Calculate the area of the bounding box occupied by the post-projection 2D image S z ; S2233. Calculate the compactness ratio of the shape of the current projected 2D image C i compactness ratio C i The formula for calculating the compactness ratio is: ; wherein, C i is a compactness ratio, S ty is an area occupied by a 2D image, S z is a bounding box area occupied by a 2D image.

7. The method of claim 1, wherein: S2. Coordinate conversion is performed on the point cloud data according to the best projection direction, and the world coordinates are converted into local three-dimensional coordinates, which specifically includes: S231. Save the point cloud data three-dimensional coordinates (X min , Y min , Z min ) of the lower left corner in the best projection direction, and change the point cloud data three-dimensional coordinates of the lower left corner to (0, 0, 0); S232. Replace the three-dimensional coordinates of all the remaining point cloud data with the coordinate values of the point cloud data being replaced as (X-X min , Y-Y min , Z-Z min ). S232. Replace the three-dimensional coordinates of all the remaining point cloud data with the coordinate values of the point cloud data being replaced as (X-X min , Y-Y min , Z-Z min ).

8. The method of claim 1, wherein: S3. Based on the best projection direction and the segmented projection height, the point cloud data to be processed is projected into a 2D image, a 2D grid is generated by using a Delaunay algorithm on the projected 2D image data, and a plurality of 3D grid data segments are generated by performing inverse projection on the 2D grid, which specifically includes: S31. Divide the transformed point cloud data into multiple height intervals along the best projection direction with the user-set segmented projection height as the step; S32. Define the point cloud data in each height interval as a point cloud data segment; S33. Project the segmented point cloud data segments along the projection direction to the projection direction to convert the multiple point cloud data segments into multiple 2D image two-dimensional data points; S34. Set the boundary of 2D image and minimum angle threshold by using Delaunay algorithm θ Setting, converting the two-dimensional data points of the 2D image into a plurality of 2D grid data segments; specifically comprising: S341. Set a minimum angle threshold for triangles θ min Delaunay triangulate the 2D image and iterate through all the generated triangles; S342. Calculate the three internal angles of each triangle , , where the angle calculation formula is: ; ; ; In the formula, a, b, c are lengths of three sides of a triangle, and whether the minimum angle of the triangle is less than a minimum angle threshold value is judged θ If the minimum angle of the triangle is less than the minimum angle threshold value θ , vertex optimization processing or deletion processing is performed on the triangle. S35. Anti-project the 2D grid data segments along the reverse direction of the user-confirmed direction in the segmented projection to convert them into multiple 3D grid data segments.

9. The method of claim 8, wherein: The vertex optimization process specifically includes: S3421. Detect whether the vertex corresponding to the minimum angle in the triangle is a boundary point; specifically including: S34211. Construct a neighborhood graph of the 2D data points of the 2D image, set a search radius r ; S34212. For each two-dimensional data point p i , search within a radius r of its neighboring two-dimensional data point set N i ; S34213. Calculate two-dimensional data points p i The angle coverage range of the surrounding adjacent two-dimensional data points: sort the adjacent two-dimensional data points according to the polar angle relative to the two-dimensional data points p i , calculate the maximum angle interval between adjacent two-dimensional data points θ max ; if θ max is greater than the preset boundary detection threshold θ boundary , determine p i as a boundary point, and generate a boundary point identification array; S3422. If the vertex corresponding to the minimum angle in the triangle is a boundary point, delete the triangle and keep the vertex position unchanged; if the vertex corresponding to the minimum angle in the triangle is a non-boundary point, calculate the angle bisector direction vector of the vertex, and the angle bisector direction calculation formula is: ; wherein and are vectors pointing from the vertex to the two adjacent vertices. S3423. Move the vertex in the direction of the angle bisector by a distance of d The calculation formula is: ; wherein d is the moving distance, is the target angle, is the current angle, is the adjustment coefficient, is the average length of the adjacent edges; S3424. Recalculate the angle of the moved triangle, and if it meets the angle threshold requirement, it is retained, otherwise the triangle is deleted.

10. The method of claim 1, wherein: S4. Based on the preset splicing point cloud proportion threshold and splicing tolerance, perform splicing processing on all 3D grid data segments to generate a three-dimensional grid model, specifically including: S41. Confirm whether to use grid splicing, determine whether to use the grid splicing mode through the window by the user, if not using grid splicing, the system directly outputs multiple grid segments; if using grid splicing, perform splicing processing on all 3D grid data segments; S42. Calculate the percentage of the points set by the user close to the segmentation line, if the percentage is not greater than the splicing point cloud proportion threshold, the 3D grid data segment is fused and spliced according to the splicing tolerance to generate a three-dimensional grid model; specifically including: S421. Perform vertex matching on adjacent 3D mesh data segments, set spatial distance threshold ; S422. Identify duplicate vertices near the segmentation boundary, compute the Euclidean distance between vertices , the formula is: ; wherein distance is the Euclidean distance between two points, x 1, y 1, z 1 is the three-dimensional coordinate value of the first point, x 2, y 2, z 2 is the three-dimensional coordinate value of the second point; If the distance is less than then mark it as a duplicate vertex; S423. Use the grid simplification algorithm of the VCG library to fuse the repeated vertices to maintain the integrity of the grid topology structure; S424. Perform Laplace smoothing processing on the fused grid to generate a three-dimensional grid model; S425. Verify the manifold properties of the spliced three-dimensional grid model.