A method for compensating casting deformation based on point cloud
Through the casting deformation compensation method based on point cloud, Gaussian filtering, dynamic sampling, ICP registration and SIFT feature point matching technologies, the problem of unsatisfactory accuracy and efficiency in casting deformation compensation is solved, and the precise compensation of casting deformation is achieved.
Patent Information
- Application Number
- CN202510687356.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-27
- Publication Date
- 2025-08-19
- Estimated Expiration
- 2045-05-27
AI Technical Summary
The prior art has problems of unsatisfactory accuracy and efficiency in casting deformation compensation, especially the nonlinear deformation of complex curved castings is difficult to accurately match. Traditional methods cannot effectively deal with the overall rigidity and local plastic deformation during casting, and the noise and redundant point treatment effects in point cloud pretreatment are limited.
The casting deformation compensation method based on point cloud is adopted, and the rigid and non-rigid layer point clouds are distinguished for deformation compensation through Gaussian filtering and edge point detection, dynamic sampling rate sampling, ICP registration, SIFT feature point matching, local affine transformation and multi-scale deformation mapping, combined with the global transformation matrix, distinguish rigid and non-rigid layer point clouds for deformation compensation.
It improves the accuracy and efficiency of casting deformation compensation, can effectively handle the overall rigidity and local plastic deformation of castings, and improves point cloud quality and compensation accuracy.
Smart Images

