Curved surface part automatic modeling method based on point cloud data

By constructing the objective function and Poisson model combined with the genetic algorithm optimization parameters, automated surface part modeling based on point cloud data is realized, which solves the problem of cumbersome human operations in the existing technology, and improves the efficiency and accuracy of model generation.

CN120372844APending Publication Date: 2025-07-25JILIN UNIVERSITY
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510354595.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-25
Publication Date
2025-07-25

AI Technical Summary

Technical Problem

The existing inverse software requires manual operation in the process of generating surfaces, which is large in workload and is not automated enough, making it difficult to efficiently generate high-quality surface models.

Method used

By constructing the objective function to optimize the preprocessing parameters and modeling parameters of point cloud data, the surface reconstruction is carried out using the Poisson model, and the parameters are optimized by the genetic algorithm to realize automated surface part modeling.

Benefits of technology

Automatic model reconstruction without human operation is realized, ensuring the accuracy of the part model and improving the generation efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120372844A_ABST
    Figure CN120372844A_ABST
Patent Text Reader

Abstract

The invention discloses an automatic curved surface part modeling method based on point cloud data, which comprises the following steps: step 1, obtaining point cloud data of a to-be-modeled part through a point cloud scanner, and generating a point cloud data scatter diagram by using the point cloud data; step 2, constructing an objective function, and optimizing the point cloud data preprocessing parameters and modeling parameters according to the objective function to obtain optimal point cloud data preprocessing parameters and optimal modeling parameters; the target function is # imgabs0 #, and # imgabs1 #; step 3, preprocessing the point cloud data scatter diagram according to optimal point cloud data preprocessing parameters to obtain an optimal point cloud data scatter diagram; and 4, carrying out surface reconstruction on the optimal point cloud data scatter diagram according to the optimal modeling parameters by utilizing a Poisson model to obtain a part curved surface model.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of reverse engineering, and particularly relates to an automatic modeling method for surface parts based on point cloud data. Background Art

[0002] The applications of reverse engineering mainly focus on the development of mold samples. In particular, enterprises that produce various automotive and toy accessories often need to manufacture molds or directly machine products based on the sample parts provided by customers. The reverse engineering software system is the core part of reverse engineering technology. It processes the point cloud data obtained by measuring the sample part model to generate curve and surface models with high quality. Reverse engineering technology has now been widely applied to product replication, imitation, improvement, and innovative design. Using reverse engineering technology, it is possible to directly perform structural performance analysis, reconstruct design models, optimize and manufacture redesigned products on the basis of existing advanced products, absorb and improve foreign advanced products and technologies, shorten the product cycle, and more importantly, quickly catch up with the world's advanced production technology and effectively occupy the market. The reverse engineering software system has become a link connecting various advanced technologies in the new product development process, an important technical means to digest and absorb advanced technologies and achieve rapid development of new products.

[0003] Although the current mainstream reverse engineering software can process point cloud data well to generate complex surfaces, manual operation and identification are still required during the surface generation process, which is not a pure automated process, and the workload is very large when reconstructing multiple surfaces. Summary of the Invention

[0004] The purpose of the present invention is to provide an automatic modeling method for surface parts based on point cloud data, which realizes automatic model reconstruction of point cloud data by reasonably setting the modeling method, can ensure the accuracy of the reconstructed part model, and improve the generation efficiency of the model.

[0005] The technical solution provided by the present invention is as follows:

[0006] An automatic modeling method for surface parts based on point cloud data, comprising the following steps:

[0007] Step 1: Obtain the point cloud data of the part to be modeled through a point cloud scanner, and generate a scatter plot of the point cloud data using the point cloud data;

[0008] Step 2: Construct an objective function, and optimize the point cloud data preprocessing parameters and modeling parameters according to the objective function to obtain the optimal point cloud data preprocessing parameters and optimal modeling parameters;

[0009] The objective function is:

[0010] Wherein,

[0011] In the formula, L represents the average value of the normal distance from the points in the point cloud data scatter plot to the reconstructed surface of the point cloud data, N represents the number of points in the point cloud data scatter plot, p i represents the coordinates of point i in the point cloud data scatter plot, V represents the set of vertices of the reconstructed surface of the point cloud data, and v j is the coordinates of point j in the set of surface vertices; d(p i , V) represents the approximate normal distance from point i in the point cloud data scatter plot to the reconstructed surface of the point cloud data, and ∥·∥2 represents the Euclidean norm;

[0012] Step 3: Preprocess the point cloud data scatter plot according to the optimal point cloud data preprocessing parameters to obtain the optimal point cloud data scatter plot;

