Workpiece point cloud fine registration method based on pseudo-elimination weighted variance minimization algorithm
By employing a pseudo-removal weighted variance minimization algorithm to distinguish the weight functions of structural deviations and margin point clouds, and combining this with adaptive coordination distance, the matching distortion problem caused by abnormal point clouds in large and complex workpieces is solved, achieving high-precision and stable point cloud registration.
Patent Information
- Application Number
- CN202310099028.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-01-29
- Publication Date
- 2025-12-30
- Estimated Expiration
- 2043-01-29
AI Technical Summary
Existing point cloud registration algorithms cannot effectively handle matching distortions caused by structural deviations and uneven allowances in large and complex workpieces. In particular, they are difficult to achieve accurate positioning and measurement when faced with a large number of abnormal point clouds.
A pseudo-removal weighted variance minimization algorithm is adopted. By establishing a weight function to distinguish between structural deviation point clouds and surplus point clouds, and combining adaptive coordination distance and weight function, the impact of abnormal point clouds on registration accuracy is reduced. Finally, the rigid body transformation matrix is solved by the objective function of the pseudo-removal weighted variance minimization algorithm to achieve fine registration.
It effectively suppresses the influence of abnormal point clouds caused by structural deviations and uneven allowances, improves registration accuracy and stability, and is suitable for precise positioning and measurement of large and complex workpieces.
Smart Images