Figure CN120219251B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the intersection field of three-dimensional digital detection and precision casting technology, and specifically relates to a casting deformation compensation method based on point cloud. Background Art
[0002] During the solidification and cooling process, castings generally experience complex deformation phenomena such as overall shrinkage and local warping due to differences in alloy shrinkage, mold shell constraints, and uneven temperature gradient distribution. Traditional inverse deformation compensation methods rely on empirical formulas or finite element simulation to predict deformation quantities, and achieve deformation offset by presetting inverse compensation quantities during the mold design phase. However, the deformation of complex curved castings such as turbine blades exhibits highly nonlinear characteristics. It is difficult to accurately match the actual deformation with a single displacement field compensation, and multiple mold trials and iterative corrections are often required.
[0003] With the development of 3D scanning technology, deformation analysis based on measured point clouds has gradually become mainstream. However, its engineering applications still face multiple technical bottlenecks: During point cloud preprocessing, interfering features such as burrs and scale often exist on the surface of castings, and the scanned data is mixed with high-frequency noise and redundant points. Existing technologies have drawbacks when filtering out noise and redundant points, such as blurred geometric edge details or limited effectiveness in removing irregular burrs. During the deformation modeling stage, traditional global rigid transformation models are unable to characterize the gradient characteristics of casting shrinkage, while purely non-rigid algorithms have high computational complexity and are prone to excessive deformation. Approximately 60% of casting deformation is global rigid displacement, while 40% is local plastic deformation. Therefore, a hybrid modeling strategy is required. However, existing methods often use curvature analysis to divide rigid regions without establishing a dynamic weighting mechanism, resulting in discontinuities in the compensation matrix in the transition region. This makes existing technologies less than ideal for the accuracy and efficiency of casting deformation compensation. Summary of the Invention
[0004] The purpose of the present invention is to propose a casting deformation compensation method based on point cloud, which can effectively improve the deformation compensation accuracy and efficiency of castings.
[0005] The present invention is achieved through the following technical solutions:
[0006] A method for compensating casting deformation based on point cloud comprises the following steps:
[0007] Step S1: Gaussian filtering and edge point detection are performed on the casting point cloud, the edge point detection results are sampled using a dynamic sampling rate to obtain a source point cloud, and the source point cloud is registered to the template point cloud coordinate system of the casting using ICP registration to obtain an initial registered point cloud;
[0008] Step S2: using SIFT to obtain the registration feature point set and template feature point set of the initial registration point cloud and the template point cloud respectively, obtaining a coarse matching pair set based on the feature point distance, and performing robust matching on the coarse matching pair set to obtain a fine registration point cloud;
[0009] Step S3: performing deformation compensation on the precisely registered point cloud based on local affine transformation and multi-scale deformation mapping to obtain the final registered point cloud;
[0010] Step S4: Calculate the curvature standard deviation of each point cloud in the final registered point cloud, and cluster the final registered point cloud based on the KD tree to obtain multiple clusters of point clouds. For each cluster of point clouds, if the curvature standard deviation of each point cloud is less than the set curvature threshold and the angle between the normal vectors of the point clouds is less than the set first angle threshold, then the cluster point cloud is classified as a rigid layer point cloud, otherwise it is classified as a non-rigid layer point cloud.
[0011] Step S5: Use the global transformation matrix to transform the final registered point cloud to obtain the compensated point cloud. The global transformation matrix is obtained by weighted fusion of the homogeneous transformation matrix and the local affine transformation matrix. The homogeneous transformation matrix is obtained based on the rigid layer point cloud, and the local affine transformation matrix is obtained based on the non-rigid layer.
[0012] Furthermore, in step S1, edge point detection of the casting point cloud after Gaussian filtering specifically includes: i point cloud, calculate the covariance matrix of the point cloud coordinates in its neighborhood , perform eigenvalue decomposition on the covariance matrix and obtain three eigenvalues λ1, λ2, and λ3 sorted by size. If λ1> k 1⋅λ2 and λ2≤ k 2⋅λ3, then determine the i The point cloud is a candidate edge point. If the angle variance between the normal vector of each point in the neighborhood and the normal vector of the center point is greater than the set second angle threshold, the first point is determined to be a candidate edge point. i The point cloud is an edge point, and the point cloud is marked with an edge point and placed in the edge point set, where: n is the number of point clouds in the neighborhood, q j The first j point clouds, μ is the mean value of the point cloud in the neighborhood.
[0013] Furthermore, in step S1, sampling the edge point detection results using a dynamic sampling rate specifically includes: recursively dividing the edge point set to obtain multiple point sets, calculating the variance of the current point set on the X / Y / Z coordinate axes for each division, selecting the coordinate axis corresponding to the maximum variance as the splitting axis, sorting the current point set according to the splitting axis coordinates, selecting the median in the sorting as the splitting point, and dividing the current point set into two point sets. For each point set, it is determined to be a high-density area or a low-density area based on its point density, sampling at a lower sampling rate in the high-density area, and sampling at a higher sampling rate in the low-density area.
[0014] Furthermore, in the step S1, the ICP registration is performed with an iterative step size of Iterate, and in each iteration, the template point cloud P t Point cloud in p t , in the source point cloud P s Search point cloud p t The nearest neighbor of p s , if the nearest neighbor p s With point cloud p t If the normal vector angle of is less than the set third angle threshold, then ( p s , p t ) as a valid matching pair, after the iteration, the transformation matrix T is obtained, according to the formula Get the initial registration point cloud in, is the set large step size, is the set small step size, is the error change rate of the current iteration, E k is the error of the current iteration.
[0015] Furthermore, step S2 includes the following steps:
[0016] Step S21: using SIFT to obtain a set of registration feature points of an initial registration point cloud and a set of template feature points of a template point cloud;
[0017] Step S22: for a template feature point in the template feature point set, select a registration feature point in the registration point cloud whose distance to the template feature point is less than a set distance threshold, and form an initial matching pair with the template feature point and the selected registration feature point;
[0018] Step S23: When the number of initial matching pairs is greater than one, calculate the distance between the template feature point and the registration feature point corresponding to each initial matching pair to obtain the nearest neighbor distance. D 1 and next nearest neighbor distance D 2. If D 1 / D 2 is less than the set ratio threshold, the initial matching pairs corresponding to the nearest neighbor distance are retained; otherwise, all initial matching pairs corresponding to the template feature point are deleted to obtain a coarse matching pair set;
[0019] Step S24: Use the RANSAC algorithm to eliminate mismatches in the rough matching pair set, and use the Geman-McClure kernel function to optimize the rough matching pair set after eliminating mismatches to obtain the optimal transformation matrix, and then obtain the fine registration point cloud based on the initial registration point cloud and the optimal transformation matrix. .
[0020] Furthermore, the step S3 specifically includes the following steps:
[0021] Step S31, iteratively optimize the local affine transformation matrix by stochastic gradient descent A i , where the loss function is ,in, , , Indicates the template point cloud and the point cloud p i Matching points, is the threshold value set;
[0022] Step S32: Calculate the curvature of the precisely registered point cloud after the local affine transformation matrix transformation using the Laplace Beltrami operator, separate high curvature areas from low curvature areas, construct a Gaussian pyramid, reduce the point cloud resolution layer by layer, extract geometric features from coarse to fine, and implement multi-scale filtering to obtain a filtered point cloud;
[0023] Step S33: Define energy function , to minimize the Wasserstein distance between the filtered point cloud and the template point cloud to optimize the transformation matrix T' , and obtain the final registered point cloud ,in, p i' represents the point cloud after filtering, p j' For the template point cloud p i' Matched point cloud, inf represents the infimum.
[0024] Furthermore, in step S4, according to the formula Calculate the final registered point cloud Point Cloud p i'' The standard deviation of curvature ,in, m Point Cloud p i'' The number of point clouds in the neighborhood of Point cloud in the neighborhood p j'' The Gaussian curvature of is the average Gaussian curvature in the neighborhood.
[0025] Furthermore, the curvature threshold is set to 0.05, and the first angle threshold is set to 10°.
[0026] Furthermore, in step S5, for the final registration point cloud Point cloud in p i'' , and its corresponding global transformation matrix is expressed as , optimize the weights by the Levenberg-Marquardt algorithm w i'' ,in, is the homogeneous transformation matrix, is the local affine transformation matrix, optimizing the weights w i'' When the initial value is given by the formula Get, K i'' Representing non-rigid layer point clouds p i'' The Gaussian curvature of Representing non-rigid layer point clouds p i'' The Gaussian curvature gradient of 、 is the set weight factor, .
[0027] Furthermore, in step S5, for the non-rigid layer point cloud p i'' , using the least squares method to obtain and , where the error function is defined as , is the point cloud in the template point cloud, and N is the number of point clouds in the template point cloud.
[0028] The present invention has the following beneficial effects:
[0029] 1. The present invention performs Gaussian filtering and edge point detection on the casting point cloud, which can eliminate local disturbances while preserving geometric features, ensure that key structures such as corners are not blurred, and uses a dynamic sampling rate to sample the edge point detection results to obtain a source point cloud. The source point cloud is registered to the template point cloud coordinate system of the casting using ICP registration to obtain an initial registered point cloud, which can achieve data simplification and registration optimization, and effectively improve the point cloud quality; SIFT is used to obtain the registration feature point set and template feature point set of the initial registered point cloud and the template point cloud respectively, and a coarse matching pair set is obtained according to the feature point distance. The coarse matching pair set is robustly matched to obtain a fine registered point cloud, and based on Local affine transformation and multi-scale deformation mapping are used to compensate the deformation of the precisely registered point cloud to obtain the final registered point cloud, which can achieve fine adjustment of local deformation and enhance the ability to retain details. Finally, it is judged whether each point cloud in the final registered point cloud belongs to the rigid layer point cloud or the non-rigid layer point cloud, and the global transformation matrix is used to transform the final registered point cloud to obtain the compensated point cloud. The global transformation matrix is obtained by weighted fusion of the homogeneous transformation matrix and the local affine transformation matrix. The homogeneous transformation matrix is obtained according to the rigid layer point cloud, and the local affine transformation matrix is obtained according to the non-rigid layer. It effectively solves the compensation problem of the coexistence of rigid and non-rigid deformations in castings, thereby effectively improving the compensation accuracy and efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0030] The present invention will be further described in detail below with reference to the accompanying drawings.
[0031] Figure 1 Flowchart of the present invention.
[0032] Figure 2 This is the casting point cloud of the present invention.
[0033] Figure 3 It is the template point cloud of the present invention.
[0034] Figure 4 Schematic diagram of the final registration of the casting point cloud and the template point cloud according to the present invention.
[0035] Figure 5 Schematic diagram of the casting compensation point cloud of the present invention. DETAILED DESCRIPTION
[0036] like Figure 1 As shown in FIG, the method for compensating casting deformation based on point cloud includes the following steps:
[0037] Step S1: Gaussian filtering and edge point detection are performed on the casting point cloud, the edge point detection results are sampled using a dynamic sampling rate to obtain a source point cloud, and the source point cloud is registered to the template point cloud coordinate system of the casting using ICP registration to obtain an initial registered point cloud;
[0038] Specifically, the casting point cloud is as follows Figure 2As shown, the template point cloud is as follows Figure 3 As shown, the template point cloud is obtained through the standard CAD model of the casting;
[0039] In Gaussian filtering, the weight of each point in the neighborhood is calculated by the Gaussian function, and these points are weighted averaged to update the coordinates of the center point;
[0040] The edge point detection of the casting point cloud after Gaussian filtering specifically includes: i point cloud, calculate the covariance matrix of the point cloud coordinates in its neighborhood , perform eigenvalue decomposition on the covariance matrix and obtain three eigenvalues λ1, λ2, and λ3 sorted by size. If λ1> k 1⋅λ2 and λ2≤ k 2⋅λ3, then determine the i The point cloud is a candidate edge point. If the angle variance between the normal vector of each point in the neighborhood and the normal vector of the center point is greater than the set second angle threshold, the first point is determined to be a candidate edge point. i The point cloud is an edge point, and the point cloud is marked with an edge point and placed in the edge point set, where: n is the number of point clouds in the neighborhood, q j The first j point clouds, μ is the mean value of the point cloud in the neighborhood, k 1=4, k 2=1.5.
[0041] The use of dynamic sampling rate to sample edge point detection results specifically includes: recursively dividing the edge point set to obtain multiple point sets, each time the division is performed, the variance of the current point set on the X / Y / Z coordinate axis is calculated respectively, the coordinate axis corresponding to the maximum variance is selected as the splitting axis, the current point set is sorted according to the splitting axis coordinates, the median in the sorting is selected as the splitting point, and the current point set is divided into two point sets on the left and right. For each point set, it is determined to be a high-density area or a low-density area according to its point density, and a lower sampling rate (such as 10%) is used for sampling in the high-density area, and a higher sampling rate (such as 30%) is used for sampling in the low-density area. During the sampling process, for feature areas identified by curvature or normal vector change rate (such as edge points or areas with significant curvature), all points are forced to be retained. Compared with uniform sampling, the dynamic sampling of the present invention improves compression by more than 20% while maintaining feature integrity. Among them, the point density calculation formula is: ,Will The area is defined as a high-density area. The area is defined as a low-density area. is the global average density, l 1=1.5, l2=1.8.
[0042] Using ICP registration, the iterative step size Iterate, and in each iteration, the template point cloud P t Point cloud in p t , in the source point cloud P s Search point cloud p t The nearest neighbor of p s , if the nearest neighbor p s With point cloud p t If the normal vector angle of is less than the set third angle threshold, then ( p s , p t ) as a valid matching pair, after the iteration, the transformation matrix T is obtained, according to the formula Get the initial registration point cloud in, is the set large step size, is the set small step size, is the error change rate of the current iteration, E k is the error of the current iteration. The third angle threshold is set to 15°~30°, with a large step size of 0.5 and a small step size of 0.1.
[0043] Step S2: using SIFT to obtain the registration feature point set and template feature point set of the initial registration point cloud and the template point cloud respectively, obtaining a coarse matching pair set based on the feature point distance, and performing robust matching on the coarse matching pair set to obtain a fine registration point cloud;
[0044] The specific steps include:
[0045] Step S21: Use SIFT (Scale Invariant Feature Transform) to obtain the registration feature point set of the initial registration point cloud and the template feature point set of the template point cloud. In the SIFT parameter setting, min_scale=0.01 defines the minimum scale spatial resolution, and n_octaves=3 indicates the construction of three scale pyramid layers, each containing n_scales_per_octave=4 sub-levels to cover feature changes at different scales.
[0046] Step S22: for a template feature point in the template feature point set, select a registration feature point in the registration point cloud whose distance to the template feature point is less than a set distance threshold, and form an initial matching pair with the template feature point and the selected registration feature point;
[0047] Step S23: When the number of initial matching pairs is greater than one, calculate the distance between the template feature point and the registration feature point corresponding to each initial matching pair to obtain the nearest neighbor distance. D 1 and next nearest neighbor distance D 2. If D 1 / D 2 is less than the set ratio threshold, the initial matching pairs corresponding to the nearest neighbor distance are retained, otherwise, all initial matching pairs corresponding to the template feature point are deleted to obtain a coarse matching pair set ; Among them, the ratio threshold is set to 0.6;
[0048] You can also add geometric combination constraints, assuming the original triangle side length is , after matching ,like , then the geometric similarity is considered to be satisfied. The 5% error threshold refers to the actual sensor noise level and balances robustness and computational efficiency.
[0049] Step S24: Use the RANSAC algorithm to eliminate mismatches in the rough matching pair set, and use the Geman-McClure kernel function to optimize the rough matching pair set after eliminating mismatches to obtain the optimal transformation matrix, and then obtain the fine registration point cloud based on the initial registration point cloud and the optimal transformation matrix. ;
[0050] When RANSAC removes mismatches, it is calculated according to the formula Number of iterations N , randomly sampled in each iteration m =3 matching pairs, calculate the change matrix, and count the number of inliers T inlier ,when When , the iteration is terminated early and the optimal transformation matrix is output and interior point set ;
[0051] In Geman-McClure kernel function optimization, according to the residual in the interior point set , calculate the error function With weight function (The weight function comes from the Geman-McClure kernel function, is a dynamically adjusted scale parameter), then the robust matching pair set is ,in, is the estimated optimal rigid body transformation matrix, τ =0.1mm is the residual threshold, which is used to determine whether it is an internal point. For the set of matching point pairs that are retained and have high consistency, the optimal transformation matrix , is the Euclidean distance between the transformed source and target points. The minimization problem is solved by weighted least squares or nonlinear optimization.
[0052] Through complete robust optimization from coarse to fine, the accuracy is significantly improved while maintaining algorithm efficiency.
[0053] Step S3: performing deformation compensation on the precisely registered point cloud based on local affine transformation and multi-scale deformation mapping to obtain the final registered point cloud;
[0054] The specific steps include:
[0055] Step S31: Iteratively optimize the point cloud by stochastic gradient descent p i The corresponding local affine transformation matrix A i , where the loss function is ,in, , , Indicates the template point cloud and the point cloud p i Matching points, is the threshold value set;
[0056] Step S32: Calculate the curvature of the precisely registered point cloud after the local affine transformation matrix transformation using the Laplace Beltrami operator, separate high curvature areas from low curvature areas, construct a Gaussian pyramid, reduce the point cloud resolution layer by layer, extract geometric features from coarse to fine, and implement multi-scale filtering to obtain a filtered point cloud;
[0057] Step S33: Define energy function , to minimize the Wasserstein distance between the filtered point cloud and the template point cloud to optimize the transformation matrix T' , and obtain the final registered point cloud ,like Figure 4 As shown, p i' represents the point cloud after filtering, p j' For the template point cloud p i' Matched point cloud, inf means finding the infimum.
[0058] Step S4: Calculate the curvature standard deviation of each point cloud in the final registered point cloud, and cluster the final registered point cloud based on the KD tree to obtain multiple clusters of point clouds. For each cluster of point clouds, if the curvature standard deviation of each point cloud is less than the set curvature threshold and the angle between the normal vectors of the point clouds is less than the set first angle threshold, then the cluster point cloud is classified as a rigid layer point cloud, otherwise it is classified as a non-rigid layer point cloud.
[0059] According to the formula Calculate the final registered point cloud Point Cloud p i'' The standard deviation of curvature ,in, m Point Cloud p i'' The number of point clouds in the neighborhood of Point cloud in the neighborhood p j'' The Gaussian curvature of is the average Gaussian curvature within the neighborhood. The curvature threshold is set to 0.05, and the first angle threshold is set to 10°. The calculation process of Gaussian curvature and average Gaussian curvature is based on existing technology.
[0060] Step S5: transform the final registered point cloud using a global transformation matrix to obtain a compensated point cloud. The global transformation matrix is obtained by weighted fusion of a homogeneous transformation matrix and a local affine transformation matrix. The homogeneous transformation matrix is obtained based on the rigid layer point cloud, and the local affine transformation matrix is obtained based on the non-rigid layer.
[0061] For the final registered point cloud Point cloud in p i'' , and its corresponding global transformation matrix is expressed as , optimize the weights by the Levenberg-Marquardt algorithm w i'' ,in, is the homogeneous transformation matrix, is the local affine transformation matrix, optimizing the weights w i'' When the initial value is given by the formula Get, K i'' Representing non-rigid layer point clouds p i'' The Gaussian curvature of Representing non-rigid layer point clouds p i'' The Gaussian curvature gradient of 、 is the weight factor set based on experience, .
[0062] For non-rigid layer point clouds p i'' , using the least squares method to obtain and , where the error function is defined as , is the point cloud in the template point cloud, and N is the number of point clouds in the template point cloud. The final compensated point cloud is as follows Figure 5 shown.
[0063] The above description is merely a preferred embodiment of the present invention and therefore cannot be used to limit the scope of the present invention. In other words, equivalent changes and modifications made according to the scope of the patent application and the contents of the specification should still fall within the scope of the patent of the present invention.
Claims
1. A method for compensating casting deformation based on point cloud, characterized by: The steps include: Step S1: perform edge point detection on the Gaussian filtered casting point cloud, sample the edge point detection results using a dynamic sampling rate to obtain a source point cloud, and use ICP registration to register the source point cloud to the casting template point cloud coordinate system to obtain an initial registered point cloud; Step S2: using SIFT to obtain the registration feature point set and template feature point set of the initial registration point cloud and the template point cloud respectively, obtaining a coarse matching pair set based on the feature point distance, and performing robust matching on the coarse matching pair set to obtain a fine registration point cloud; Step S3: performing deformation compensation on the precisely registered point cloud based on local affine transformation and multi-scale deformation mapping to obtain the final registered point cloud; Step S4: Calculate the curvature standard deviation of each point cloud in the final registered point cloud, and cluster the final registered point cloud based on the KD tree to obtain multiple clusters of point clouds. For each cluster of point clouds, if the curvature standard deviation of each point cloud is less than the set curvature threshold and the angle between the normal vectors of the point clouds is less than the set first angle threshold, then the cluster point cloud is classified as a rigid layer point cloud, otherwise it is classified as a non-rigid layer point cloud. Step S5: transform the final registered point cloud using a global transformation matrix to obtain a compensated point cloud. The global transformation matrix is obtained by weighted fusion of a homogeneous transformation matrix and a local affine transformation matrix. The homogeneous transformation matrix is obtained based on the rigid layer point cloud, and the local affine transformation matrix is obtained based on the non-rigid layer. The step S3 specifically includes the following steps: Step S31, iteratively optimize the local affine transformation matrix by stochastic gradient descent A i , where the loss function is ,in, , , Indicates the template point cloud and the point cloud p i Matching points, is the threshold value set; Step S32: Calculate the curvature of the precisely registered point cloud after the local affine transformation matrix transformation using the Laplace Beltrami operator, separate high curvature areas from low curvature areas, construct a Gaussian pyramid, reduce the point cloud resolution layer by layer, extract geometric features from coarse to fine, and implement multi-scale filtering to obtain a filtered point cloud; Step S33: Define energy function , to minimize the Wasserstein distance between the filtered point cloud and the template point cloud to optimize the transformation matrix T' , and obtain the final registered point cloud ,in, p i' represents the point cloud after filtering, p j' For the template point cloud p i' Matched point cloud, inf represents the infimum.
2. The method for compensating casting deformation based on point cloud according to claim 1, characterized in that: In the step S1, edge point detection of the casting point cloud after Gaussian filtering specifically includes: i point cloud, calculate the covariance matrix of the point cloud coordinates in its neighborhood , perform eigenvalue decomposition on the covariance matrix and obtain three eigenvalues λ1, λ2, and λ3 sorted by size. If λ1> k 1⋅λ2 and λ2≤ k 2⋅λ3, then determine the i The point cloud is a candidate edge point. If the angle variance between the normal vector of each point in the neighborhood and the normal vector of the center point is greater than the set second angle threshold, the first point is determined to be a candidate edge point. i The point cloud is an edge point, and the point cloud is marked with an edge point and placed in the edge point set, where: n is the number of point clouds in the neighborhood, q j The first j point clouds, μ is the mean value of the point cloud in the neighborhood.
3. The method for compensating casting deformation based on point cloud according to claim 2, characterized in that: In the step S1, sampling the edge point detection results using a dynamic sampling rate specifically includes: recursively dividing the edge point set to obtain multiple point sets, calculating the variance of the current point set on the X / Y / Z coordinate axes for each division, selecting the coordinate axis corresponding to the maximum variance as the splitting axis, sorting the current point set according to the splitting axis coordinates, selecting the median in the sorting as the splitting point, and dividing the current point set into two point sets. For each point set, it is determined to be a high-density area or a low-density area based on its point density, sampling at a lower sampling rate in the high-density area, and sampling at a higher sampling rate in the low-density area.
4. The method for compensating casting deformation based on point cloud according to claim 3, characterized in that: In the step S1, the ICP registration is performed with an iteration step size of , in each iteration, the template point cloud P t Point cloud in p t , in the source point cloud P s Search point cloud p t The nearest neighbor of p s , if the nearest neighbor p s With point cloud p t If the normal vector angle of is less than the set third angle threshold, then ( p s , p t ) as a valid matching pair, after the iteration, the transformation matrix T is obtained, according to the formula Get the initial registration point cloud in, is the set large step size, is the set small step size, is the error change rate of the current iteration, E k is the error of the current iteration.
5. The method for compensating casting deformation based on point cloud according to claim 4, characterized in that: The step S2 comprises the following steps: Step S21: using SIFT to obtain a set of registration feature points of an initial registration point cloud and a set of template feature points of a template point cloud; Step S22: for a template feature point in the template feature point set, select a registration feature point in the registration point cloud whose distance to the template feature point is less than a set distance threshold, and form an initial matching pair with the template feature point and the selected registration feature point; Step S23: When the number of initial matching pairs is greater than one, calculate the distance between the template feature point and the registration feature point corresponding to each initial matching pair to obtain the nearest neighbor distance. D 1 and next nearest neighbor distance D 2. If D 1 / D 2 is less than the set ratio threshold, the initial matching pairs corresponding to the nearest neighbor distance are retained; otherwise, all initial matching pairs corresponding to the template feature point are deleted to obtain a coarse matching pair set; Step S24: Use the RANSAC algorithm to eliminate mismatches in the rough matching pair set, and use the Geman-McClure kernel function to optimize the rough matching pair set after eliminating mismatches to obtain the optimal transformation matrix, and then obtain the fine registration point cloud based on the initial registration point cloud and the optimal transformation matrix. .
6. The method for compensating casting deformation based on point cloud according to claim 5, characterized in that: In step S4, according to the formula Calculate the final registered point cloud Point Cloud p i'' The standard deviation of curvature ,in, m Point Cloud p i'' The number of point clouds in the neighborhood of Point cloud in the neighborhood p j'' The Gaussian curvature of is the average Gaussian curvature in the neighborhood.
7. The method for compensating casting deformation based on point cloud according to claim 6, characterized in that: The curvature threshold is set to 0.05, and the first angle threshold is set to 10°.
8. The method for compensating casting deformation based on point cloud according to claim 7, characterized in that: In step S5, for the final registration point cloud Point cloud in p i'' , and its corresponding global transformation matrix is expressed as , optimize the weights by the Levenberg-Marquardt algorithm w i'' ,in, is the homogeneous transformation matrix, is the local affine transformation matrix, optimizing the weights w i'' When the initial value is given by the formula Get, K i'' Representing non-rigid layer point clouds p i'' The Gaussian curvature of Representing non-rigid layer point clouds p i'' The Gaussian curvature gradient of 、 is the set weight factor, .
9. The method for compensating casting deformation based on point cloud according to claim 8, characterized in that: In step S5, for the non-rigid layer point cloud p i'' , using the least squares method to obtain and , where the error function is defined as , is the point cloud in the template point cloud, and N is the number of point clouds in the template point cloud.
Citation Information
Patent Citations
Non-rigid complex component high-precision edge extraction method based on point cloud
CN110111349A
Method for controlling molding deformation of castings through reverse deviation compensations
CN112207232A