[0013] Step 4: Use the Poisson model to perform surface reconstruction on the optimal point cloud data scatter plot according to the optimal modeling parameters to obtain the part surface model.

[0014] Preferably, in Step 1, the PCDreader class in the PCL library is used to read the point cloud data of the part to be modeled and generate a point cloud data scatter plot.

[0015] Preferably, the preprocessing method for the point cloud data scatter plot includes: denoising, downsampling, and smoothing.

[0016] Preferably, the statistical outlier removal method is used to denoise the point cloud data scatter plot; the VoxelGrid filter in the PCL library is used to downsample the point cloud data scatter plot.

[0017] Preferably, the point cloud data preprocessing parameters include:

[0018] The average number of points in the denoising neighborhood and the standard deviation multiplier threshold during the denoising process, and the voxel side length of the voxel downsampling during the downsampling process.

[0019] Preferably, the modeling parameters include:

[0020] The octree depth of the Poisson model, the minimum number of samples per octree node, and the isosurface subdivision accuracy.

[0021] Preferably, the MLS moving least squares method is used to smooth the point cloud data.

[0022] Preferably, the genetic algorithm is used to optimize the point cloud data preprocessing parameters and the modeling parameters, including the following steps:

[0023] Step 1: Randomly initialize the population;

[0024] Among them, the individuals in the population are vectors composed of point cloud data preprocessing parameters and modeling parameters, and each individual corresponds to a reconstructed surface of point cloud data.

[0025] Step 2: Calculate the fitness of each individual in the current population.

[0026]

[0027] Among them,

[0028] In the formula, f x represents the fitness of individual x in the population, N represents the number of points in the scatter plot of point cloud data, p i represents the coordinates of point i in the scatter plot of point cloud data, V x represents the set of vertices of the reconstructed surface of the point cloud data corresponding to individual x in the population; v j is the coordinates of point j in the set of surface vertices; d(p i , V x ) represents the approximate normal distance from point i in the scatter plot of point cloud data to the reconstructed surface of the point cloud data, and ∥·∥2 represents the Euclidean norm.

[0029] Step 3: Select the individuals with small fitness in the population as the parents, and use the parents to generate the next generation population through crossover and mutation.

[0030] Step 4: Loop through Steps 2 - 3 until the maximum number of iterations is reached; select the point cloud data preprocessing parameters and modeling parameters corresponding to the individual with the smallest fitness as the optimal point cloud data preprocessing parameters and the optimal modeling parameters.

[0031] The beneficial effects of the present invention are:

[0032] The automatic modeling method for surface parts based on point cloud data provided by the present invention realizes the automatic model reconstruction of point cloud data by reasonably setting the modeling method, without the need for manual operation of reverse software to process the point cloud data, which can ensure the accuracy of the reconstructed part model and improve the model generation efficiency. Description of the Drawings

[0033] Figure 1 is the flowchart of the automatic modeling method for surface parts based on point cloud data described in the present invention.

[0034] Figure 2 is the scatter plot of the point cloud data of the outer panel of an automotive engine generated in the embodiment of the present invention.

[0035] Figure 3 is the reconstructed surface model diagram of the outer panel of the automotive engine hood in the embodiment of the present invention. Detailed Embodiments

[0036] The present invention will be further described in detail below with reference to the accompanying drawings, so that those skilled in the art can implement it according to the description in the specification.

[0037] The present invention provides an automatic modeling method for curved surface parts based on point cloud data. It breaks away from the existing reverse technology and does not require manual processing of point cloud data (such as removing noise points or filling missing points, etc.) and surface reconstruction. Instead, the computer directly processes and recognizes the point cloud data to generate complex curved surfaces.

[0038] As Figure 1 shown, the specific implementation process of the automatic modeling method for curved surface parts based on point cloud data provided by the present invention is as follows.

[0039] First, obtain the point cloud data of the part to be modeled through a point cloud scanner. Use the PCD reader class in the PCL library to read the point cloud data of the part to be modeled, generate a point cloud data scatter plot, and then create a PointCloud object to store the point cloud data. Use the PointXYZ method to specify that the data type of the scatter points is in the form of XYZ coordinates for subsequent processing.

[0040] Second, preprocess the point cloud data

[0041] Since the point cloud data of the part to be modeled is from a point cloud scanner, the point cloud quality is not very high. The point cloud data may have noise and missing parts, which will seriously affect the reconstruction accuracy and integrity. Therefore, it is necessary to preprocess the point cloud data.