Figure CN115994931B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of processing and manufacturing, and relates to a point cloud registration algorithm, particularly to a workpiece point cloud fine registration method based on the pseudo-removal weighted variance minimization (DPWVM) algorithm. Background Technology
[0002] In the field of robotic machining and manufacturing, the positioning and measurement of large and complex workpieces is often quite difficult. Taking large castings as an example, there is a certain range of free shrinkage during the casting and solidification process. When the casting has uneven wall thickness, the cooling and shrinkage processes of different parts cannot be synchronized, resulting in different dimensional changes in different parts of the casting. This leads to a certain deviation in structure between the actual workpiece and the ideal CAD model. In addition, after such parts are cast, flash of varying sizes and shapes inevitably occurs at the mold parting point, as well as at the die-drawing and sand-adhesive surfaces. Therefore, existing point cloud registration algorithms cannot effectively register points due to structural deviations and a large number of abnormal point clouds such as uneven allowances, making it difficult to guarantee accurate positioning and measurement of the workpiece. The authorized invention patent with application number CN201510226138.8 proposes a workpiece point cloud matching algorithm based on minimizing distance variance. This algorithm can suppress matching distortion caused by inherent measurement defects such as missing points and uneven point cloud density. However, for large and complex workpieces, excessive abnormal point clouds such as uneven allowances and structural deviations will cause matching distortion. The authorized invention patent with application number CN202110573411.X proposes an optical measurement method for complex workpieces based on a weighted positive and negative margin variance minimization algorithm. This method can suppress matching distortion caused by uneven margins. However, the algorithm cannot effectively distinguish between structural deviation point clouds and margin point clouds. Especially when the degree of structural deviation is small but the number of deviations is large, the structural deviation point clouds that should be completely suppressed are regarded as margin point clouds. At this time, due to the excessive number of abnormal point clouds, the weighted positive and negative margin variance minimization algorithm will get stuck in a local optimum and cannot effectively register. The literature "A method for registration of 3-D shapes" (IEEE Transactions on Pattern Analysis and Machine Intelligence, 14(1992)239-256) proposes an iterative nearest point (ICP) algorithm, which aims to minimize the sum of squared point-to-point distances and gradually iterates to complete the fine registration of point clouds. Since its objective function guarantees the minimum global distance, this algorithm will be affected by abnormal point clouds such as structural deviations and uneven margins, resulting in matching distortion. To address the aforementioned problems, this invention proposes a pseudo-spurious weighted variance minimization algorithm that can effectively suppress the influence of numerous abnormal point clouds such as structural deviations and uneven margins. This algorithm is applied to robot vision positioning and measurement of large and complex workpieces and can effectively solve the matching distortion problem of traditional algorithms. Summary of the Invention
[0003] The purpose of this invention is to provide a fine registration method for workpiece point clouds based on the De-pseudo-weighted variance minimization (DPWVM) algorithm. A weight function is established to distinguish between structural deviation point clouds and surplus point clouds. An adaptive coordination distance is established by unifying point-to-point distance and point-to-surface distance using binary symbol η. This effectively solves the matching distortion that occurs in existing algorithms when faced with a large number of structural deviation point clouds and uneven surplus point clouds, improving the stability of algorithm convergence. It is particularly suitable for large and complex workpieces. Finally, the effectiveness of the algorithm is verified through the registration and positioning of a large and complex workpiece.
[0004] To achieve the above objectives, the technical solution of the present invention is as follows:
[0005] This invention protects a method for fine registration of workpiece point clouds based on a pseudo-spurious weighted variance minimization algorithm, comprising the following steps:
[0006] Step 1: Discretize the CAD model into a point cloud model as the target point cloud Q. Calculate and orient the target point cloud normal vector based on Open3D library functions. Use a 3D scanner to acquire the measurement point cloud as the source point cloud P.
[0007] Step 2: Use the Kdtree algorithm to perform a bidirectional search on the target point cloud and the source point cloud to obtain the nearest neighbor pair set. A measurement point in the source point cloud and the point in the target point cloud that is closest to that measurement point form a nearest neighbor pair. Based on the positional relationship between the point pairs in the target point cloud and the source point cloud P, divide the source point cloud P into a forward measurement point set P. k (p1,p2,p3…p k …p m ) and the negative measurement point set P s (p1,p2,p3…p s …p n ), p k This represents the k-th forward measuring point, where m is the total number of forward measuring points in the source point cloud, and p s Let represent the s-th negative positive measurement point, n be the total number of negative measurement points in the source point cloud, and the total number of source point clouds be m+n;
[0008] Step 3: Establish an adaptive coordination distance for the point-to-point distance and point-to-area distance in the unified nearest neighbor pair set, connected by the binary symbol η, where η = 0 or η = 1, and adjust the adaptive coordination distance in real time;
[0009] Step 4: Establish a weighting function to divide the source point cloud P into normal point cloud, controllable abnormal point cloud and uncontrollable abnormal point cloud based on the point-to-point distance range, and apply different degrees of proportional weight to each point-to-point distance to reduce the impact of abnormal point cloud on registration accuracy.
[0010] Step 5: Establish the objective function of the pseudo-removal weighted variance minimization algorithm based on the adaptive coordination distance and weight function, which is used to solve the rigid body transformation matrix for fine registration between the target point cloud Q and the source point cloud P based on the CAD model.
[0011] Step 6: Apply the transformation matrix calculated in Step 5 to the measurement point cloud to update the measurement point cloud;
[0012] Step 7: Define the error evaluation function for point clouds with structural deviations, uneven margins, and inherent measurement defects;
[0013] Step 8: Repeat steps 2-7 until the convergence condition is met: number of iterations M > M max Finally, the rigid body transformation parameters T of the precise registration are obtained.
[0014] Furthermore, in step 1, the estimate_normals function in Open3D is used to calculate the normal vector of the target point cloud, and the orient_normals_consistent_tangent_plane function is used to orient the normal vector.
[0015] Furthermore, in step 2, the method for distinguishing between positive and negative measuring points applies to the positive measuring point p. k and negative measuring point p s p k satisfy p s satisfy q j To be compatible with source point cloud p k and p s The nearest neighbor point cloud, n j Is the target point cloud q j The normal vector at that point, It is the normal vector n j The transpose of .
[0016] Furthermore, in step 3, the adaptive coordination distance is established as follows:
[0017] Step 3.1, Adaptive Coordination Distance d iV Includes positive adaptive coordination distance d kV and negative adaptive coordination distance d sV Let i∈[1,m+n], and define ω∈R. 3 and ν∈R 3 Let R be the rotation vector and translation vector. 3 Representing the distance function d between two points in three-dimensional space, where the distance is from one point to the other. iI The first-order Taylor approximation is as follows:
[0018] After a single-step transformation, the distance d between the midpoint and the nearest neighbor pair iI That is, update point p i+ to its nearest neighbor q j The distance is given by formula (1):
[0019]
[0020] in, It is the transformation vector, P i It corresponds to the i-th measurement point p i The antisymmetric matrix of three-dimensional coordinates, I 3×3 It is a 3×3 identity matrix, and the distance d between the midpoints of a point is... iI When ξ0=0 6×1 The first-order Taylor expansion at the point is given by formula (2):
[0021] d iI (ξ)=d iI (ξ0)+[▽d iI (ξ0)] T ξ Formula (2)
[0022] Where, d iI (ξ0)=||p i -q j ||, ξ0 is the 6×1 transformation zero vector, Let ξ be the first-order gradient of the transformation vector. The calculation process is as shown in formula (3):
[0023]
[0024] Where A and B are intermediate parameters, Let q represent the normalized nearest neighbor distance vector. j Indicates the centering of the point and the measurement point p. i For the target point, d iI The first-order approximation is expressed as formula (4):
[0025]
[0026] Step 3.2: Establish the point-to-plane distance function, as shown in formula (5):
[0027]
[0028] Where, d iT Let F be the distance from the midpoint of a point to the plane, and n be a distance function. j Let q represent the j-th target point cloud. j The normal vector at point n iT =n j , It is a transformation vector;
[0029] Step 3.3: Establish the adaptive coordination distance function d iV As in formula (6):
[0030]
[0031] Where η represents the binary symbol, n iV =ηn iT +(1-η)n iI n iV Adaptive coordination distance function d iV The coordination vector, n iT d is the distance function from a point to a plane. iT The coordination vector, n iI It is the coordinate vector of the point-to-point distance function; η = 0 or η = 1, n iI The direction and n iT Maintaining consistency; when η = 0, both normal and tangent constraints exist, improving convergence stability but reducing convergence speed; when η = 1, based on distance d... iT For convergence, only normal constraints exist, at which point the algorithm exhibits quadratic convergence speed. During convergence, tangent constraints effectively prevent erroneous convergence and can even suppress algorithm divergence, improving algorithm stability. Therefore, in the initial stage of fine registration, η = 0 is set, based on distance d... iI To ensure convergence, the algorithm converges in the correct direction; later, η = 1 is set, based on the distance d. iT Achieve rapid convergence.
[0032] Furthermore, in step 4, the distance weighting function is established as follows:
[0033] Step 4.1: Establish the distance weighting function for all positive measurement points, as shown in formula (7):
[0034]
[0035] Among them, w k Let d be the distance weighting function for all positive measurement points. kV For positive adaptive coordination distance, is the mean of the positive adaptive coordination distance, m is the number of positive measurement points, k∈[1,m], α1, α2, μ are all adaptive scaling factors, and α1, α2∈(0,+∞], α1<α2, μ∈[1,+∞]; when the adaptive coordination distance d kV less than twice the mean distance When the point cloud is considered a normal point cloud, its weight is 1; when the point pair adaptively coordinates the distance d... kV greater than twice the mean distance less than μ+1 times the mean distance At that time, the point cloud is considered a controllable anomalous point cloud, and the weight value and adaptive coordination distance d are... kV When the correlation is negative, the distance shrinks by a smaller proportion; when the point pair adaptively coordinates the distance d kV Distance from the mean greater than μ+1 The point cloud is considered an uncontrollable anomalous point cloud, and the weight values and adaptive coordination distance d are... kV The correlation is negative, so the distance should be reduced by a large proportion. When the number of structural deviation point clouds is large, μ should be reduced as much as possible, and vice versa. When the degree of structural deviation is large, α2 should be increased as much as possible, and vice versa.
[0036] Step 4.2: Establish the distance weight function for all negative measurement points, as shown in formula (8):
[0037]
[0038] Among them, w s Let d be the distance weighting function for all negative measurement points. sV For negative adaptive coordination distance, is the mean of the negative adaptive coordination distance, n is the number of negative measurement points, s∈[1,n]; α1, α2, μ are all adaptive scaling factors, and α1, α2∈(0,+∞], α1<α2, μ∈[1,+∞]; when the point pair adaptive coordination distance d sV less than twice the mean distance When the point cloud is considered a normal point cloud, its weight is 1; when the point pair adaptively coordinates the distance d... sV greater than twice the mean distance less than μ+1 times the mean distance At that time, the point cloud is considered a controllable anomalous point cloud, and the weight value and adaptive coordination distance d are... sV When the correlation is negative, the distance shrinks by a smaller proportion; when the point pair adaptively coordinates the distance d sV Distance from the mean greater than μ+1 The point cloud is considered an uncontrollable anomalous point cloud, and the weight values and adaptive coordination distance d are... sV The correlation is negative, and the distance is shrunk by a large proportion. When the number of structural deviation point clouds is large, μ should be reduced as much as possible, and vice versa. When the degree of structural deviation is large, α2 should be increased as much as possible, and vice versa.
[0039] Furthermore, in step 5, the objective function of the pseudo-weighted variance minimization algorithm is established as shown in formula (9):
[0040]
[0041] in, Positive spurious removal weighted distance bias, satisfying For negative spurious removal weighted bias distance, satisfying The weighted adaptive coordination distance mean for all positive measurement points. The weighted adaptive coordination distance mean for all negative measurement points; d kV For the positive adaptive coordination distance, d sV For negative adaptive coordination distance; w k and w s It satisfies formulas (7) and (8).
[0042] Furthermore, in step 6, the rigid body transformation matrix of the nearest neighbor pair set is solved as follows:
[0043] Adaptive coordination distance d iV Including positive adaptive coordination distance d kV and negative adaptive coordination distance d sV Establish distance functions as shown in formulas (10), (11), and (12):
[0044]
[0045]
[0046]
[0047] in, Both are scalars, A i A k A s All are 1×6 matrices, ξ is a 6×1 transformation vector matrix, and n iV Adaptive coordination distance d iV The coordination vector, n kV It is the positive adaptive coordination distance d kV The coordination vector, n sV It is the negative adaptive coordination distance d sV The coordination vector; It is the positive measuring point p k The nearest neighbor target point, It is the negative measuring point p s The nearest neighbor target point;
[0048] For all positive measurement points, the derivation of the sum of squared distance deviations after removing false weights is as shown in formula (13):
[0049]
[0050] Substituting formula (11) into formula (13) yields formula (14):
[0051]
[0052] Among them, E + It is a 6×6 matrix, F + It is a 6×1 matrix, D + As a scalar, It is a pseudo-removed weighted positive average vector that satisfies formula (15):
[0053]
[0054] For all negative measurement points, the same derivation is performed on the sum of squared deviations of the weighted offset distance after removing false positives. Substituting formula (12) into it, we get formula (16):
[0055]
[0056] Therefore, the objective function of the pseudo-weighted variance minimization algorithm can be expressed as formula (17):
[0057]
[0058] G(R,t) is the objective function of the pseudo-removal weighted variance minimization algorithm, D + D - D and E are both intermediate parameters used for simplification. + E - Both E and E are 6×6 matrices of intermediate variables. E is also an intermediate variable. Minimize the objective function to solve for the transformation vector ξ. The derivative of the objective function with respect to the transformation vector ξ and the solution of the linear equation system yield formula (18):
[0059]
[0060] In the above formula, It is the negative average vector after removing pseudo-speculatives, satisfying formula (19):
[0061]
[0062] Transform vector It contains a translation vector v and a rotation vector ω, so the convergence parameter is given by formula (20):
[0063]
[0064] In the above formula, R is a 3×3 rotation matrix, t is a 1×3 translation matrix, and ω is the antisymmetric matrix corresponding to ω. When ω=[δx,δy,δz], ω is as shown in formula (21):
[0065]
[0066] In the above formula, δx, δy, and δz are the minute quantities in the x, y, and z directions of the rotation vector, respectively.
[0067] Furthermore, in step 7, to eliminate the influence of various abnormal measurement points on the registration results, that is, to ensure that the ideal registration position is not disturbed by abnormal measurement points, the error evaluation function WRMSE of the pseudo-weighted variance minimization algorithm is established as shown in formula (22):
[0068]
[0069] Where, d kVT =(p k -q j ) T n j d is the distance from the positive measuring point to the tangent plane. sVT =(p s -q j ) T n j w is the distance from the negative measuring point to the tangent plane. k and w s The positive and negative spurious weights are respectively, satisfying formulas (7) and (8); It is the mean normal distance of all positive measuring points. It is the mean normal distance of all negative measuring points, where m and n are the number of positive and negative measuring points, respectively.
[0070] The beneficial effects of this invention are:
[0071] This invention fully considers the matching distortion caused by various anomalous point clouds, and constructs a novel weighting function to distinguish between normal point clouds, controllable anomalous point clouds, and uncontrollable anomalous point clouds. It is particularly effective in suppressing point clouds with large structural deviations, improving registration accuracy, avoiding matching tilt, and overcoming the matching distortion of traditional algorithms when faced with structural deviations, uneven allowances, and inherent defects in point cloud measurement. Furthermore, the adaptive coordination distance established by unifying point-to-point distance and point-to-surface distance ensures that the algorithm converges in the correct direction, enhancing its stability. This algorithm is suitable for fine registration of workpieces with a large number of anomalous point clouds, especially for fine registration of large and complex workpieces. Compared with traditional algorithms, it features high accuracy, strong stability, and resistance to anomalous interference. Attached Figure Description
[0072] Figure 1 Flowchart of the pseudo-spurious weighted variance minimization algorithm for fine registration.
[0073] Figure 2 A physical image of the flywheel housing in an embodiment of the present invention.
[0074] Figure 3 Comparison of structural deviations between the measured point cloud of the flywheel housing and the CAD model.
[0075] Figure 4Comparison of local registration errors between DPWVM and WPMAVM algorithms.
[0076] Figure 5 The chromatograms of local registration errors of flywheel housings using different algorithms are shown. Figure 5 (a) is a chromatogram of the local registration error of the flywheel housing in the ICP algorithm. Figure 5 (b) is a chromatogram of the local registration error of the flywheel housing in the VMM algorithm. Figure 5 (c) is a chromatogram of the local registration error of the flywheel housing in the DPWVM algorithm.
[0077] Figure 6 This is a diagram showing the global registration error of the flywheel housing local registration and positioning using the ICP, VMM, and DPWVM algorithms in this embodiment of the invention.
[0078] Figure 7 This is a chromatogram of the global registration error of the flywheel housing in different algorithms in the embodiments of the present invention. Figure 7 (a) is a chromatogram of the global registration error for the local registration of the flywheel housing in the ICP algorithm. Figure 7 (b) is a chromatogram of the global registration error for the local registration positioning of the flywheel housing using the VMM algorithm. Figure 7 (c) is a chromatogram of the global registration error of the flywheel housing local registration positioning in the DPWVM algorithm. Detailed Implementation
[0079] The embodiments of the present invention will be further described in detail below with reference to an automobile flywheel housing and accompanying drawings. The following examples are for illustrative purposes only and should not be construed as limiting the scope of the invention.
[0080] To achieve the above objectives, the technical solution of the present invention is as follows:
[0081] This invention provides a method for fine registration of workpiece point clouds based on a pseudo-removal weighted variance minimization algorithm. The algorithm flowchart is shown below. Figure 1 As shown, Figure 2 The image shows an actual car flywheel housing. As can be seen, it has a very complex structure and large size (maximum diameter 600mm). Due to factors such as temperature, uneven flywheel housing wall thickness, and the on-site manufacturing environment, the actual workpiece and the ideal model will always have certain structural deviations and abnormal allowances. Figure 3 This invention addresses the structural deviation between the scanned point cloud of the physical object and the CAD model. The proposed algorithm for minimizing the weighted variance effectively suppresses the impact of significant structural deviations and abnormal margins on registration accuracy, achieving high-precision registration of the flywheel housing.
[0082] Step 1: Discretize the CAD model into a point cloud model as the target point cloud Q. Calculate and orient the target point cloud normal vector based on Open3D library functions. Use a 3D scanner to acquire the measurement point cloud as the source point cloud P.
[0083] Step 2: Use the Kdtree algorithm to perform a bidirectional search on the target point cloud and the source point cloud to obtain the nearest neighbor pair set. A measurement point in the source point cloud and the point cloud in the target point cloud that is closest to that measurement point form a nearest neighbor pair, or simply a point pair. Based on the positional relationship between the target point cloud normal vector and the distance vectors between the measurement point and the nearest neighbor point, divide the source point cloud P into a forward measurement point set P. k (p1,p2,p3…p k …p m ) and the negative measurement point set P s (p1,p2,p3…p s …p n ), p k This represents the k-th forward measuring point, where m is the total number of forward measuring points in the source point cloud, and p s Let represent the s-th negative positive measurement point, n be the total number of negative measurement points in the source point cloud, and the total number of source point clouds be m+n;
[0084] Step 3: Establish an adaptive coordination distance by unifying the point-to-point distance and point-to-surface distance of the nearest neighbor pair set, connected by the binary symbol η, where η = 0 or η = 1, and adjust the adaptive coordination distance in real time.
[0085] Step 4: Establish a weighting function to divide the source point cloud P into normal point cloud, controllable abnormal point cloud and uncontrollable abnormal point cloud based on the point-to-point distance range, and apply different degrees of proportional weight to each point-to-point distance to reduce the impact of abnormal point cloud on registration accuracy.
[0086] Step 5: Establish the objective function of the pseudo-removal weighted variance minimization algorithm based on the adaptive coordination distance and weight function, which is used to solve the rigid body transformation matrix for fine registration of CAD point cloud and measurement point cloud;
[0087] Step 6: Apply the rigid body transformation matrix calculated in Step 5 to the measurement point cloud to update the measurement point cloud (source point cloud);
[0088] Step 7: Define the error evaluation function for point clouds with structural deviations, uneven margins, and inherent measurement defects.
[0089] Step 8: Repeat steps 2-7 until the convergence condition is met: number of iterations M > M max Finally, the rigid body transformation parameters T for precise registration are obtained. In this embodiment, M max =20.
[0090] like Figure 4As shown, after iteratively registering the local point cloud of the flywheel shell 20 times using the WPMAVM algorithm, it gets stuck in a local optimum WRMSE = 0.191mm. After changing the distance to an adaptive coordination distance, the algorithm can converge normally to WRMSE = 0.146mm. Based on this, the weight function in step 4 is used to obtain the DPWVM algorithm, which further converges to WRMSR = 0.103mm. Figure 5 The chart shows the local registration error of the flywheel shell by mapping the point-to-normal distance to color. It can be seen that the DPWVM algorithm is significantly better than the VMM and ICP algorithms. After removing the structural deviation point cloud, the error remains near 0.
[0091] To further demonstrate the superiority of the DPWVM algorithm, global errors were simulated by using local registration to locate the global 4 million flywheel shell measurement point cloud, such as... Figure 6 As shown, the DPWVM algorithm significantly outperforms the ICP and VMM algorithms, with a WRMSE of 0.29 mm. Figure 7 The color spectrum of the local registration and global registration error of the flywheel housing is mapped to the normal distance between points and colors. It can be seen that the ICP and VMM algorithms show obvious matching skew, while the registration result of the DPWVM algorithm does not show obvious matching skew, and the error is uniform and stays near 0.
[0092] It should be noted that in step 1, the estimate_normals function in Open3D is used to calculate the normal vector of the target point cloud, and the orient_normals_consistent_tangent_plane function is used to orient the normal vector.
[0093] It should be noted that in step 2, the method for distinguishing between positive and negative measuring points applies to the positive measuring point p. k and negative measuring point p s p k satisfy p s satisfy q j To be compatible with source point cloud p k and p s The nearest neighbor point cloud, n j Is the target point cloud q j The normal vector of a point It is the normal vector n j The transpose of .
[0094] It should be noted that in step 3, the adaptive coordination distance is established as follows:
[0095] Step 3.1, Adaptive Coordination Distance d iV Includes positive adaptive coordination distance d kV and negative adaptive coordination distance dsV Let i∈[1,m+n], and define ω∈R. 3 and ν∈R 3 Let R be the rotation vector and translation vector. 3 Representing the distance function d between two points in three-dimensional space, where the distance is from one point to the other. iI The first-order Taylor approximation is as follows:
[0096] Point-to-point distance d iI That is, update the distance from the point to its nearest neighbor, as shown in formula (1):
[0097]
[0098] in, It is the transformation vector, P i It corresponds to the i-th measurement point p i The antisymmetric matrix of three-dimensional coordinates, I 3×3 It is a 3×3 identity matrix, and the distance d between the midpoints of a point is... iI When ξ0=0 6×1 The first-order Taylor expansion at the point is given by formula (2):
[0099] d iI (ξ)=d iI (ξ0)+[▽d iI (ξ0)] T ξ Formula (2)
[0100] Where, d iI (ξ0)=||p i -q j ||, ξ0 is the 6×1 transformation zero vector, ▽d iI (ξ0) is the first-order gradient of the transformation vector ξ, ▽d iI The calculation process for (ξ0) is shown in formula (3):
[0101]
[0102] Where A and B are intermediate parameters, Let q represent the normalized nearest neighbor distance vector. j Indicates the centering of the point and the measurement point p. i For the target point, d iI The first-order approximation can be expressed as formula (4):
[0103]
[0104] Step 3.2: Establish the point-to-plane distance function, as shown in formula (5):
[0105]
[0106] Where, diT Let F be the distance from the midpoint of a point to the plane, and n be a distance function. j Let q represent the j-th target point cloud. j The normal vector at point n iT =n j It is q j The normal vector of the tangent at that point, It is a transformation vector.
[0107] Step 3.3: Establish the adaptive coordination distance function d iV As in formula (6):
[0108]
[0109] Where η represents the binary symbol, n iV =ηn iT +(1-η)n iI n iV Adaptive coordination distance function d iV The coordination vector, n iT d is the distance function from a point to a plane. iT The coordination vector, n iI It is the coordinate vector of the point-to-point distance function; η = 0 or η = 1, n iI The direction and n iT Maintaining consistency; when η = 0, both normal and tangent constraints exist, improving convergence stability but reducing convergence speed; when η = 1, based on distance d... iT For convergence, only normal constraints exist, at which point the algorithm exhibits quadratic convergence speed. During convergence, tangent constraints can effectively prevent erroneous convergence and even suppress algorithm divergence, improving algorithm stability. Therefore, in the initial stage of fine registration, let η = 0, based on distance d... iI To ensure convergence, the algorithm converges in the correct direction; later, η = 1 is set, based on the distance d. iT Achieve rapid convergence.
[0110] It should be noted that in step 4, the distance weight function is established as follows:
[0111] Step 4.1: Establish the distance weighting function for all positive measurement points, as shown in formula (7):
[0112]
[0113] Among them, w k For all positive measurement points, the distance weight function (or weight value) is d. kV For positive adaptive coordination distance, is the mean of the positive adaptive coordination distance, m is the number of positive measurement points, k∈[1,m], α1, α2, μ are all adaptive scaling factors, and α1, α2∈(0,+∞], α1<α2, μ∈[1,+∞]; when the adaptive coordination distance d kV less than twice the mean distance When the point cloud is considered a normal point cloud, its weight is 1; when the point pair adaptively coordinates the distance d... kV greater than twice the mean distance less than μ+1 times the mean distance At that time, the point cloud is considered a controllable anomalous point cloud, and the weight value and adaptive coordination distance d are... kV When the correlation is negative, the distance shrinks by a smaller proportion; when the point pair adaptively coordinates the distance d kV Distance from the mean greater than μ+1 The point cloud is considered an uncontrollable anomalous point cloud, and the weight values and adaptive coordination distance d are... kV The correlation is negative, and the distance is shrunk by a large proportion. When the number of structural deviation point clouds is large, μ should be reduced as much as possible, and vice versa; when the degree of structural deviation is large, α2 should be increased as much as possible, and vice versa. In this embodiment, α1 = 0.5, α2 = 8, μ = 1, and w k The function can be adjusted according to specific circumstances, as follows:
[0114]
[0115] Step 4.2: Establish the distance weight function for all negative measurement points, as shown in formula (8):
[0116]
[0117] Among them, w s For all negative measurement points, the distance weight function (or weight value) is d. sV For negative adaptive coordination distance, is the mean of the negative adaptive coordination distance, n is the number of negative measurement points, s∈[1,n]; α1, α2, μ are all adaptive scaling factors, and α1, α2∈(0,+∞], α1<α2, μ∈[1,+∞]; when the point pair adaptive coordination distance d sV less than twice the mean distance When the point cloud is considered a normal point cloud, its weight is 1; when the point pair adaptively coordinates the distance d... sV greater than twice the mean distance less than μ+1 times the mean distance At that time, the point cloud is considered a controllable anomalous point cloud, and the weight value and adaptive coordination distance d are... sV When the correlation is negative, the distance shrinks by a smaller proportion; when the point pair adaptively coordinates the distance d sVDistance from the mean greater than μ+1 The point cloud is considered an uncontrollable anomalous point cloud, and the weight values and adaptive coordination distance d are... sV The correlation is negative, and the distance is shrunk by a large proportion. When the number of structural deviation point clouds is large, μ should be reduced as much as possible, and vice versa; when the degree of structural deviation is large, α2 should be increased as much as possible, and vice versa. In this embodiment, α1 = 0.5, α2 = 8, μ = 1, and w s The function can be adjusted according to specific circumstances, as follows:
[0118]
[0119] It should be noted that in step 5, the objective function of the pseudo-weighted variance minimization algorithm is established as shown in formula (9):
[0120]
[0121] in, Positive spurious removal weighted distance bias, satisfying For negative spurious removal weighted bias distance, satisfying The weighted adaptive coordination distance mean for all positive measurement points. The weighted adaptive coordination distance mean for all negative measurement points; d kV For the positive adaptive coordination distance, d sV For negative adaptive coordination distance; w k and w s It satisfies formulas (7) and (8).
[0122] It should be noted that in step 6, the transformation matrix of the nearest neighbor pair set of rigid bodies is solved as follows:
[0123] Adaptive coordination distance d iV Including positive adaptive coordination distance d kV and negative adaptive coordination distance d sV Establish distance functions as shown in formulas (10), (11), and (12):
[0124]
[0125]
[0126]
[0127] in, Both are scalars, A i A k A s All are 1×6 matrices, ξ is a 6×1 transformation vector matrix, and n iV Adaptive coordination distance diV The coordination vector, n kV It is the positive adaptive coordination distance d kV The coordination vector, n sV It is the negative adaptive coordination distance d sV The coordination vector; It is the positive measuring point p k The nearest neighbor target point, It is the negative measuring point p s The nearest neighbor target point.
[0128] For all positive measurement points, the derivation of the sum of squared distance deviations after removing false weights is as shown in formula (13):
[0129]
[0130] Substituting formula (11) into formula (13) yields formula (14):
[0131]
[0132] Among them, E + It is a 6×6 matrix, F + It is a 6×1 matrix, D + As a scalar, It is a pseudo-removed weighted positive average vector that satisfies formula (15):
[0133]
[0134] For all negative measurement points, the same derivation is performed on the sum of squared deviations of the weighted offset distance after removing false positives. Substituting formula (12) into it, we get formula (16):
[0135]
[0136] Therefore, the objective function of the pseudo-weighted variance minimization algorithm can be expressed as formula (19):
[0137]
[0138] G(R,t) is the objective function of the pseudo-removal weighted variance minimization algorithm, D + D - D and E are both intermediate parameters used for simplification. + E - E and E are both 6×6 matrices of intermediate variables. E is also an intermediate variable. Minimize the objective function to solve for the transformation vector ξ. The derivative of the objective function with respect to the transformation vector ξ and the solution of the linear equation system can be obtained by formula (18):
[0139]
[0140] In the above formula, It is the negative average vector after removing pseudo-speculatives, satisfying formula (19):
[0141]
[0142] Transform vector It contains a translation vector v and a rotation vector ω, so the convergence parameter is given by formula (20):
[0143]
[0144] In the formula, R is a 3×3 rotation matrix, t is a 1×3 translation matrix, and ω is the antisymmetric matrix corresponding to ω. When ω=[δx,δy,δz], ω is as shown in formula (21):
[0145]
[0146] In the above formula, δx, δy, and δz are the minute quantities in the x, y, and z directions of the rotation vector, respectively.
[0147] It should be noted that in step 7, in order to eliminate the influence of various abnormal measurement points on the registration results, that is, to ensure that the ideal registration position is not disturbed by abnormal measurement points, the error evaluation function WRMSE of the pseudo-removal weighted variance minimization algorithm is established as shown in formula (22):
[0148]
[0149] Where, d kVT =(p k -q j ) T n j d is the distance from the positive measuring point to the tangent plane. sVT =(p s -q j ) T n j w is the distance from the negative measuring point to the tangent plane. k and w s The positive and negative spurious weights are respectively, satisfying formulas (7) and (9); It is the mean normal distance of all positive measuring points. It is the mean normal distance of all negative measuring points, where m and n are the number of positive and negative measuring points, respectively.
Claims
1. A workpiece point cloud fine registration method based on a pseudo- weighted variance minimization algorithm, characterized in that, Comprising the following steps: Step 1, discretize the CAD model into a point cloud model as the target point cloud Q, complete the target point cloud normal vector calculation and orientation based on the Open3D library function, and use a three-dimensional scanner to obtain a measured point cloud as the source point cloud P; Step 2, using Kdtree algorithm to search the target point cloud and source point cloud bidirectional search to obtain the nearest neighbor point pair set, a measuring point in the source point cloud and the nearest point in the target point cloud form a pair of nearest neighbor points, based on the position relationship between the point pairs of the target point cloud and the source point cloud P, the source point cloud P is divided into forward measuring point set P k (p1, p2, p3…p k …p m ) and negative measuring point set P s (p1, p2, p3…p s …p n ), p k represents the kth forward measuring point, m is the total number of forward measuring points in the source point cloud, p s represents the s-th negative forward measuring point, n is the total number of negative forward measuring points in the source point cloud, and the total number of source point clouds is m+n; Step 3, unify the point-to-point distance and the point-to-plane distance in the nearest neighbor point pair set to establish an adaptive coordination distance, connected by a binary symbol η, η=0 or η=1, and adjust the adaptive coordination distance in real time; Step 4, establish a weight function to divide the source point cloud P into normal point cloud, controllable abnormal point cloud and uncontrollable abnormal point cloud according to the point pair distance range, and apply different degrees of proportional weight to each point pair distance, thereby reducing the influence of abnormal point cloud on the registration accuracy; Step 5, based on the adaptive coordination distance and the weight function, establish the objective function of the pseudo-elimination weighted variance minimization algorithm, which is used to solve the rigid transformation matrix between the target point cloud Q and the source point cloud P based on the CAD model; Step 6, use the rigid transformation matrix calculated in step 5 to act on the measured point cloud, thereby updating the measured point cloud; Step 7, define the error evaluation function when there are structural deviation point clouds, residual uneven point clouds and measurement inherent defects; Step 8, repeat steps 2-7 until a convergence condition is reached: iteration number M > M max and finally obtain the fine registration rigid body transformation parameters T.
2. The workpiece point cloud fine registration method based on a pseudo-weighted variance minimization algorithm according to claim 1, characterized in that: Step 3 specifically comprises the following steps: Step 3.1, Adaptive coordination distance d iV Including positive adaptive coordination distance d kV And negative adaptive coordination distance d sV , i∈[1,m+n], define ω∈R 3 And ν∈R 3 Rotational vector and translational vector respectively, R 3 Indicates a three-dimensional space, the midpoint to the point distance function d iI First-order Taylor approximation as follows: Single step transform after nearest neighbor point pair midpoint to point distance d iI i.e. update point p i+ to its nearest neighbor point q j distance as in equation (1): where is the transformation vector, P i is the i-th measurement point p i is the anti-symmetric matrix of the three-dimensional coordinates, I 3×3 is the 3x3 identity matrix, the point-to-point distance d iI The first-order Taylor expansion at ξ0= 0 6×1 is formula (2): where d iI (ξ0) = ||p i -q j ||, ξ0is a 6x1 conversion zero vector, is the first order gradient of conversion vector ξ, The calculation process is as formula (3): where A, B are intermediate parameters, denotes the unitized nearest neighbor pair distance vector, q j denotes the point pair distance between the measurement point p i corresponding to the target point, d iI The first order approximation is given by equation (4): Step 3.2, establish a point-to-plane distance function, as formula (5): where d iT is the point-to-midpoint-to-plane distance, F is a distance function, n j is the normal vector at the jth target point cloud q j , n iT = n j , is the conversion vector; Step 3.3, Establishing an adaptive coordination distance function d iV As equation (6): wherein η represents a binary symbol, n iV = ηn iT +(1-η)n iI , n iV is a coordinate vector of the adaptive coordination distance function d iV , n iT is a coordinate vector of the adaptive coordination distance function d iT , n iI is a coordinate vector of the adaptive coordination distance function d iI ; η = 0 or η = 1, n iT is consistent with n iT ; when η = 0, both the normal constraint and the tangent constraint exist, the convergence stability is improved, but the convergence speed is reduced; when η = 1, the convergence is based on the distance d iI , only the normal constraint exists, and the algorithm has a quadratic convergence speed at this time; in the convergence process, the tangent constraint can effectively prevent false convergence and even suppress algorithm divergence, and improve the stability of the algorithm; therefore, in the initial stage of fine registration, η = 0 is allowed, the convergence is based on the distance d iT , and the algorithm is ensured to converge in the correct direction; in the later stage, η = 1 is allowed, and fast convergence is based on the distance d iT .
3. The workpiece point cloud fine registration method based on the pseudo-weighted variance minimization algorithm according to claim 2, characterized in that: Step 4 specifically comprises the following steps: Step 4.1, establish the distance weight function of all forward measuring points, as formula (7): Among them, w k Let d be the distance weighting function for all positive measurement points. kV For positive adaptive coordination distance, is the mean of the positive adaptive coordination distance, m is the number of positive measurement points, k∈[1,m], α1, α2, μ are all adaptive scaling factors, and α1, α2∈(0,+∞], α1<α2, μ∈[1,+∞]; when the adaptive coordination distance d kV less than twice the mean distance When the point cloud is considered a normal point cloud, its weight is 1; when the point pair adaptively coordinates the distance d... kV greater than twice the mean distance less than μ+1 times the mean distance At that time, the point cloud is considered a controllable anomalous point cloud, and the weight value and adaptive coordination distance d are... kV When the correlation is negative, the distance shrinks by a smaller proportion; when the point pair adaptively coordinates the distance d kV Distance from the mean greater than μ+1 The point cloud is considered an uncontrollable anomalous point cloud, and the weight values and adaptive coordination distance d are... kV The correlation is negative, so the distance should be reduced by a large proportion. When the number of structural deviation point clouds is large, μ should be reduced as much as possible, and vice versa. When the degree of structural deviation is large, α2 should be increased as much as possible, and vice versa. Step 4.2, establish the distance weight function of all negative measuring points, as formula (8): Among them, w s Let d be the distance weighting function for all negative measurement points. sV For negative adaptive coordination distance, is the mean of the negative adaptive coordination distance, n is the number of negative measurement points, s∈[1,n]; α1, α2, μ are all adaptive scaling factors, and α1, α2∈(0,+∞], α1<α2, μ∈[1,+∞]; when the point pair adaptive coordination distance d sV less than twice the mean distance When the point cloud is considered a normal point cloud, its weight is 1; when the point pair adaptively coordinates the distance d... sV greater than twice the mean distance less than μ+1 times the mean distance At that time, the point cloud is considered a controllable anomalous point cloud, and the weight value and adaptive coordination distance d are... sV When the correlation is negative, the distance shrinks by a smaller proportion; when the point pair adaptively coordinates the distance d sV Distance from the mean greater than μ+1 The point cloud is considered an uncontrollable anomalous point cloud, and the weight values and adaptive coordination distance d are... sV The correlation is negative, and the distance is shrunk by a large proportion. When the number of structural deviation point clouds is large, μ should be reduced as much as possible, and vice versa. When the degree of structural deviation is large, α2 should be increased as much as possible, and vice versa.
4. The workpiece point cloud fine registration method based on a pseudo-weighted variance minimization algorithm according to claim 1, characterized in that: In step 1, the estimate_normals function in Open3D is used to complete the target point cloud normal vector calculation, and the orient_normals_consistent_tangent_plane function is used to complete the orientation of the normal vector.
5. The workpiece point cloud fine registration method based on the pseudo-weighted variance minimization algorithm according to claim 4, characterized in that, In step 2, the positive and negative measurement point differentiation method, for the positive measurement point p k and the negative measurement point p s , p k satisfies p s satisfies q j is the target point cloud closest to the source point cloud p k and p s , n j is the normal vector at the target point cloud q j , n j is the transpose vector of the normal vector n .
6. The workpiece point cloud fine registration method based on a pseudo-weighted variance minimization algorithm according to claim 5, characterized in that, In step 5, the objective function of the pseudo-elimination weighted variance minimization algorithm is established as formula (9): wherein, a positive pseudo-weighted distance deviation, satisfying a negative pseudo-weighted deviation distance, satisfying is a weighted adaptive coordination distance mean of all positive measuring points, is a weighted adaptive coordination distance mean of all negative measuring points; d kV is a positive adaptive coordination distance, d sV is a negative adaptive coordination distance; w k and w s satisfy formula (7) and formula (8).
7. The workpiece point cloud fine registration method based on a pseudo-weighted variance minimization algorithm according to claim 6, characterized in that, In step 6, the rigid transformation matrix of the nearest neighbor point pair set is solved as follows: Adaptive coordination distance d iV including positive adaptive coordination distance d kV and negative adaptive coordination distance d sV The distance function is established as formula (10), formula (11) and formula (12): wherein, are scalars, A i , A k , A s are 1x6 matrices, ξ is a 6x1 conversion vector matrix, n iV is a positive adaptive coordination distance d iV vector of n kV is a positive adaptive coordination distance d kV vector of n sV is a negative adaptive coordination distance d sV vector of n is a positive nearest neighbor target point of a measurement point p k , is a negative nearest neighbor target point of a measurement point p s ; For all forward measuring points, the pseudo-elimination weighted distance deviation square sum is derived as formula (13): Substitute formula (11) into formula (13) to obtain formula (14): where E + is a 6x6 matrix, F + is a 6x1 matrix, D + is a scalar, is a pseudo-weighted forward average vector, satisfying formula (15): For all negative measuring points, the pseudo-elimination weighted deviation distance square sum is derived in the same way, and formula (12) is substituted into it to obtain formula (16): Therefore, the objective function of the pseudo-elimination weighted variance minimization algorithm can be represented as formula (17): G(R,t) is the objective function of the pseudo-removal weighted variance minimization algorithm, D + D - D and E are both intermediate parameters used for simplification. + E - E and E are both 6×6 matrices of intermediate variables. Minimize the objective function to solve for the transformation vector ξ. The derivative of the objective function with respect to the transformation vector ξ and the solution of the linear equation system yield formula (18): In the above formulae, is the de-pseudoweighted negative average vector, satisfying formula (19): conversion vector The convergence parameter is given by equation (20) as the sum of the translation vector v and the rotation vector ω: In the above formula, R is a 3x3 rotation matrix, t is a 1x3 translation matrix, and ω is the skew-symmetric matrix corresponding to ω. When ω=[δx, δy, δz], ω is as formula (21): In the above formula, δx, δy, and δz are the infinitesimal amounts of rotation vectors x, y, and z in the x, y, and z directions, respectively.
8. The workpiece point cloud fine registration method based on a pseudo-weighted variance minimization algorithm according to claim 7, characterized in that, In step 7, in order to eliminate the influence of various abnormal measuring points on the registration result, i.e. the ideal position of registration is not disturbed by abnormal measuring points, the error evaluation function WRMSE of the pseudo-elimination weighted variance minimization algorithm is established as formula (22): where d kVT = (p k - q j ) T n j is the distance of the positive measuring point to the tangent plane, d sVT = (p s - q j ) T n j is the distance of the negative measuring point to the tangent plane; w k and w s are the positive and negative de-aliasing weights, respectively, satisfying formula (7) and formula (8); is the normal distance mean of all positive measuring points, is the normal distance mean of all negative measuring points, and m and n are the number of positive measuring points and negative measuring points, respectively.
Citation Information
Patent Citations
Distance variance minimization-based workpiece point cloud matching algorithm
CN104867136A
Workpiece optical measurement method based on weighted positive and negative margin variance minimization algorithm
CN113029049B
Three-dimensional measurement point cloud optimization registration method
CN108564605A
Complex workpiece optical measurement method based on weighted positive and negative allowance variance minimization algorithm
CN113029049A