Surface flatness optimization method of 3D model based on point cloud data
Through automatic identification and optimization algorithms, the surface uneven problem in the point cloud data of historical buildings is solved, the accuracy and efficiency of three-dimensional modeling is improved, high-quality input data is provided, and powerful for the digital protection of historical buildings. Technical support.
Patent Information
- Application Number
- CN202411119199.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-15
- Publication Date
- 2024-11-12
- Estimated Expiration
- 2044-08-15
AI Technical Summary
The prior art is difficult to effectively identify and optimize surface uneven areas in historical building point cloud data, especially to improve surface flatness while retaining building features.
Adopting the three-dimensional model surface flatness optimization method based on point cloud data, uneven areas are automatically identified and optimized through data acquisition, preprocessing, coordinate conversion, feature recognition and optimization algorithms, including statistical filtering, CSF simulated fabric filtering, and RANSAC multi-plane Segmentation and uniform voxel filtering can improve the flatness of point cloud data.
It significantly improves the surface flatness of point cloud data, reduces modeling errors, improves model quality, reduces dependence on manual operations, and is easy to integrate the output results, providing an efficient and accurate point cloud data processing method.
Smart Images

Figure CN118628698B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of point cloud processing, and in particular to a method for optimizing the surface flatness of a three-dimensional model based on point cloud data. Background Art
[0002] 3D laser scanning technology plays an important role in the digital protection of historical buildings. Through high-precision scanning equipment, the fine structure of historical buildings can be captured and dense point cloud data can be generated. These data not only record the appearance characteristics of the building, but also reflect the details and irregularities of its surface.
[0003] However, the surfaces of historical buildings often have varying degrees of disease and damage due to their age, which leads to many uneven areas in point cloud data. Traditional point cloud processing methods, such as filtering and downsampling, can remove noise and reduce the amount of data, but they are usually unable to accurately identify and optimize these uneven areas, especially when it is necessary to improve the surface flatness while retaining the architectural features. The above problems need to be solved urgently, and for this purpose, the present invention proposes a surface flatness optimization method for a three-dimensional model based on point cloud data. Summary of the invention
[0004] The technical problem to be solved by the present invention is: how to effectively identify and optimize the surface flatness in building point cloud data so as to provide high-quality input data for three-dimensional modeling. A three-dimensional model surface flatness optimization method based on point cloud data is provided, which can improve the surface flatness of point cloud data, automatically identify uneven areas, and optimize them for subsequent three-dimensional modeling work.
[0005] The present invention solves the above technical problems through the following technical solutions, and the present invention comprises the following steps:
[0006] Step S1: Data collection and processing
[0007] According to the pre-planned collection route and collection sequence, the original laser point cloud data of the building is collected, and then the data is pre-processed;
[0008] Step S2: Identification and optimization of uneven point clouds
[0009] The pre-processed point cloud data is subjected to coordinate transformation and feature recognition to obtain an uneven point cloud, which is then optimized for flatness. After multiple optimizations, a flat point cloud is obtained, thereby achieving surface flatness optimization of the three-dimensional model based on point cloud data.
[0010] Furthermore, in step S1, the process of collecting the original laser point cloud data of the building is as follows:
[0011] Step S101: Arrange a set number of target control points around the building;
[0012] Step S102: using an RTK measuring instrument and a leveling measuring instrument to obtain the plane coordinates and elevation of the target control point;
[0013] Step S103: using a ground-based laser scanning system to obtain original laser point cloud data of the building;
[0014] Step S104: Select preset target control points to check the plane and elevation accuracy of the original laser point cloud data.
[0015] Furthermore, in step S1, the data preprocessing process is as follows:
[0016] Step S111: using statistical filtering to remove high-frequency noise points in the original laser point cloud data of the building;
[0017] Step S112: using CSF simulated cloth filtering algorithm to separate ground points and non-ground points;
[0018] Step S113: using the RANSAC algorithm to perform multi-plane segmentation processing on the point cloud data to obtain the plane point clouds of each surface;
[0019] Step S114: down-sampling the plane point cloud using a uniform voxel filter to obtain the plane point cloud to be detected, that is, to obtain pre-processed point cloud data.
[0020] Furthermore, in step S111, the specific processing process of statistical filtering is as follows:
[0021] Step S1111: Perform statistical analysis on the neighborhood of each data point. The distances of all data points in the point cloud data are assumed to form a Gaussian distribution, whose shape is determined by the mean and standard deviation Determine; let the coordinates of the nth data point in the point cloud data be , from this data point to any data point The distance is:
[0022] ;
[0023] Step S1112: Calculate the average distance between each data point and any data point. The formula is:
[0024] ;
[0025] Step S1113: Assume the standard deviation is:
[0026] ;
[0027] Let the standard deviation multiple be std;
[0028] When the average distance between a data point and k data points is within the standard range If it is within the range, the point is retained; if it is not, it is defined as an outlier and deleted.
[0029] Furthermore, in step S112, the specific processing process of the CSF simulated cloth filtering algorithm is as follows:
[0030] Step S1121: Invert the denoised point cloud data, then project the inverted point cloud data and the cloth nodes simulated by the user onto the same horizontal plane, and find the point corresponding to the cloth node in the point cloud data, and record its height as h;
[0031] Step S1122: in each iteration process, compare the current height of the cloth node with the size of h, until the absolute value of the difference between h and the current height is less than a preset value or the maximum number of iterations is reached, the iteration is terminated;
[0032] Step S1123: Calculate the distance between the inverted point cloud data point at the end of the iteration and the cloth node. When the distance is greater than the set threshold, the point is recorded as a non-ground point and filtered, otherwise it is recorded as a ground point.
[0033] Furthermore, in step S113, the specific processing process of the RANSAC multi-plane segmentation algorithm is as follows:
[0034] Step S1131: Initialize algorithm parameters, including the number of iterations, distance threshold, minimum point number requirement of the plane model, and the number of segmented planes;
[0035] Step S1132: randomly selecting a number of points in the point cloud as a candidate point set for the initial plane model; randomly selecting enough points to initialize the plane model according to the algorithm parameters; these points will be used to fit the first plane;
[0036] Step S1133: fit a plane model using the candidate point set, and segment the point cloud according to the model; fit a plane from the candidate point set using the least squares method or other plane fitting techniques; calculate the distance from each point in the point cloud to the plane, and classify the points with a distance less than a threshold as inliers belonging to the plane; separate the inliers from the point cloud as a representation of the plane; update the point cloud, remove the segmented inliers, and prepare for the next round of iteration;
[0037] Step S1134: Repeat steps S1132 and S1133 for the remaining point clouds until a preset number of iterations is reached or no new plane can be segmented; each iteration attempts to fit a new plane from the remaining point clouds and separates the points belonging to the plane;
[0038] Step S1135: Output multiple plane models after segmentation and corresponding point cloud data; each plane model is defined by a set of parameters, such as a normal vector and an offset; the corresponding point cloud data is a point set segmented by the plane model.
[0039] Furthermore, in step S1131, the number of iterations is used to determine the number of times the algorithm attempts to fit a plane; the distance threshold is used to determine whether a point belongs to a certain plane; the minimum number of points in the plane model is required to ensure that the fitted plane is statistically significant; and the number of segmented planes is the number of planes that the algorithm attempts to segment.
[0040] Furthermore, in step S114, the specific processing process of the uniform voxel filter is as follows:
[0041] Step S1141: Initialize filter parameters, including the size of voxels;
[0042] Step S1142: Divide the plane point cloud into corresponding voxel blocks; traverse each point in the plane point cloud and determine the voxel block to which it belongs based on the coordinates of the point; map the coordinates of the point to the voxel block, each voxel block contains points within a set range.
[0043] Step S1143: Process the points in each voxel block and select a method for representing the points as needed; for each non-empty voxel block, use the centroid to replace the point set in the voxel block;
[0044] Step S1144: generating a new point cloud data set according to the processing results; the new point cloud data set will contain fewer points while retaining the main features of the original point cloud as much as possible;
[0045] Step S1145: Output the point cloud data set processed by the uniform voxel filter as input for subsequent processing steps.
[0046] Furthermore, in step S2, the identification and optimization process of the uneven point cloud is as follows:
[0047] Step S21: performing coordinate transformation processing on the plane point cloud;
[0048] Step S22: using the eigenvalue method to obtain a local plane normal vector for each point on the plane point cloud;
[0049] Step S23: Compare the change in the angle of the normal vectors of the adjacent local planes with the set threshold to obtain an uneven point cloud and a flat point cloud;
[0050] Step S24: Establish a KD-Tree, calculate the average coordinate value of the flat point cloud within the neighborhood radius of the uneven point cloud, and use it to replace the coordinates of the uneven point cloud to complete a flatness optimization;
[0051] Step S25: Identify uneven point clouds for the plane point cloud that has completed one flatness optimization, and check whether there are uneven point clouds. If there are, continue iterative optimization until the inspection result shows that there are no uneven point clouds or the number of iterations is reached;
[0052] Step S26: Output the optimized point cloud data.
[0053] Furthermore, in step S21, the plane point cloud coordinate conversion process is as follows:
[0054] Step S211: using the eigenvalue method on the plane point cloud to obtain four plane parameters a0, b0, c0, d0;
[0055] Step S212: Calculate the angle between the plane normal vector of the plane point cloud and the Z-axis normal vector and the unit vector of the rotation axis;
[0056] The angle calculation formula is:
[0057]
[0058] The formula for calculating the rotation axis unit vector is:
[0059]
[0060] Among them, A=-d0 / a0, B=-d 0 / b 0 ;
[0061] Step S213: construct a Rodriguez rotation matrix to perform coordinate transformation on the plane point cloud. The formula of the Rodriguez rotation matrix R is:
[0062]
[0063] in, is the angle, is the X-component of the rotation axis unit vector, is the Y-direction component of the rotation axis unit vector, is the Z component of the rotation axis unit vector.
[0064] Furthermore, in step S22, the calculation process of the local plane normal vector is as follows:
[0065] Step S221: Each point in the point cloud The neighborhood point set of , the neighborhood point set includes the point and k neighboring points;
[0066] Step S222: Using the neighborhood point set The eigenvalue method is used to calculate all points in the local plane to obtain the local plane normal vector set ;
[0067] Step S223: The calculated local plane normal vector With point cloud Associated.
[0068] Furthermore, in step S23, the identification process of the uneven point cloud is as follows:
[0069] Step S231: Calculate the angle between the normal vectors of two adjacent planes, that is, the angle between the local plane normal vectors of two adjacent points. The angle calculation formula is as follows:
[0070]
[0071] Get the angle between adjacent planes;
[0072] Step S232: setting a threshold T for the angle to distinguish between a flat point cloud and an uneven point cloud;
[0073] Step S233: Compare the angle between the local plane normal vector of each point and the local plane normal vector of the neighboring point with the threshold T. If the angle If it is greater than or equal to the threshold T, the point is considered to be an uneven point cloud, otherwise it is a flat point cloud;
[0074] Step S234: creating an index list of uneven point clouds according to all points marked as uneven point clouds.
[0075] Furthermore, in step S24, the optimization process of the uneven point cloud is as follows:
[0076] Step S241: establishing a KD-Tree data structure for searching for neighborhood points in the point cloud;
[0077] Step S242: Determine the neighborhood radius R L , the radius defines the range of the search neighborhood;
[0078] Step S243: Use the established KD-Tree and neighborhood radius R L, locate each uneven point cloud in the neighborhood radius R L All flattened point clouds within;
[0079] Step S244: Calculate the neighborhood radius R L The average value of the inner flattened point cloud is as follows:
[0080]
[0081] Where q is the neighborhood radius R L The total number of inner flattened point clouds;
[0082] Step S245: replacing the coordinates of the uneven point cloud with the calculated average coordinates;
[0083] Step S246: Update the point cloud data to obtain the plane point cloud after the first flatness optimization.
[0084] Furthermore, in step S25, the verification and iteration process is as follows:
[0085] In step S25, the verification and iteration process is as follows:
[0086] Step S251: verifying the point cloud data optimized in step S24 by recalculating the local plane normal vector of each point to check whether it meets the requirements;
[0087] Step S252: setting an iteration termination condition, the condition being that no uneven point cloud can be identified or the number of iterations is limited;
[0088] Step S253: If there are any remaining uneven point clouds, repeat the local plane fitting, uneven point cloud identification and optimization process of steps S22 to S24 until the iteration termination condition is met, that is, no new uneven point clouds are identified or the preset number of iterations is reached.
[0089] Compared with the prior art, the present invention has the following advantages: the surface flatness optimization method of the three-dimensional model based on point cloud data can automatically identify uneven areas in the point cloud data, while the prior art often requires manual intervention to identify these areas, which significantly improves efficiency and accuracy; through the optimization algorithm proposed in the present invention, the surface flatness of the point cloud data is optimized, the modeling error caused by surface irregularities is reduced, and the model quality is improved; through the automated identification and optimization process, the dependence on manual operation is reduced, and the error and cost caused by manual operation are reduced; the final output result is easy to integrate with other three-dimensional modeling software and processes, which is convenient for users to carry out subsequent modeling and analysis work; in the digital protection of historical buildings, a more efficient, accurate and automated point cloud data processing method is provided, which provides strong technical support for three-dimensional modeling and historical building research. BRIEF DESCRIPTION OF THE DRAWINGS
[0090] Figure 1 is a schematic flow chart of a method for optimizing surface flatness of a three-dimensional model based on point cloud data in an embodiment of the present invention;
[0091] Figure 2 It is a schematic diagram of the data collection process in an embodiment of the present invention;
[0092] Figure 3 is a schematic diagram of a point cloud data preprocessing process in an embodiment of the present invention;
[0093] Figure 4 It is a schematic diagram of the planar point cloud coordinate conversion and flatness optimization process in an embodiment of the present invention;
[0094] FIG5( a ) is an example diagram of point cloud data before data preprocessing in an embodiment of the present invention;
[0095] FIG5( b ) is an example diagram of point cloud data after data preprocessing in an embodiment of the present invention;
[0096] FIG. 6 ( a ) is an example diagram of point cloud data after coordinate transformation of a plane point cloud in an embodiment of the present invention;
[0097] FIG6( b ) is an example diagram of the first uneven point cloud recognition result of the plane point cloud in an embodiment of the present invention;
[0098] FIG. 7 ( a ) is an example diagram of point cloud data of a plane point cloud optimized 10 times in an embodiment of the present invention;
[0099] FIG. 7( b ) is an example diagram of the 10th uneven point cloud recognition result of the plane point cloud in an embodiment of the present invention. DETAILED DESCRIPTION
[0100] The following is a detailed description of an embodiment of the present invention. This embodiment is implemented on the premise of the technical solution of the present invention, and a detailed implementation method and a specific operation process are given, but the protection scope of the present invention is not limited to the following embodiment.
[0101] like Figure 1 As shown, this embodiment provides a technical solution: a method for optimizing the surface flatness of a three-dimensional model based on point cloud data, comprising the following steps:
[0102] Step 1: Data collection and processing
[0103] According to the pre-planned collection route and collection sequence, the original laser point cloud data of the building is collected, and then the data is pre-processed;
[0104] Step 2: Automatic identification and optimization of uneven point clouds
[0105] The pre-processed point cloud data is subjected to coordinate transformation and feature recognition to obtain an uneven point cloud, which is then automatically optimized for flatness. After multiple optimizations, a flat point cloud is obtained, thus achieving surface flatness optimization of the three-dimensional model based on point cloud data.
[0106] In step 1, the point cloud data collection process is as follows:
[0107] (1) Rationally design and arrange a set number of target control points around the building;
[0108] (2) Use RTK measuring instruments and leveling instruments to obtain the plane coordinates and elevations of the target control points;
[0109] (3) Use a ground-based laser scanning system to obtain the original laser point cloud data of the building;
[0110] (4) Select preset target control points to check the plane and elevation accuracy of the original laser point cloud data of the building.
[0111] In this embodiment, the target control point is a ground truth point or a specific point set manually for positioning and registering the scan data.
[0112] The layout requirements of target control points are as follows:
[0113] Density: The target control points should be evenly distributed in the scanning area to ensure that the entire area can be accurately measured and registered. The density depends on the purpose of the scan and the accuracy requirements.
[0114] Positioning: Target control points should be located at key locations in the scan area, such as ground feature points, intersection points, edges, etc. These points can provide a reference frame to help with registration and positioning;
[0115] Number of target control points: The number of target control points should be sufficient to meet the measurement requirements. Generally, it is recommended to deploy at least 3 target control points to provide sufficient positioning and registration information.
[0116] The accuracy requirements of the target control points are as follows:
[0117] Spatial accuracy: The spatial position of the target control point needs to have high accuracy. Usually, the coordinate accuracy of the target control point is required to be at the millimeter or sub-millimeter level to ensure the accuracy of the scan data;
[0118] In step one, if Figure 3 As shown in Figure 2, the specific process of data preprocessing is as follows:
[0119] The original laser point cloud data of the building is presented in the form of scattered point clouds, and the data volume is large, so it is necessary to remove noise and redundant point cloud data. The point cloud data before and after data preprocessing are shown in Figure 5 (a) and 5 (b), respectively.
[0120] First, statistical filtering is used to remove high-frequency noise points and reduce redundant points. Statistical filtering performs statistical analysis on the neighborhood of each data point to remove obvious outliers. Outliers are often introduced by measurement noise, which is characterized by sparse distribution in space. The average distance from each data point to its nearest k (hypothetical) data points is calculated. The distances of all data points in the point cloud should form a Gaussian distribution. By giving the mean and variance, n standard deviations can be eliminated. Data points outside of .
[0121] In this embodiment, the calculation process of statistical filtering is as follows:
[0122] The neighborhood of each data point is statistically analyzed, and the distances of all data points in the point cloud data are assumed to form a Gaussian distribution, whose shape is determined by the mean and standard deviation Determine; let the coordinates of the nth data point in the point cloud data be , from this data point to any data point The distance is:
[0123]
[0124] The formula for calculating the average distance between each data point and any data point is:
[0125]
[0126] Let the standard deviation be:
[0127]
[0128] Assume that the standard deviation multiple is std. In the process of algorithm implementation, only two thresholds, k and std, need to be input. When the average distance of a point near k points is within the standard range, If it is within the range, the point is retained; if it is not, it is defined as an outlier and deleted.
[0129] Then, the CSF Cloth Simulation Filter (CSF) algorithm is used to separate ground points from non-ground points. The principle of the CSF Cloth Simulation Filter algorithm is to first invert the denoised original laser point cloud data, then project the inverted point cloud data and the cloth nodes simulated by the user onto the same horizontal plane, and find the point corresponding to the cloth node in the point cloud data, and record its height as h; in each iteration, compare the current height of the cloth node and the size of h, until the absolute value of the difference between h and the current height is less than a certain value, or the maximum number of iterations is reached, the iteration is terminated. Finally, the distance between the inverted point cloud data point at the end of the iteration and the cloth node is calculated. When the distance is greater than a specific threshold, the point is recorded as a non-ground point and filtered, otherwise it is recorded as a ground point.
[0130] Then, the RANSAC (Random Sample Consensus) algorithm is used to perform multi-plane segmentation on the point cloud data to obtain the planar point clouds of each face. Its working principle is to build a model by randomly selecting data points, and then evaluate the consistency of other points with the model. The algorithm iterates, trying to build a new model each time, and determines the effectiveness of the model by counting the number of inliers (points that are very close to the model). After multiple iterations, the model with the most inliers is finally selected as the best fit result, that is, a plane is extracted; for the remaining outliers, the RANSAC plane fitting algorithm is continued to be cycled to extract planes until all planes are extracted. This method can effectively extract accurate geometric planes from complex data sets and shows good robustness even in the case of poor data quality.
[0131] Finally, due to the high density of the point cloud, the plane point cloud is downsampled using uniform voxel filtering to obtain the plane point cloud to be detected. This method divides the point cloud into regular voxel blocks, each of which represents a volume unit in the point cloud data. In each voxel block, a representative point (the average position of all points in the voxel block, i.e., the centroid) is selected and retained, while other points are ignored, thereby simplifying the data. Through uniform voxel filtering, the points in the dense area of the point cloud are effectively reduced, while the overall shape and surface features of the point cloud are retained at the voxel scale, which can significantly improve the computational efficiency of subsequent processing steps and reduce storage requirements.
[0132] It should be noted that a voxel is a small cube in three-dimensional space. The size of the voxel determines the granularity of the filter. Smaller voxels can retain more details, but the amount of calculation is larger; larger voxels can reduce the number of points, but may lose details.
[0133] In step 2, the specific processing process is as follows:
[0134] (1) Coordinate transformation
[0135] First, the plane point cloud obtained after segmentation is transformed. Since the wall is generally perpendicular to the ground and its orientation is random, the wall point cloud needs to be transformed through the rotation matrix so that the wall normal vector is parallel to the normal vector. The plane parameters are obtained by fitting the eigenvalue normal plane, and then the rotation axis unit vector is calculated, and the Rodriguez rotation matrix is used for coordinate transformation.
[0136] As a more specific example, the plane point cloud coordinate transformation process is as follows:
[0137] 1): Use the eigenvalue method to obtain four plane parameters a0, b0, c0, and d0 for the plane point cloud;
[0138] 2): Calculate the angle between the plane normal vector of the plane point cloud and the Z-axis normal vector and the unit vector of the rotation axis;
[0139] The angle calculation formula is:
[0140]
[0141] The formula for calculating the rotation axis unit vector is:
[0142]
[0143] Among them, A=-d0 / a0, B=-d 0 / b 0 ;
[0144] 3): Construct the Rodriguez rotation matrix to transform the coordinates of the plane point cloud. The formula of the Rodriguez rotation matrix R is:
[0145]
[0146] in, is the angle, is the X-component of the rotation axis unit vector, is the Y-direction component of the rotation axis unit vector, is the Z component of the rotation axis unit vector.
[0147] (2) Calculate the local plane normal vector
[0148] Then, a local plane is fitted for each point in the point cloud. This usually involves selecting a local neighborhood around each point and using the least squares method or other statistical methods to estimate a best-fit plane within this neighborhood. By fitting the resulting plane, we can calculate the local plane normal vector for each point. This normal vector describes the surface orientation of the point cloud at that point and provides a geometric basis for evaluating the flatness of the point cloud.
[0149] As a more specific example, the local plane normal vector is calculated as follows:
[0150] 1): Each point in the point cloud The neighborhood point set of , the neighborhood point set includes the point and k neighboring points;
[0151] 2): Using neighborhood point sets The eigenvalue method is used to calculate all points in the local plane to obtain the local plane normal vector set ;
[0152] 3): The calculated local plane normal vector With point cloud The surface roughness is then correlated for subsequent flatness analysis and optimization.
[0153] (3) Uneven point cloud recognition
[0154] Next, the uneven point cloud is identified by comparing the angle difference between the local plane normal vector of each point and the local plane normal vector of the adjacent points. If the angle between the local plane normal vectors of two adjacent points exceeds the preset threshold, this indicates that there is a significant surface change between the two points, so these points are marked as uneven point clouds. At the same time, those points with smaller angle differences between the local plane normal vectors are considered to be flat point clouds, which will serve as the basis for optimizing the uneven point cloud.
[0155] As a more specific example, the identification process of uneven point clouds is as follows:
[0156] 1): Calculate the angle between the normal vectors of two adjacent planes, that is, the angle between the local plane normal vectors of two adjacent points. The angle calculation formula is as follows:
[0157]
[0158] Then the angle between adjacent planes is obtained;
[0159] 2): Set a threshold T for the angle to distinguish between flat point clouds and uneven point clouds. The threshold T is determined according to the characteristics of the point cloud data and the flatness requirements;
[0160] 3): Compare the angle between the local plane normal vector of each point and the local plane normal vector of the neighboring point with the threshold T. If the angle If it is greater than or equal to the threshold T, the point is considered to be an uneven point cloud, otherwise it is a flat point cloud;
[0161] 4): Identify all points that do not meet the flatness requirements, mark these points as uneven point clouds, and establish an index list of uneven point clouds to prepare for subsequent optimization steps.
[0162] (4) Flatness optimization
[0163] For each point identified as an uneven point cloud, a KD-Tree data structure is established to efficiently search for a flat point cloud within its neighborhood. KD-Tree is a data structure used for multidimensional space search, which can quickly locate points around uneven point clouds. Within a certain neighborhood radius, the coordinate average of all flat point clouds is calculated. This coordinate average is obtained by accumulating the coordinates of all flat point clouds in the neighborhood and dividing by the number of points. The calculated coordinate average is used to replace the original coordinates of the uneven point cloud, so that the position of the uneven point cloud in space is smoothed by the features of the flat area around it.
[0164] As more specific, the optimization process of the uneven point cloud is as follows:
[0165] 1): Establish a KD-Tree data structure to efficiently search for neighborhood points in the point cloud;
[0166] 2): Determine the neighborhood radius R L , which defines the range of the search neighborhood. The neighborhood radius R L The choice of is based on the expected degree of surface variation and the local characteristics of the point cloud;
[0167] 3): Use the established KD-Tree and neighborhood radius R L , locate each uneven point cloud in the neighborhood radius R L All flattened point clouds within;
[0168] 4): Calculate the neighborhood radius R L The coordinate average of the internal flattened point cloud is as follows:
[0169]
[0170] Where q is the neighborhood radius R L The total number of inner flattened point clouds;
[0171] 5): Replace the coordinates of the uneven point cloud with the calculated average coordinates;
[0172] 6): Update the point cloud data to obtain the plane point cloud after the first flatness optimization.
[0173] (5) Verify and iterate optimization
[0174] After a flatness optimization is completed, the point cloud needs to be re-evaluated to determine if there are any remaining uneven points. This step is critical because it ensures the thoroughness of the optimization process. If new uneven points are found during the re-evaluation, the algorithm will repeat the flatness optimization step for these points. This process will be iterated until no new uneven points are identified or the preset number of iterations is reached.
[0175] More specifically, the verification and iteration process is as follows:
[0176] 1): Verify the optimized point cloud data by recalculating the local plane normal vector of each point to check whether it meets the requirements; check whether there is an uneven point cloud. If there is a small amount of uneven point cloud (the number is set according to the actual application) or no uneven point cloud, the requirements are met;
[0177] 2): Set an iteration termination condition, which is that the uneven point cloud cannot be identified, or limit the number of iterations to ensure the efficiency and effectiveness of the algorithm and prevent infinite loops;
[0178] 3): If there are any remaining uneven point clouds, repeat the local plane fitting, uneven point cloud identification and optimization process until the iteration termination condition is met, that is, no new uneven point clouds are identified or the preset number of iterations is reached.
[0179] (6) Output optimized point cloud data
[0180] Finally, after a series of optimization iterations, the optimized point cloud data is output. These data have higher surface smoothness while retaining the important features of the historical buildings. The optimized point cloud data can be used as input for 3D modeling, providing a high-quality data foundation for creating accurate digital models.
[0181] In summary, the surface flatness optimization method of a three-dimensional model based on point cloud data proposed in the present invention realizes high-precision three-dimensional data collection of structures such as historical buildings by adopting ground-based LiDAR measurement technology. This method is particularly suitable for processing dense point cloud data obtained by ground-based LiDAR scanning, and can effectively identify and optimize uneven areas in the data, thereby improving the accuracy and efficiency of subsequent three-dimensional modeling.
[0182] Ground-based LiDAR measurement technology can fully capture hard-to-reach areas such as the bottom and corners of buildings by deploying laser scanning equipment on the ground, generating detailed point clouds. The method of the present invention conducts in-depth analysis of these point cloud data, automatically identifies areas that need to be optimized, and uses efficient algorithms to optimize flatness, ensuring the automation and intelligence of the optimization process.
[0183] The optimized data not only improves the surface flatness, but also retains the characteristic details of the building, providing high-quality input for 3D digital modeling. The application of this method has significantly improved the quality and efficiency of digital protection of historical buildings, and provided strong technical support for the protection, restoration and research of architectural heritage.
[0184] In addition, the method of the present invention is highly adaptable and flexible, and parameters can be adjusted according to the specific needs of different projects to adapt to different scanning environments and data characteristics. Through this method, rapid and accurate 3D modeling of buildings of various types and sizes can be achieved, providing a valuable tool for urban planning, architectural protection, and cultural heritage.
[0185] Although the embodiments of the present invention have been shown and described above, it is to be understood that the above embodiments are exemplary and are not to be construed as limitations of the present invention. A person skilled in the art may change, modify, replace and vary the above embodiments within the scope of the present invention.
Claims
1. A method for optimizing the surface flatness of a three-dimensional model based on point cloud data, characterized in that: The following steps are involved: Step S1: Data collection and processing According to the pre-planned collection route and collection sequence, the original laser point cloud data of the building is collected, and then the data is pre-processed; Step S2: Identification and optimization of uneven point clouds The pre-processed point cloud data is subjected to coordinate transformation and feature recognition to obtain an uneven point cloud, which is then optimized for flatness. After multiple optimizations, a flat point cloud is obtained to achieve surface flatness optimization of the three-dimensional model based on point cloud data. In step S2, the identification and optimization process of the uneven point cloud is as follows: Step S21: performing coordinate transformation processing on the plane point cloud; Step S22: using the eigenvalue method to obtain the local plane normal vector for each point on the plane point cloud; Step S23: Compare the change in the angle of the normal vectors of the adjacent local planes with the set threshold to obtain an uneven point cloud and a flat point cloud; Step S24: Establish a KD-Tree, calculate the average coordinate value of the flat point cloud within the neighborhood radius of the uneven point cloud, and use it to replace the coordinates of the uneven point cloud to complete a flatness optimization; Step S25: Identify uneven point clouds for the plane point cloud that has completed one flatness optimization, and check whether there are uneven point clouds. If there are, continue iterative optimization until the inspection result shows that there are no uneven point clouds or the number of iterations is reached; Step S26: outputting optimized point cloud data; In step S24, the optimization process of the uneven point cloud is as follows: Step S241: establishing a KD-Tree data structure for searching for neighborhood points in the point cloud; Step S242: Determine the neighborhood radius R L , the radius defines the scope of the search neighborhood; Step S243: Use the established KD-Tree and neighborhood radius R L , locate each uneven point cloud in the neighborhood radius R L All flattened point clouds within; Step S244: Calculate the neighborhood radius R L The average value of the inner flattened point cloud is as follows: ; in, q is the neighborhood radius R L The total number of inner flattened point clouds; Step S245: replacing the coordinates of the uneven point cloud with the calculated average coordinates; Step S246: Update the point cloud data to obtain the plane point cloud after the first flatness optimization.
2. The method for optimizing the surface flatness of a three-dimensional model based on point cloud data according to claim 1, characterized in that: In step S1, the process of collecting the original laser point cloud data of the building is as follows: Step 2 S101: Arrange a set number of target control points around the building; Step S102: using an RTK measuring instrument and a leveling measuring instrument to obtain the plane coordinates and elevation of the target control point; Step S103: using a ground-based laser scanning system to obtain original laser point cloud data of the building; Step S104: Select preset target control points to check the plane and elevation accuracy of the original laser point cloud data.
3. The method for optimizing the surface flatness of a three-dimensional model based on point cloud data according to claim 2, characterized in that: In step S1, the data preprocessing process is as follows: Step S111: using statistical filtering to remove high-frequency noise points in the original laser point cloud data of the building; Step S112: using CSF simulated cloth filtering algorithm to separate ground points and non-ground points; Step S113: using the RANSAC algorithm to perform multi-plane segmentation processing on the point cloud data to obtain the plane point clouds of each surface; Step S114: down-sampling the plane point cloud using a uniform voxel filter to obtain the plane point cloud to be detected, that is, to obtain pre-processed point cloud data.
4. The method for optimizing the surface flatness of a three-dimensional model based on point cloud data according to claim 1, characterized in that: In step S21, the plane point cloud coordinate conversion process is as follows: Step S211: Use the eigenvalue method to obtain four plane parameters on the plane point cloud a 0 , b 0 , c 0 , d 0 ; Step S212: Calculate the angle between the plane normal vector of the plane point cloud and the Z-axis normal vector and the unit vector of the rotation axis; The angle calculation formula is: ; The formula for calculating the rotation axis unit vector is: ; in, A =- d 0 / a 0 , B=-d 0 / b 0 ; Step S213: construct a Rodriguez rotation matrix to perform coordinate transformation on the plane point cloud.
5. The method for optimizing the surface flatness of a three-dimensional model based on point cloud data according to claim 4, characterized in that: In step S213, the Rodriguez rotation matrix The formula is: ; in, is the angle, is the X-component of the rotation axis unit vector, is the Y-direction component of the rotation axis unit vector, is the Z component of the rotation axis unit vector.
6. The method for optimizing the surface flatness of a three-dimensional model based on point cloud data according to claim 1, characterized in that: In step S22, the calculation process of the local plane normal vector is as follows: Step S221: Each point in the point cloud The neighborhood point set of , the neighborhood point set includes the point and k neighboring points; Step S222: Using the neighborhood point set The eigenvalue method is used to calculate all points in the local plane to obtain the local plane normal vector set ; Step S223: The calculated local plane normal vector With point cloud Associated.
7. The method for optimizing the surface flatness of a three-dimensional model based on point cloud data according to claim 1, characterized in that: In step S23, the identification process of the uneven point cloud is as follows: Step S231: Calculate the angle between the normal vectors of two adjacent planes, that is, the angle between the local plane normal vectors of two adjacent points. The angle calculation formula is as follows: ; Get the angle between adjacent planes; Step S232: setting a threshold T for the angle to distinguish between a flat point cloud and an uneven point cloud; Step S233: Compare the angle between the local plane normal vector of each point and the local plane normal vector of the neighboring point with the threshold T. If the angle If it is greater than or equal to the threshold T, the point is considered to be an uneven point cloud, otherwise it is a flat point cloud; Step S234: creating an index list of uneven point clouds according to all points marked as uneven point clouds.
8. The method for optimizing the surface flatness of a three-dimensional model based on point cloud data according to claim 1, characterized in that: In step S25, the verification and iteration process is as follows: Step S251: verifying the point cloud data optimized in step S24 by recalculating the local plane normal vector of each point to check whether it meets the requirements; Step S252: setting an iteration termination condition, the condition being that no uneven point cloud can be identified or the number of iterations is limited; Step S253: If there are any remaining uneven point clouds, repeat the local plane fitting, uneven point cloud identification and optimization process of steps S22 to S24 until the iteration termination condition is met, that is, no new uneven point clouds are identified or the preset number of iterations is reached.