[0042] Preprocessing is an important link in the point cloud processing flow. It involves operations such as denoising, downsampling, and smoothing, aiming to improve the quality of point cloud data and reduce the computational complexity of subsequent processing. These preprocessing steps provide a more reliable and efficient data basis for subsequent analysis, modeling, and visualization tasks.

[0043] (1) Denoising processing

[0044] As a preference, the present invention uses a statistical outlier removal method to denoise point cloud data. The point cloud data of the part to be modeled may be affected by various factors during the acquisition process, such as surface reflection, environmental interference, equipment accuracy issues, etc., generating some isolated noise points. These noise points usually do not conform to the local geometric laws of the surrounding point cloud and can be detected by statistical methods. The statistical outlier removal method calculates the distance between each point and its neighboring points, identifies and removes isolated noise points that are significantly different from the surrounding points, and is very effective in eliminating abnormal points caused by sensor errors, surface reflections, etc. And because some parts to be modeled (such as the outer panel of the car engine hood) have smooth curved surfaces and complex geometric features, if the point cloud is over-smoothed during the denoising process, these important geometric features may be damaged. However, the statistical outlier removal method removes noise points based on the statistical information of the local neighborhood rather than global smoothing, so it will not affect the local geometric features of the point cloud and can retain complex surface details. In addition, due to the structural characteristics of some parts to be modeled (such as the outer panel of the car engine hood), the point cloud data usually has different point densities in different regions. Some regions may have a relatively dense point cloud (flat regions, curved surface regions, or regions close to the sensor), while other regions may be relatively sparse (regions with complex details). The statistical outlier removal method can adaptively remove noise points according to the neighborhood density of each point. By setting the average number of points k in the denoising neighborhood, the valid points in the dense region will not be removed, while the noise points in the sparse region can be effectively identified and removed. The high efficiency, parameter flexibility, and adjustability of the statistical outlier removal method are more rapid and convenient when processing high-precision and high-density point cloud data of parts to be modeled.

[0045] The statistical outlier removal method identifies and removes outliers by calculating the average distance between each point and the points within its neighborhood and based on the standard deviation of this average distance. It calculates the average distance between each point and its k nearest neighboring points and sets a standard deviation multiplier threshold based on the standard deviation of this average distance. If the average distance of a point to its k nearest neighboring points is greater than this standard deviation multiplier threshold (a certain multiple of the standard deviation of the average distance), then this point is considered an outlier (i.e., a noise point) and is removed.

[0046]

[0047] Where p i represents the coordinates of point i in the scatter plot of the point cloud data, p ij represents the coordinates of the k nearest points to point i, k represents the average number of points in the denoising neighborhood, and d j represents the average distance between point i and its k nearest neighboring points.

[0048] (2) Downsampling processing

[0049] Downsampling is a crucial step that can reduce the number of data points, thus accelerating the subsequent data processing and analysis process while maintaining the representativeness of the data. The point cloud data of the part to be modeled is very dense, containing a large number of sampling points, with complex geometric structure features and a huge amount of data. Directly processing these dense point clouds will result in a very large computational overhead and affect the efficiency.

[0050] As a preference, the present invention uses the VoxelGrid filter (voxel grid filter) in the PCL library to downsample the point cloud data. The VoxelGrid filter reduces the resolution of the point cloud and the number of points, thereby reducing the computational amount during subsequent processing. And during the downsampling process, it can still maintain the local structure of the point cloud. The principle of the VoxelGrid filter is to divide the point cloud data into three-dimensional "voxels" (or "volume elements"). Each voxel is a small three-dimensional cube. The choice of the side length of the voxel cube is directly related to the degree of downsampling. The larger the side length, the fewer the voxels, the sparser the point cloud, and the faster the processing speed, but details may be lost; on the contrary, a small side length retains more details, but the computational amount increases. Therefore, this parameter needs to be balanced between efficiency and accuracy. The filter replaces all the points within each voxel with a representative point, usually the centroid of the voxel. In this way, we can significantly reduce the data volume of the point cloud while maintaining the integrity of its shape and features.

[0051] (3) Smoothing processing

[0052] Even though the point cloud data has been preliminarily denoised, it may still be affected by noise. Therefore, it is necessary to perform smoothing processing on the denoised point cloud data.

[0053] As a preference, the present invention uses the MLS (Moving Least Squares) method to smooth the point cloud data. The MLS method finds the optimal plane or surface fitting in the region by performing weighted least squares fitting on the neighborhood near each point, which can effectively eliminate isolated noise points and make the data points tend to the true geometric shape of the local surface or plane, thus realizing the smoothing process. This local fitting operation uses the information of the neighborhood near each point to fit a smoother local surface without destroying the original geometric features. Therefore, it can smooth the surface details, further remove noise, and at the same time, try to retain the original geometric information such as surface features and edges. The MLS method is also an adaptive smoothing method that can automatically adjust the smoothing degree according to the local density and geometric shape of the point cloud. For regions with different densities, the MLS method can adaptively perform smoothing processing according to the local distribution of the point cloud without causing unnecessary influence on the dense regions or detailed parts in the point cloud. It avoids the "over-smoothing" problem in traditional smoothing methods. For example, for the outer panel surface and edge parts, the MLS method will perform weighted fitting according to the distribution of neighborhood points, so that the smoothing process will not affect these details. For the point cloud data of some parts to be modeled (such as the outer panel of the car engine hood), there may be small undulations or irregularities on the point cloud surface, especially where the sensor error is large. These irregularities may affect the subsequent point cloud processing steps. The MLS method can reduce the fluctuations and irregularities on the point cloud surface by smoothing the local area, making the point cloud smoother and more continuous, which is beneficial to subsequent geometric reconstruction and surface fitting.

[0054] III. Poisson Surface Reconstruction

[0055] After the point cloud preprocessing, the Poisson algorithm is used to reconstruct the surface. The application of the Poisson algorithm in surface reconstruction, especially for the point cloud data of complex surface parts, has important technical effects and advantages. First of all, the Poisson algorithm can generate a smooth and continuous surface by using the normal vector information in the point cloud, which is crucial for parts with high surface flatness requirements. By solving the Laplace equation, the Poisson algorithm can effectively remove the noise and irregularities in the point cloud data of the parts to be modeled and generate a high-precision surface model to ensure that the reconstruction result is consistent with the original data.

[0056] In addition, the Poisson algorithm can effectively process sparse and incomplete point cloud data and generate a continuous surface through global optimization, so as to adapt to the complex geometric shape of the outer panel of the engine hood. Moreover, the efficient calculation characteristics of the Poisson algorithm enable it to maintain high speed and accuracy when processing large-scale point cloud data, improving the work efficiency in practical applications.

[0057] The following is the mathematical principle of Poisson surface reconstruction:

[0058] (1) Laplace Equation: The core idea of Poisson reconstruction is to achieve surface reconstruction by solving the Laplace equation. The Laplace equation describes the divergence of the gradient of a field, and its general form is:

[0059]

[0060] where Δ is the Laplace operator and f is the field to be solved. In Poisson reconstruction, f corresponds to the normal vector of the surface.

[0061] (2) Poisson Equation: By discretizing the Laplace equation and dealing with appropriate boundary conditions, the Poisson equation can be obtained:

[0062]

[0063] where φ is the scalar field to be solved and M is the known normal vector field.

[0064] (3) Solving the Poisson Equation

[0065] (4) Boundary Condition Handling: To make the Poisson equation have a unique solution, appropriate boundary conditions need to be handled.

[0066] The following is the specific implementation process:

[0067] 1) Create a Poisson surface reconstruction object:

[0068] Use the PCL library to create a Poisson surface reconstruction object for performing subsequent reconstruction operations.

[0069] Set the reconstruction parameters:

[0070] Set the reconstruction depth. The reconstruction depth determines the resolution of the voxel grid and the fineness of the reconstructed surface. The required reconstruction accuracy in this invention is relatively high and the point cloud data volume is large, so the reconstruction depth is set to 8 - 12. Set the number of samples per leaf node. The number of samples per leaf node affects the retention of surface details. If the surface details of the part to be modeled are more, it is set to 5 - 8. Set the number of points of the output grid. The number of grid points determines the accuracy of the output grid. A higher value will generate a higher - accuracy grid, but an overly large value will affect the calculation efficiency, so it is set to 8 - 16.

[0071] Set the input point cloud:

[0072] Pass the pre - processed point cloud data as the input of the Poisson reconstruction algorithm to the reconstruction object.

[0073] Execute surface reconstruction:

[0074] This process converts the point cloud data into a voxel representation by calling a reconstruction object and uses the Poisson equation to reconstruct the surface. Surface reconstruction is performed on the input point cloud, and the result of the reconstruction is a polygon mesh that represents the smooth surface of the object represented by the input point cloud data.

[0075] Save the reconstruction result:

[0076] Saving the reconstructed polygon mesh in the OBJ file format will convert the above-mentioned reconstructed polygon mesh into a triangle mesh, ensuring compatibility with various 3D rendering tools and software and making the calculation and rendering more efficient.

[0077] Package the above point cloud preprocessing algorithm and Poisson algorithm into a custom function for convenient subsequent call by the genetic algorithm optimization.

[0078] IV. Solving the best surface

[0079] The present invention evaluates the quality of the surface generated by the Poisson algorithm by customizing a function. This function reads the original point cloud data and the OBJ file after surface reconstruction and calculates the average normal distance from the points in the point cloud to the generated surface. The smaller the value of the average normal distance, the better the quality of the generated surface.

[0080] First, define a point cloud object and a triangle mesh object to read the point cloud and triangle mesh data.

[0081] At this time, the points in the point cloud data and the vertices of the triangle mesh data do not have specific coordinate numerical representations and the data volume is large, which is not conducive to subsequent calculations. The NumPy library can provide efficient numerical calculation functions and is very suitable for calculating point clouds with a large amount of data. And NumPy arrays can store the x, y, and z coordinates of points. Therefore, use the methods in the library to convert the read point cloud data and surface data into NumPy arrays. After the conversion, the shapes of the point cloud and the mesh become '(N,3)' and '(M,3)', where N and M are the total number of points in the point cloud data and the total number of vertices in the mesh respectively, and each row contains three floating-point numbers to represent the x, y, and z coordinates of the point cloud and triangle mesh vertices. The specific coordinate representation provides great convenience for subsequent distance calculations.

[0082] Next, perform a region search for each point in the point cloud to find the closest surface vertex to that point. When dealing with a large amount of spatial data and the need for frequent nearest neighbor searches, using a KD - tree can provide significant performance advantages. A KD - tree is a data structure in a multi - dimensional space that can effectively support operations such as nearest neighbor search and range search. It stores point data by recursively dividing the space into smaller regions. This division method enables the nearest neighbor search to be completed in logarithmic time because each search iteratively traverses the tree downward according to the position of the query point, only searching the partial subtree closest to the query point.

[0083] The present invention uses a data structure 'cKDTree' provided by the SciPy library to construct a KD - tree, taking the surface vertex data as the input of the KD - tree. The process of constructing the KD - tree hierarchically organizes the surface vertices according to their spatial positions to quickly find the surface vertex closest to the points in the point cloud. For each point in the point cloud, start from the root node of the KD - tree and recursively traverse the KD - tree downward. At each node, according to the splitting dimension of the current node, decide whether to move to the left subtree or the right subtree. Based on the position relationship between the query point and the node splitting hyperplane, determine which side of the current node the query point should be on. If the query point is on the left side of the splitting hyperplane, continue the search in the left subtree; otherwise, search in the right subtree. When reaching the leaf node, stop the downward search. Start the backtracking process, return upward along the search path, and check whether each node may contain a closer neighbor. During the backtracking process, calculate the actual distance from each surface vertex to the point in the point cloud using the x, y, z coordinates of the point in the point cloud and the surface vertex. If a closer point is found, update the distance and index of the nearest neighbor and return. This distance can be approximately regarded as the normal distance from a point in the point cloud to the surface.

[0084] Define an array to store the normal distances from each point in the point cloud to the surface, and then the normal distances from all points in the point cloud to the surface are obtained. For each point, define its approximate normal distance to the surface as:

[0085]

[0086] where p i represents the coordinates of point i in the scatter plot of the point cloud data, V represents the set of surface vertices of the point cloud data reconstruction, and v j is the coordinates of point j in the set of surface vertices; d(p i , V) represents the approximate normal distance from point i in the scatter plot of the point cloud data to the surface of the point cloud data reconstruction, ∥·∥2 represents the Euclidean norm;

[0087] Calculate the average value of the normal distances from all points in the point cloud to the surface for this array. This value reflects the fitting degree between the point cloud and the surface and can be used as an index to evaluate the surface quality.

[0088]

[0089] Among them, L represents the average value of the normal distance from the points in the point cloud data scatter plot to the reconstructed surface of the point cloud data, and N represents the number of points in the point cloud data scatter plot. The smaller the value of L, the higher the fitting degree, the better the reconstruction effect, and the better the surface quality.

[0090] By calling the surface quality quantization function in the surface reconstruction function, the surface quality under the current point cloud preprocessing parameters and Poisson algorithm parameters can be obtained. Thus, the objective of the present invention is transformed into finding a set of point cloud preprocessing parameters and Poisson reconstruction algorithm parameters to minimize the average normal distance from the points in all point clouds to the surface, that is, to minimize the value of L, and further to make the quality of the reconstructed mesh surface the best.

[0091] Preferably, the average number of points k in the denoising field, the standard deviation multiplier threshold t, the voxel side length l of voxel downsampling, the octree depth de of Poisson reconstruction, the minimum number of samples n of each octree node, and the isosurface subdivision accuracy di are used as the parameters to be optimized.

[0092] As a preference, the present invention uses a standard genetic algorithm to achieve this goal.

[0093] The genetic algorithm simulates the process of natural selection. Through the selection operation, a part of the individuals with better fitness in the current population are selected as the parent generation for generating the next generation. Subsequently, the crossover and mutation in the biological genetic process are simulated. Through continuous iterative evolution, the genetic algorithm will gradually optimize the individuals in the surface to a state with higher fitness.

[0094] An individual in the genetic algorithm is usually represented as a chromosome, which can be in the form of a binary string, a real number vector, a permutation, etc. Let the chromosome x be a representation of a solution, where x = (x1, x2,..., xn), and x1, x2,..., xn are the genes on the chromosome. In the present invention, the individual of the genetic algorithm is set as a vector composed of the point cloud data preprocessing parameters and the modeling parameters, and each individual can correspondingly obtain a reconstructed surface of the point cloud data.

[0095] Step 3: Select the individuals with small fitness in the population as the parent generation, and use the parent generation to generate the next generation population through crossover and mutation;

[0096] Step 4: Loop through Step 2 - Step 3 until the maximum number of iterations is reached; select the point cloud data preprocessing parameters and the modeling parameters corresponding to the individual with the smallest fitness as the optimal point cloud data preprocessing parameters and the optimal modeling parameters.

[0097] Fitness function f xIt is used to evaluate the quality of chromosome (individual) x, which is usually the objective function of the problem to be optimized. During the optimization process, the present invention selects the surface quality quantization function as the fitness function of the genetic algorithm to minimize the average distance from the point cloud to the reconstructed surface.

[0098] That is, let:

[0099] Among them,

[0100] In the formula, f x represents the fitness of individual x in the population, N represents the number of points in the scatter plot of point cloud data, p i represents the coordinates of point i in the scatter plot of point cloud data, V x represents the set of vertices of the point cloud data reconstructed surface corresponding to individual x in the population; v j is the coordinates of point j in the set of surface vertices; d(p i , V x ) represents the approximate normal distance from point i in the scatter plot of point cloud data to the point cloud data reconstructed surface, and ∥·∥2 represents the Euclidean norm.

[0101] The selection operation selects a part of individuals with low fitness from the current population according to the fitness values of the individuals as the parents for breeding the next generation of individuals. Common selection methods include roulette wheel selection, tournament selection, etc. The present invention selects to use the roulette wheel selection method because the implementation method is relatively simple and only depends on the original fitness value, reducing the complexity of parameter adjustment.

[0102] Then, the selected parents are used to generate the next generation of individuals through crossover and mutation.

[0103] (1) Crossover operation

[0104] The crossover operation simulates crossover in biological inheritance. The selected parent individuals x a and x b generate new individuals x′ through the crossover operation. The present invention uses the uniform crossover method because each parameter in the uniform crossover is independently exchanged according to probability, which is suitable for scenarios with complex solution spaces and no strong correlation between parameters. The formula for the crossover operation can be expressed as:

[0105]

[0106] Among them, Pc is the crossover probability.

[0107] As a preference, the crossover probability of the present invention is selected as 50%, and the parent parameters have an equal chance of being assigned to the offspring, maximizing the randomness of gene mixing and promoting population diversity.

[0108] (2) Mutation operation

[0109] The present invention uses a uniform mutation method to introduce randomness to maintain the diversity of the population. The mutation operation on chromosome x can be expressed as:

[0110]

[0111] where Pm is the mutation probability and Δ is the mutation amount.

[0112] Preferably, in the operation process of the present invention, the mutation rate is set to 0.01 to prevent excessive random perturbation from destroying the effective solution.

[0113] New individuals are generated through crossover and mutation operations, and a part of the individuals in the current population are replaced with the newly generated individuals. In this way, the evolutionary process of one generation is completed.

[0114] The genetic algorithm has an adaptive search ability, can continuously search in the solution space, and tends to a better solution. As the iteration progresses, the population gradually converges to the optimal solution or an approximate optimal solution.

[0115] Based on this, the specific implementation process in the algorithm of the present invention is as follows:

[0116] Define a function as the function name of the genetic algorithm. The parameters of the function include the path of the input point cloud, the population size, the number of population iterations, the population mutation rate, and the population crossover rate.

[0117] The vector composed of the above six parameters, namely the average number of points k in the denoising field, the standard deviation multiplier threshold t, the voxel side length l of voxel downsampling, the octree depth de of Poisson reconstruction, the minimum number of samples n for each octree node, and the isosurface subdivision accuracy di, is used as an individual in the genetic algorithm. Among them, k, t, and l are the parameters of the preprocessing part, and de, n, and di are the parameters of Poisson reconstruction. These six parameters are introduced into the genetic algorithm as a parameter group, and the range of each parameter can be modified according to the actual situation. The upper and lower bounds of the parameters are used to generate random initial individuals and mutation operations. This parameter group is the optimization object of the genetic algorithm.

[0118] Initialize the population: Generate the initial population. For the given population size, generate random parameter group individuals, and the value of each parameter is randomly generated within its defined range.

[0119] Crossover operation: For each pair of parent individuals, determine whether to perform the crossover operation according to the crossover rate. If the crossover operation is triggered, use the crossover function to generate two offspring individuals and add them to the next-generation population. If the crossover operation is not triggered, directly add the parent individuals to the next-generation population.

[0120] Mutation operation: After generating the next generation population, perform the mutation operation on each individual. Through the mutation function, randomly change the parameter values in the individual at a certain mutation rate.

[0121] Evaluate the population: Calculate the fitness value of each individual in the population through the evaluation function.

[0122] Selection operation: Select the parent individuals from the population according to the fitness values of the individuals through the parent selection function.

[0123] Main loop of genetic algorithm: Use the initialized population for iteration. In each generation, evaluate the fitness of the individuals in the population, select the parent individuals for crossover operation to generate the next generation population, and perform mutation on each individual with a certain probability. Finally, find the individual with the best (minimum) fitness in the population by comparing the fitness values as the final result to return, and calculate its specific fitness value.

[0124] Regarding the implementation of the interface, the present invention uses PyQt5 to process the existing code for interface. Finally, there are three buttons in one interface: Generate scatter plot, Point cloud reconstruction, Display reconstruction result, Point cloud preprocessing, and input different parameters, which can respectively implement different functions. Click the Generate scatter plot button, and a three-dimensional scatter image of the point cloud can be generated in the interface, and the image can be dragged and scaled. Click the Point cloud preprocessing button, and the read point cloud data will be preprocessed. When the preprocessing is completed, a prompt box will pop up. Click the Point cloud reconstruction button, and the background algorithm can be called to obtain the reconstructed surface file and save it to the corresponding folder. When the reconstruction is completed, the corresponding prompt information will pop up in the interface; click the Display reconstruction result button, and the reconstruction result file can be selected and displayed using a 3D viewer.

[0125] Embodiment

[0126] In this embodiment, the outer panel of the car engine hood is used as the part to be modeled, and the triangular meshed surface of the engine hood outer panel is reconstructed based on the point cloud data to verify the effectiveness of the present invention.

[0127] First, based on the automatic modeling method of surface parts based on point cloud data provided by the present invention, write a program code of an automatic modeling algorithm for surface based on point cloud data in python.

[0128] Obtain the point cloud data of the car engine hood outer panel through a point cloud scanner, use the PCDreader class in the PCL library to read the point cloud data of the part to be modeled, and click Generate scatter plot to generate a scatter plot of the point cloud data, as Figure 2As shown; during the scanning process, some noise points will inevitably appear. Therefore, preprocess the point cloud. First, input the preset preprocessing parameters on the interface, then click the point cloud preprocessing button to select the input point cloud data, run the algorithm to preprocess the point cloud and save it in the.pcd format to the corresponding folder. Then set the genetic algorithm parameters, including population size, number of iterations, mutation rate, and crossover rate. The Poisson reconstruction algorithm parameters do not need to be input. The genetic algorithm will randomly generate parameter values according to the parameter range and iteratively optimize to find the optimal set of parameters. Click the surface reconstruction button to run the algorithm to generate the optimal surface and save the surface file to the corresponding folder. In this embodiment, the genetic algorithm population is set as: population size 100, number of iterations 300, mutation rate 0.01, and crossover rate 0.7.

[0129] Then click the button to view the reconstruction result, and the reconstructed surface model of the outer panel of the car engine hood can be generated, as Figure 3 shown, which is the final result of the surface reconstruction based on the point cloud data of the outer panel of the car engine hood.

[0130] After calculation, the L value calculated for the surface after the initial point cloud reconstruction (without parameter optimization by the genetic algorithm) is 21.63. After parameter optimization, Figure 3 the L value of the reconstructed surface of the outer panel of the car engine hood obtained in [reference] is 9.7, where L represents the average value of the normal distance from the points in the scatter plot of the point cloud data to the reconstructed surface of the point cloud data; by observation, when the L value is less than 10, the points in the point cloud are basically completely fitted with the reconstructed surface. In the embodiment, the L value is 9.7, indicating that the surface reconstruction effect is good, which proves the effectiveness of the automatic modeling method for surface parts based on point cloud data provided by the present invention.

[0131] Although the embodiments of the present invention have been disclosed as above, it is not limited to only the applications listed in the specification and embodiments. It can be fully applied to various fields suitable for the present invention. For those familiar with the field, additional modifications can be easily made. Therefore, without departing from the general concept defined by the claims and the equivalent scope, the present invention is not limited to the specific details and the illustrated and described examples here.

Claims

1. An automatic modeling method for surface parts based on point cloud data, characterized in that, It includes the following steps: Step 1: Obtain the point cloud data of the part to be modeled through a point cloud scanner, and generate a point cloud data scatter plot using the point cloud data; Step 2: Construct an objective function, and optimize the point cloud data preprocessing parameters and modeling parameters according to the objective function to obtain the optimal point cloud data preprocessing parameters and optimal modeling parameters; The objective function is as follows: Among them, where, L represents the average of the normal distances from the points in the scatter plot of the point cloud data to the reconstructed surface of the point cloud data, N represents the number of points in the scatter plot of the point cloud data, p i represents the coordinates of point i in the scatter plot of the point cloud data, V represents the set of vertices of the reconstructed surface of the point cloud data, v j is the coordinates of point j in the set of surface vertices; d(p i , V) represents the approximate normal distance from point i in the scatter plot of the point cloud data to the reconstructed surface of the point cloud data, and ∥·∥2 represents the Euclidean norm; Step 3: Preprocess the point cloud data scatter plot according to the optimal point cloud data preprocessing parameters to obtain the optimal point cloud data scatter plot; Step 4: Use the Poisson model to perform surface reconstruction on the optimal point cloud data scatter plot according to the optimal modeling parameters to obtain a part surface model.

2. The automatic modeling method for surface parts based on point cloud data according to claim 1, characterized in that In Step 1, use the PCDreader class in the PCL library to read the point cloud data of the part to be modeled and generate a point cloud data scatter plot.

3. The automatic modeling method for surface parts based on point cloud data according to claim 2, characterized in that The preprocessing methods for the point cloud data scatter plot include: denoising, downsampling, and smoothing.

4. The automatic modeling method for surface parts based on point cloud data according to claim 3, characterized in that, Use the statistical outlier removal method to denoise the point cloud data scatter plot; use the VoxelGrid filter in the PCL library to downsample the point cloud data scatter plot.

5. The automatic modeling method for surface parts based on point cloud data according to claim 4, wherein The point cloud data preprocessing parameters include: The average number of points in the denoising neighborhood and the standard deviation multiplier threshold during denoising, and the voxel side length of voxel downsampling during downsampling.

6. The automatic modeling method for surface parts based on point cloud data according to claim 1 or 5, characterized in that The modeling parameters include: The octree depth of the Poisson model, the minimum number of samples per octree node, and the isosurface subdivision accuracy.

7. The automatic modeling method for surface parts based on point cloud data according to claim 6, characterized in that Use the MLS moving least squares method to smooth the point cloud data.

8. The automatic modeling method for surface parts based on point cloud data according to claim 7, wherein Use the genetic algorithm to optimize the point cloud data preprocessing parameters and modeling parameters, including the following steps: Step 1: Randomly initialize the population; Among them, the individuals in the population are vectors composed of point cloud data preprocessing parameters and modeling parameters, and each individual corresponds to a point cloud data reconstructed surface; Step 2: Calculate the fitness of each individual in the current population; Among them, where f x represents the fitness of individual x in the population, N represents the number of points in the scatter plot of point cloud data, p i represents the coordinates of point i in the scatter plot of point cloud data, V x represents the set of vertices of the reconstructed surface of the point cloud data corresponding to individual x in the population; v j is the coordinate of point j in the set of surface vertices; d(p i , V x ) represents the approximate normal distance from point i in the scatter plot of point cloud data to the reconstructed surface of the point cloud data, and ∥·∥2 represents the Euclidean norm; Step 3: Select the individuals with small fitness in the population as the parents, and use the parents to generate the next generation population through crossover and mutation; Step 4: Repeat Steps 2 - 3 until the maximum number of iterations is reached; select the point cloud data preprocessing parameters and modeling parameters corresponding to the individual with the smallest fitness as the optimal point cloud data preprocessing parameters and optimal modeling parameters.