A method for measuring defects of a curved workpiece based on point cloud registration
By using a graph-optimized point cloud registration method, which optimizes the objective function using multimodal residuals and robust kernel functions, the problem of unstable point cloud registration for complex curved surface workpieces is solved, achieving high-precision defect detection and making it suitable for quality control of complex curved surface workpieces.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- WUHAN INST OF TECH
- Filing Date
- 2026-02-28
- Publication Date
- 2026-05-22
AI Technical Summary
Existing point cloud inspection technologies struggle to establish stable and reliable correspondences when dealing with complex curved surfaces, leading to inaccurate dimensional measurements and defect detection results. In particular, traditional point cloud registration methods are prone to registration instability and error accumulation when there are local occlusions, noise interference, and uneven sampling densities.
A graph optimization-based point cloud registration method is adopted. By constructing a graph optimization model, matching point pairs are regarded as edges in the graph structure, and multimodal residuals (including geometric residuals, normal vector residuals and curvature residuals) are defined for optimization. Combined with robust kernel functions and adaptive weights, high-precision point cloud registration is achieved.
It significantly improves the global convergence and stability of point cloud registration, enhances the detection accuracy and robustness of complex curved surface workpieces, can obtain accurate registration results under noise and occlusion conditions, and enhances the applicability of the method in actual industrial inspection environments.
Smart Images

Figure CN121746397B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of industrial parts inspection, and specifically to a method for measuring defects in curved workpieces based on point cloud registration. Background Technology
[0002] In the production of industrial parts, the integrity of the part surface often directly affects the pass rate of part production. Currently, due to the wide variety of industrial parts, inconsistent sizes, and complex surface shapes, traditional quality inspection methods mainly rely on manual measurement, contact gauges, or coordinate measuring machines, which have problems such as cumbersome operation, low efficiency, high cost, and difficulty in adapting to online inspection.
[0003] In recent years, non-contact inspection technology based on 3D point clouds has gradually become a research hotspot. By acquiring 3D point cloud data of the workpiece surface through methods such as structured light laser scanning and photogrammetry, and then comparing it with the design model, dimensional measurement and morphological analysis can be achieved.
[0004] However, in existing point cloud detection technologies, the point cloud data of workpieces collected in industrial sites generally suffers from objective factors such as local occlusion, noise interference, and uneven sampling density. This makes point cloud registration methods based on single geometric constraints or local optimal strategies prone to registration instability and error accumulation in practical applications.
[0005] Especially when dealing with industrial parts with free-form surfaces, significant local concave-convex variations, and complex edge features, traditional point cloud registration and comparison methods struggle to establish stable and reliable correspondences globally, thus affecting the accuracy of subsequent dimensional measurements and defect detection results. Summary of the Invention
[0006] The main objective of this invention is to provide a method for measuring defects in curved workpieces based on point cloud registration. This method acquires point cloud data of the workpiece using line structured light, converts the CAD model of the workpiece into point cloud modeling, and then registers the two-stage point cloud through graph-optimized multimodal residual registration, thereby achieving high-precision three-dimensional detection and automatic defect identification of curved workpieces.
[0007] To solve the above-mentioned technical problems, the technical solution adopted by the present invention is as follows:
[0008] In a first aspect, the present invention provides a method for measuring defects in curved workpieces based on point cloud registration, the method comprising:
[0009] S1. Obtain the 3D point cloud model and theoretical point cloud model of the workpiece, and determine the corresponding matching point pairs;
[0010] S2. Based on matching point pairs, a graph-optimized point cloud registration method is used to rigidly register the 3D point cloud model with the theoretical point cloud model. Specifically, this includes:
[0011] S21. Based on the matching point pairs, construct a graph optimization model. The graph optimization model regards each matching point pair as an edge in the graph structure and defines the registration error as a multimodal residual including geometric residual, normal vector residual and curvature residual.
[0012] S22. An optimization objective function is constructed by combining multimodal residuals and robust kernel functions, and the global optimal rigid transformation matrix is solved based on graph optimization algorithm to achieve point cloud registration; wherein, the rigid transformation matrix includes rotation matrix and translation vector;
[0013] S3. Based on the point cloud registration results, calculate the multimodal residual norm of each point and generate a residual heatmap.
[0014] S4. Identify defect areas using residual heatmaps.
[0015] Following the above technical solution, multimodal residual Defined as:
[0016] ;
[0017] Among them, geometric residuals Normal vector residual Curvature residual ; , and These are the adaptive weights of the residuals for each component; and For the first i Group matching point pairs; For rotation matrix, It is a translation vector; Let be the normal vector of the corresponding point. The curvature of the corresponding point; The scaling parameter for the curvature residual; To prevent constants from being divided by zero;
[0018] The objective function is then optimized as follows:
[0019] ;
[0020] in, For robust kernel functions; This represents the total number of matching point pairs.
[0021] Following the above technical solution, the adaptive weights of the residuals for each component are:
[0022] ;
[0023] ;
[0024] ;
[0025] in, To match confidence levels; The density correction factor is used to characterize the density of the point cloud distribution of the matching points in their local neighborhood and to weight the geometric residual term to compensate for the impact of uneven point cloud sampling density on the registration results. is the scaling parameter of the normal vector residual.
[0026] Following the above technical solution, density correction factor for:
[0027] ;
[0028] in, For local point cloud density, The average density of the global point cloud. To prevent regularization terms with a denominator of zero.
[0029] Following the above technical solution, the multimodal residual norm is defined as the corresponding multimodal residual. The Euclidean norm, i.e.:
[0030] ;
[0031] in, The multimodal residual norm is used to characterize the overall deviation between the corresponding points in the point cloud and the theoretical model in terms of geometric shape consistency. The multimodal residual norm is used to enhance the discriminative power of local anomaly regions on the surface in the residual distribution.
[0032] Following the above technical solution, the theoretical point cloud model of the workpiece is obtained by using mesh surface segmentation and grid sampling methods.
[0033] The above technical solution includes:
[0034] Statistical analysis is performed on the multimodal residual norm of the registered point cloud to obtain the distribution characteristics of the multimodal residual norm in the whole or local area of the workpiece.
[0035] Based on the aforementioned distribution characteristics, an adaptive multimodal residual norm threshold is determined to distinguish between normal and abnormal regions:
[0036] ;
[0037] in, The multimodal residual norm threshold; The mean of the multimodal residual norm. The standard deviation of the multimodal residual norm; This is a correction factor;
[0038] Correction coefficient The calculation formula is as follows:
[0039] ;
[0040] In the formula, The base correction factor; For the allowable dimensional tolerances of the workpiece, The standard tolerance reference value;
[0041] Select a multimodal residual norm that exceeds the multimodal residual norm threshold. The points are used as candidate defect points to form a candidate defect point cloud;
[0042] Based on the defect candidate point cloud, each defect region is identified, and the location, size, and maximum multimodal residual norm of each defect region are determined.
[0043] Following the above technical solution, density clustering algorithm is used to identify each defect region, specifically:
[0044] The neighborhood radius of the density clustering algorithm is determined based on the spatial distribution characteristics of the defect candidate point cloud.
[0045] ;
[0046] in, The neighborhood radius, This is a preset proportional coefficient. The average point spacing of the candidate point cloud for defects;
[0047] The minimum number of points required for the density clustering algorithm is determined based on the spatial distribution characteristics of the defect candidate point cloud and the multimodal residual norm.
[0048] ;
[0049] in, To be the minimum number of points, For adjustment coefficients, The neighborhood radius of all points in the candidate point cloud for defects The average number of points within;
[0050] Cluster the candidate point cloud of defects based on the neighborhood radius and the minimum number of points to form a continuous cluster of defect points, and remove isolated noise points.
[0051] The cluster of defect points is identified as the defect region.
[0052] In a second aspect, the present invention provides a computer device / apparatus / system, including a memory, a processor, and a computer program stored in the memory, wherein the processor executes the computer program to implement the steps of the method described in the first aspect.
[0053] Thirdly, the present invention provides a computer-readable storage medium having a computer program / instructions stored thereon, which, when executed by a processor, implement the steps of the method described in the first aspect.
[0054] In summary, compared with the prior art, the above-described technical solutions conceived by this invention can achieve the following beneficial effects:
[0055] This invention provides a method for measuring defects in curved workpieces based on point cloud registration. It acquires a 3D point cloud model of the workpiece and a theoretical point cloud model, and performs rigid registration using a graph optimization-based point cloud registration method. The matching point pairs are constructed as a graph structure, and the registration error is defined as a multimodal residual including geometric, normal, and curvature residuals, which is then optimized. This method overcomes the shortcomings of single geometric distance residuals, which are easily affected by local features and trapped in local optima when registering complex curved surfaces, by combining the multimodal residuals (including geometric, normal, and curvature residuals) with a robust kernel function to construct an optimization objective function that jointly constrains the registration process. This significantly improves the global convergence, stability, and final alignment accuracy of the registration, laying a reliable foundation for subsequent high-precision defect detection.
[0056] Furthermore, this invention defines multimodal residuals as a weighted combination vector of geometric residuals, normal vector residuals, and curvature residuals, and constructs an optimization objective function containing a robust kernel function based on this. The normal vector strengthens the constraint on the consistency of local surface orientation, and the curvature residual strengthens the constraint on the consistency of local surface convexity and concavity, complementing the geometric position residuals. Combined with the robust kernel function, it can effectively improve matching accuracy. Thus, even in the presence of noise, occlusion, or poor initial matching, accurate and robust registration results can still be obtained, enhancing the applicability of the method in actual industrial testing environments.
[0057] Furthermore, this invention designs adaptive weights for each component of the multimodal residuals. The weight of the geometric residuals incorporates a density correction factor based on the ratio of local to global point cloud density, enabling dynamic sensing and compensation for the impact of uneven point cloud sampling density on registration. The geometric residual weights are appropriately reduced in dense point cloud regions and increased in sparse regions, thereby preventing excessive bias towards high-density areas during registration. This ensures the balance and overall optimality of the registration error distribution across the entire workpiece surface, improving registration accuracy and robustness.
[0058] Furthermore, this invention uses statistical analysis to determine an adaptive multimodal residual norm threshold to screen candidate defect points, and employs a parameter-adaptive density clustering algorithm to cluster the candidate points to identify continuous defect regions. This algorithm can be dynamically adjusted according to the actual tolerance requirements of the workpiece, improving the flexibility and accuracy of defect identification. In addition, the density clustering algorithm adaptively determines the neighborhood radius and minimum number of points based on the spatial distribution characteristics of the point cloud, effectively distinguishing between real continuous defects and isolated noise points, and accurately identifying each defect region. Attached Figure Description
[0059] Figure 1 This is a flowchart illustrating a method for measuring defects in curved workpieces based on point cloud registration, according to an embodiment of the present invention.
[0060] Figure 2 This is a schematic diagram of a CAD model of a curved workpiece according to an embodiment of the present invention;
[0061] Figure 3 This is a point cloud image of line structured light acquisition according to an embodiment of the present invention;
[0062] Figure 4 This is a rendering of a CAD model converted into a point cloud model according to an embodiment of the present invention;
[0063] Figure 5 This is a rendering of the point cloud model of the curved surface portion of a CAD model according to an embodiment of the present invention;
[0064] Figure 6 This is a residual heat map according to an embodiment of the present invention. Detailed Implementation
[0065] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the invention. All other embodiments obtained by those skilled in the art based on the embodiments provided by this invention without inventive effort are within the scope of protection of this invention.
[0066] Obviously, the accompanying drawings described below are merely some examples or embodiments of the present invention. Those skilled in the art can apply the present invention to other similar scenarios based on these drawings without any inventive effort. Furthermore, it is understood that although the efforts made in this development process may be complex and lengthy, for those skilled in the art related to the content disclosed in this invention, modifications to design, manufacturing, or production based on the technical content disclosed in this invention are merely conventional technical means and should not be construed as insufficient disclosure of the present invention.
[0067] In this invention, the reference to "embodiment" means that a specific feature, structure, or characteristic described in connection with an embodiment may be included in at least one embodiment of the invention. The appearance of this phrase in various places in the specification does not necessarily refer to the same embodiment, nor is it a mutually exclusive, independent, or alternative embodiment. It will be explicitly and implicitly understood by those skilled in the art that the embodiments described in this invention may be combined with other embodiments without conflict.
[0068] Unless otherwise defined, the technical or scientific terms used in this invention shall have the ordinary meaning understood by one of ordinary skill in the art to which this invention pertains. The terms "a," "an," "an," "the," and similar words used in this invention do not indicate quantity limitation and may indicate singular or plural. The terms "comprising," "including," "having," and any variations thereof used in this invention are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or device that includes a series of steps or modules (units) is not limited to the listed steps or units, but may also include steps or units not listed, or may include other steps or units inherent to these processes, methods, products, or devices. The terms "connected," "linked," "coupled," and similar words used in this invention are not limited to physical or mechanical connections, but may include electrical connections, whether direct or indirect. "A plurality" used in this invention refers to two or more. "And / or" describes the relationship between related objects, indicating that three relationships may exist; for example, "A and / or B" can represent: A alone, A and B simultaneously, and B alone. The character " / " generally indicates that the preceding and following objects have an "or" relationship. The terms "first," "second," and "third" used in this invention are merely to distinguish similar objects and do not represent a specific ordering of the objects.
[0069] To identify potential local defects in curved workpieces produced in industry, this invention provides a method for measuring defects in curved workpieces based on point cloud registration. First, a CAD model of the curved workpiece is constructed based on the dimensional information provided in the design drawings. Then, laser line images of the workpiece surface are acquired using line structured light technology, and the image data is converted into three-dimensional coordinate values to form a point cloud model for display on the terminal. Next, the CAD model is converted from STL format to PCD format using mesh surface segmentation and raster sampling methods, achieving point cloud modeling. Finally, within a graph optimization framework, composite multimodal residuals (geometry, normal vector, curvature) and adaptive weights are used. ωThe method combines two point clouds and uses a robust kernel function to solve for the rigid transformation, achieving coarse and fine registration. Finally, based on this, residual analysis is performed on the spatial error between the registered point clouds, and a density clustering algorithm is used to automatically extract defect regions, thereby determining whether the workpiece has geometric defects. This method has advantages such as high accuracy and applicability to complex surface inspection, and can be widely applied in industrial manufacturing and quality control fields.
[0070] like Figure 1 As shown, the method for measuring defects in curved workpieces based on point cloud registration of the present invention mainly includes the following steps:
[0071] (1) Constructing a three-dimensional CAD model: Construct a three-dimensional CAD model of the workpiece based on the dimensional information of the curved workpiece provided in the three-dimensional design drawings.
[0072] First, using the dimensional information provided in the workpiece's 3D design drawings, a CAD 3D model of the workpiece is constructed. This step mainly involves generating a theoretical model of the workpiece based on the geometric information provided in the design drawings. During the CAD model construction process, SolidWorks software is used to model the workpiece, generating a 3D model with complete geometric dimensions. By comparing this model with scanned data of the actual workpiece surface, the quality of the actual workpiece can be effectively evaluated.
[0073] (2) Collect point cloud data of workpiece surface: Scan the actual workpiece surface through a line structured light scanning system, collect multiple frames of laser line images and convert them into corresponding three-dimensional point coordinate data to form a three-dimensional point cloud model of the workpiece to be tested.
[0074] In the actual workpiece inspection process, a line structured light scanning system is used to scan the workpiece surface, acquiring multiple frames of laser line images. Each pixel in the image is then converted into corresponding three-dimensional coordinate data, ultimately generating a three-dimensional point cloud model of the actual workpiece. The point cloud data consists of a large number of three-dimensional coordinate points, each with corresponding X, Y, and Z coordinate information in three-dimensional space, accurately reflecting the geometry of the workpiece surface.
[0075] The working principle of a line structured light scanning system is based on laser 3D measurement technology. It projects laser lines onto the workpiece surface and calculates the position of points based on the deformation of the reflected light. This method is suitable for workpieces with various complex surface shapes and can provide high-precision, high-efficiency 3D scanning results. During the scanning process, the acquired laser line images are converted into point cloud data, forming a 3D point cloud model of the workpiece.
[0076] (3) Theoretical point cloud model generation: The CAD model of the workpiece is converted from STL format to PCD format by using mesh surface segmentation and raster sampling to obtain the theoretical point cloud model.
[0077] To compare with actual point cloud data, the CAD model first needs to be converted into a theoretical point cloud model. A mesh facet segmentation and raster sampling method is used to convert the CAD model from STL format to PCD format (point cloud data format). STL format is a common format for CAD models, containing triangular mesh information of the 3D surface. Based on this, each triangular facet in the CAD model is first segmented, and a raster sampling method is used to uniformly sample each triangular facet, ensuring the uniform distribution of sampling points in space.
[0078] The grid sampling method generates a uniformly distributed set of points by sampling the interior of triangular facets at equal intervals. Each sampled point can be interpolated using the centroid coordinate method to determine its position in three-dimensional space. Ultimately, these sampled points are converted into point cloud data, forming a theoretical point cloud model that is compared with the actual workpiece scanning results. The theoretical point cloud model generated by this method can accurately reflect the design dimensions and shape of the workpiece.
[0079] (4) Graph optimization registration based on matching point pairs: Point pair constraints are constructed based on graph optimization algorithm, and the global optimal rigid transformation matrix is solved by multimodal residual metric method to realize point cloud registration.
[0080] Next, a graph optimization model is constructed based on the matching point pairs. The rigid transformation matrix is optimized using the nonlinear least squares method to achieve point cloud registration. The graph optimization model solves for the rigid transformation matrix by treating each pair of matching points as an edge in the graph structure and defining the registration error as a weighted combination of a composite multimodal residual vector (a combination of geometric residual, normal vector residual, and curvature residual). This transformation matrix consists of rotation and translation components, enabling the alignment of the theoretical point cloud with the actual point cloud.
[0081] Specifically, firstly, local geometric features are extracted from the theoretical and actual point clouds using feature extraction methods (such as FPFH), and preliminary matching is performed. During the matching process, fast search methods such as KD-trees are used to find the optimal correspondence between the theoretical and actual point clouds. Then, a graph optimization model is constructed, and graph optimization algorithms are used to optimize the matched point pairs to solve for the optimal rigid transformation matrix. By minimizing the multimodal residual norm between the matched point pairs, the optimal registration effect of the point clouds is achieved.
[0082] The core of this step is to globally optimize the point cloud registration process using a graph optimization algorithm, thereby achieving accurate alignment between the theoretical and actual point clouds. During the optimization process, a robust kernel function (Huber loss function) is introduced to reduce the impact of outliers on the registration results.
[0083] (5) Residual heatmap construction and analysis: In the registered point cloud, calculate the multimodal residual norm of each point and generate a residual heatmap.
[0084] After point cloud registration is completed, the multimodal residual norm of corresponding points in the actual point cloud and the theoretical point cloud is calculated based on the registration results. The multimodal residual norm is the Euclidean norm of the corresponding multimodal residual vector, which is used to comprehensively characterize the degree of deviation between the actual point cloud and the theoretical model in terms of local geometric shape consistency. The multimodal residual norm can be used to enhance the discriminativeness of local anomaly regions on the surface in the residual distribution.
[0085] By calculating the multimodal residual norm at each point, the deviation distribution of each region on the workpiece surface relative to the theoretical design model can be obtained. A residual heatmap is generated based on the multimodal residual norm, and the magnitude of the residuals is visualized using color mapping; the larger the multimodal residual norm, the darker the color of the corresponding point.
[0086] Residual heatmaps can effectively enhance the distinguishability of local abnormal areas on curved surfaces in the residual distribution, making potential geometric defect areas on the workpiece surface more prominent in the heatmap, and providing a reliable data foundation for the subsequent automatic identification of defect areas.
[0087] (6) Automatic identification and analysis of defect areas: Combine density clustering algorithm to analyze residual heat map, automatically identify error areas and determine whether there are geometric defects.
[0088] Based on the residual heatmap, the statistical distribution characteristics of the multimodal residual norm in the overall or local area of the workpiece are analyzed to obtain the distribution of the multimodal residual norm. Based on this, a multimodal residual norm threshold for distinguishing normal and abnormal regions is adaptively determined. Points with multimodal residual norms exceeding the threshold are marked as candidate defect points, forming a candidate defect point cloud.
[0089] Density clustering algorithm is used to perform clustering analysis on the candidate point cloud of defects. Specifically, based on the spatial distribution characteristics of the candidate point cloud of defects and the distribution of their corresponding multimodal residual norms, the neighborhood radius parameter and minimum number of points parameter in the density clustering algorithm are adaptively determined to adapt to defect characteristics of different scales and spatial density distributions.
[0090] Through the aforementioned parameter-adaptive density clustering process, the candidate point cloud of defects is clustered to form continuous defect point clusters, and isolated noise points are removed, thereby achieving automatic identification of defect regions. For the identified defect regions, their spatial location, size information, and maximum multimodal residual norm are further calculated. The spatial location of the defect region is determined by the cluster center, the size information is quantified using the bounding box, and the maximum multimodal residual norm is used to characterize the severity of the defect, thus providing a basis for subsequent quality assessment and defect handling.
[0091] This invention presents a point cloud registration-based method for measuring defects in curved workpieces. It employs a point cloud registration method based on feature matching and graph optimization. By extracting local geometric features of the point cloud and establishing preliminary correspondences, it then adaptively optimizes the registration parameters by combining multimodal residual measurement and robust graph optimization algorithms. Unlike traditional methods that rely on a single Euclidean distance residual, this method can dynamically adjust weights based on the characteristics of the input point cloud without requiring repeated manual parameter tuning, automatically identifying the optimal matching relationship between point clouds. This not only reduces the need for human intervention but also significantly improves the automation and robustness of the registration process, especially when dealing with complex curved surfaces or highly reflective workpieces, better adapting to different measurement environments.
[0092] Specifically, the point cloud registration-based defect measurement method for curved workpieces in this invention embodiment, such as... Figure 1 As shown, it includes:
[0093] (1) Constructing a CAD model based on the 3D design drawings of the workpiece to be measured. The design drawings provide the complete structural and dimensional parameters of the workpiece. Operators can use 3D modeling software to construct a 3D CAD model according to the dimensions of the drawings, such as... Figure 2 As shown, the data is exported as an STL format. This format represents the external surface geometry of the workpiece in the form of a triangular mesh, which facilitates subsequent point cloud conversion processing.
[0094] (2) A line-structured light scanning system is used to scan the physical workpiece line by line to obtain its surface three-dimensional data. Specifically, during the scanning process, laser lines are projected onto the workpiece surface, and an industrial camera simultaneously acquires laser deformation images. Then, combined with camera calibration parameters and the laser plane equation, each pixel in the image is converted into a three-dimensional coordinate point. The set of three-dimensional coordinates obtained after processing all frames constitutes the actual point cloud model of the workpiece, such as... Figure 3 As shown.
[0095] This method is applicable to workpieces with free-form surfaces or complex geometric features, and can efficiently obtain high-density, high-precision three-dimensional point sets, which facilitates subsequent registration and analysis.
[0096] (3) To facilitate comparison with the measured point cloud, the CAD model needs to be converted into point cloud format.
[0097] This embodiment employs a mesh facet segmentation and raster sampling method. The raster sampling strategy divides each triangular facet into a mesh and samples at equal intervals within the mesh to ensure the spatial uniformity of the point cloud model. The density of sampling points can be controlled by the mesh refinement. Each triangular facet is uniformly distributed according to the user-defined number of mesh divisions or maximum point spacing. A finer mesh division yields more sampling points, improving the accuracy of the point cloud. All generated sampling points are aggregated in PCD format and registered and compared with the actual acquired point cloud data. This process not only improves the uniformity of the point cloud but also ensures the spatial consistency of the point cloud sampling.
[0098] The specific process is as follows:
[0099] First, read the STL file of the CAD model and extract the triangular facet information from it;
[0100] In raster sampling, to generate uniformly distributed sampling points within a triangular facet, the centroid coordinate method is used to interpolate the point positions. Let the three vertices of a given triangular facet be: , and Let the length of the longest side be denoted as Set the target sampling interval as The subdivision number is then:
[0101] ;
[0102] in:
[0103] ;
[0104] .
[0105] Based on this, traverse all satisfying conditions. and Integer index pairs Calculate the corresponding centroid coordinate coefficients:
[0106] ;
[0107] In the formula, The sampling point is at the vertex of the triangle The centroid coordinate coefficients in the direction satisfy:
[0108] ;
[0109] The points are generated in the range [0, 1] by random or regular sampling to ensure that the point cloud is uniformly distributed inside the triangular facets, reflecting the proportion of the sampling points inside the triangle.
[0110] The coordinates of the sampling point in three-dimensional space can be obtained from this coefficient. Therefore, any sampling point... The coordinates within the triangle can be determined using the following formula:
[0111] .
[0112] when At that time, point P is located at the geometric center of the triangle; by adjusting The value of can achieve uniform point cloud sampling within the surface patch.
[0113] In grid sampling implementation, the sampling interval is usually set first, and then the sampling interval is generated iteratively to satisfy the requirements. and The sampling point group is used to obtain a regularly distributed set of points on each patch. All samples obtained After the coordinate points are summarized, the transformed theoretical point cloud model (PCD format) is formed.
[0114] like Figure 4 and Figure 5 As shown, the point cloud generated by this method has a uniform distribution, which can effectively restore the design shape of the CAD model and provide basic data for subsequent error analysis.
[0115] (4) Register and align the theoretical point cloud with the measured point cloud. This step is a key step in measuring defects. Unlike traditional ICP, this invention adopts a graph optimization-based point cloud registration method, which has stronger global convergence and robustness.
[0116] First, matching point pairs between the 3D point cloud model of the workpiece and the theoretical point cloud model are determined through feature extraction. The feature extraction steps include: calculating the normal vectors of the local neighborhood of the point cloud based on principal component analysis (PCA), and constructing descriptors using the geometric angle features between neighborhood points; the descriptors are statistically processed to form feature vectors for subsequent feature matching; the correspondence between feature points of the theoretical point cloud and the actual point cloud is obtained through the nearest neighbor search method.
[0117] Then, in the point cloud registration process, feature matching is used to construct the correspondence between key points, and the rigid transformation matrix is solved based on the graph optimization algorithm. The residual adopts a multimodal residual measurement method, which combines geometric, normal and curvature information for comprehensive optimization, and obtains the globally optimal rotation matrix R and translation vector t through robust kernel function constraints.
[0118] The steps are as follows:
[0119] ① For each point in the point cloud, find its neighborhood point set within a certain search radius to describe the local surface topography. Let a point in the point cloud be... Its neighborhood point set is ,Indicates distance Given a set of all points within radius r, perform covariance analysis on the neighborhood of each point using Principal Component Analysis (PCA) to obtain the principal directions and derive the normal vector from them. Set a point in the cloud. The neighborhood of We obtain the principal components by calculating the covariance matrix of points in the neighborhood, and finally obtain the normal vector. :
[0120] ;
[0121] ;
[0122] in, The mean of the points in the neighborhood. Let C be the number of points in the neighborhood, and C be the covariance matrix.
[0123] Perform eigenvalue decomposition on the covariance matrix C, and let its eigenvalues be... Corresponding feature vector Then the local normal vector is taken as the unit vector corresponding to the smallest eigenvalue:
[0124] .
[0125] Subsequently, taking each point in the point cloud as the center, the angle features between neighboring point pairs are collected. Specifically, for each point... and its neighboring points We calculate the angular features between them:
[0126] ;
[0127] in, Represents the geometric angle between a pair of points. and These represent the angles between the normal vectors.
[0128] Histogram statistics are performed on the above geometric features to form a 3D feature vector. This feature vector is used to describe the geometry of each point in the local region.
[0129] This process can be automated using modules in the PCL library, which will calculate the corresponding feature vectors based on the angular features of the neighboring points.
[0130] Each feature point in the theoretical point cloud is matched with a feature point in the actual point cloud using nearest neighbor search (KD-tree) to establish a preliminary correspondence. Let the points in the theoretical point cloud be... The actual point cloud candidate set is The nearest neighbor matching formula is:
[0131] ;
[0132] in, The index of the nearest neighbor. Euclidean distance represents the distance between two points in a point cloud. This is a candidate set of points in the actual point cloud, used to compare with... Compare them.
[0133] ② During point cloud registration, feature matching is used to construct the correspondence between key points, and a graph optimization algorithm is used to solve for the rigid transformation matrix; the residual is defined as a multimodal residual vector:
[0134] ;
[0135] Among them, geometric residuals: Normal vector residual: Curvature residual: ; , and These are the adaptive weights for the geometric residual, normal vector residual, and curvature residual, respectively. and They are points and points The curvature; The scaling parameters for each modality; To prevent constants from being divided by zero;
[0136] The objective function to be optimized is:
[0137] ;
[0138] in, Let R be the robust kernel function, R be the rotation matrix, and t be the translation vector.
[0139] The weights are dynamically adjusted based on the matching confidence, local point cloud density, and residual magnitude.
[0140] ;
[0141] ;
[0142] ;
[0143] in, To match the confidence level, This is the density correction factor; , This is a weight decay function based on the residual size.
[0144] In this invention, the density correction factor This is used to reflect the point cloud sampling density of the matching point in its local neighborhood, so as to reduce the adverse effects of uneven point cloud density or local oversampling on the registration results.
[0145] Specifically, density correction factor The density can be estimated based on the point distribution of the matching points within a preset neighborhood. For areas with high point cloud density, the density correction factor... A smaller value means a lower weight for the residual in that region during optimization. This helps prevent high-density regions from having an excessive impact on the overall registration result.
[0146] In this embodiment, the density correction factor With local point cloud density and global point cloud average density The relationship is:
[0147]
[0148] in, To prevent regularization terms with a denominator of zero.
[0149] Local point cloud density Used to characterize the i The point cloud density of a matching point within its local neighborhood is calculated using the following steps:
[0150] Set neighborhood radius The value is taken as the feature dimension of the workpiece. , with the first i Matching points Centered on, construct a radius of For a spherical neighborhood, count the number of all point cloud points contained within that neighborhood. (including) (Itself). Local point cloud density is the ratio of the number of points in the neighborhood to the volume of the neighborhood, and the formula is: The unit is "points / mm" 3 "" is used to quantify the spatial distribution density of point clouds in a local area.
[0151] Global point cloud average density This is the statistical average of the local density at all points, used to provide a global reference benchmark for the density correction factor. The calculation steps are as follows:
[0152] For each point in the entire point cloud (including measured point clouds or theoretical point clouds, determined according to the calculation scenario) ( k =1,2,..., , (Total number of points in the point cloud), calculate the local density of each point cloud point using the method described above. The global point cloud average density is the arithmetic mean of the local densities of all points, and the formula is: ;in, This represents the total number of points in the point cloud. For the first k The local point cloud density of each point is calculated, and the resulting unit is consistent with the local point cloud density.
[0153] For areas with high point cloud density The value is less than 1, thus reducing the weight of the corresponding geometric residual term in that region during the optimization process; for regions with low point cloud density A value greater than 1 increases the weight of the geometric residual term, enabling adaptive compensation for uneven sampling density. This method effectively controls the weight contribution of high-density regions to the point cloud registration process.
[0154] By introducing a density correction factor This allows for a more reasonable weight allocation for each matching point pair under different sampling densities during the graph optimization process, improving the stability and robustness of the point cloud registration process in complex curved surfaces and non-uniform sampling scenarios.
[0155] ④ The Ceres Solver is used to solve for the optimal rigid transformation matrix, achieving accurate registration between the theoretical and measured point clouds. The optimal solution can be obtained through nonlinear least squares optimization using the Ceres Solver.
[0156] (5) After completing the point cloud registration, calculate the multimodal residual norm corresponding to each point in the actual point cloud based on the registration result. The multimodal residual norm is the Euclidean norm of the corresponding multimodal residual vector, which is used to comprehensively characterize the degree of deviation between the actual point cloud and the theoretical model in terms of local geometric shape consistency.
[0157] By calculating the multimodal residual norm at each point, the error distribution of the workpiece surface relative to the theoretical model is obtained, and the multimodal residual norm is mapped into a residual heatmap:
[0158] ;
[0159] in, It represents the multimodal residual norm.
[0160] like Figure 6 As shown, the residual heatmap is a distance mapping between each point in the point cloud and the corresponding model point, and the error magnitude is displayed by color coding.
[0161] (6) Based on the residual heat map, the statistical distribution characteristics of the multimodal residual norm in the whole or local area of the workpiece are analyzed, and the multimodal residual norm threshold for distinguishing normal area from abnormal area is determined according to the following rules.
[0162] Specifically, let the first i The multimodal residual norm corresponding to each point is: For the set of multimodal residual norms Calculate its mean with standard deviation The central tendency is expressed as the mean of the multimodal residual norm. Characterization, used to describe the main distribution centers of the multimodal residual norm in the normal region; the degree of dispersion is expressed by the standard deviation. The characterization is used to reflect the range of fluctuation of the multimodal residual norm around the central tendency.
[0163] Based on the above statistical distribution characteristics, the multimodal residual norm threshold T Determine as follows:
[0164] ;
[0165] in, The correction factor is dynamically adjusted based on the workpiece's inspection accuracy level; the formula is as follows. ,in, The baseline correction factor is 2.8, which is used in this embodiment. For the allowable dimensional tolerances of the workpiece, This is the standard tolerance reference value.
[0166] Multimodal residual norm The points are marked as defect candidate points, forming a defect candidate point cloud.
[0167] Density clustering was used to perform clustering analysis on the candidate point cloud of defects. The neighborhood radius parameter in the clustering algorithm... and minimum number of points parameter minPts The norm is determined based on the spatial density distribution characteristics of the defect candidate point cloud and the corresponding multimodal residual.
[0168] Among them, the neighborhood radius parameter Based on the average point spacing of the defect candidate point cloud Sure:
[0169] ;
[0170] In the formula, The preset proportionality coefficient is preferably 0.3-0.8.
[0171] Minimum number of points parameter Based on neighborhood radius The number of points within the area is determined adaptively, specifically as follows: .in, The neighborhood radius of all points in the candidate point cloud for defects The average number of points within; The mean of the multimodal residual norm; The adjustment coefficient, determined based on actual conditions and needs, is used to accurately distinguish between continuous defect regions and isolated noise points. Among them, the mean of the multimodal residual norm... A large deviation indicates a significant overall deviation and potentially numerous suspected defect points; the minimum number of points parameter should be increased. This avoids misjudging large amounts of normal fluctuations as defects; conversely, if the mean of the multimodal residual norm is... A smaller deviation indicates a smaller overall deviation and better workpiece quality, allowing for a reduction in the minimum number of points parameter. This increases sensitivity to subtle defects.
[0172] From satisfying the neighborhood radius Number of inner points ≥ of Starting from the core point, recursively expand its density to reach the neighborhood, that is, if the point At the core point Within its neighborhood, and If it meets the core conditions, then it will Neighboring points are included in the same cluster to form a continuous cluster of defect points; at the same time, for points with fewer than [number of points in the neighborhood], [the cluster is further defined]. Isolated candidate points are directly identified as noise points and eliminated, while only defect areas with spatial continuity are retained.
[0173] For the defect regions obtained from clustering, their spatial location, size information, and maximum multimodal residual norm are further output, as follows:
[0174] Spatial location is determined by the cluster center of the defect point cluster. Confirmed, the formula is ,in The number of points in the defect cluster. These are the three-dimensional coordinates of each point within the point cluster;
[0175] Dimensional information is quantized using an outer bounding box, with the length of the bounding box calculated along the X, Y, and Z coordinate axes. , , To characterize defects at a three-dimensional scale;
[0176] Maximum multimodal residual norm It is used to quantitatively characterize the severity of defects, thereby enabling a comprehensive quantitative analysis of the defect characteristics of workpieces.
[0177] The above describes the measurement of defects in curved workpieces based on point cloud registration. This method is suitable for detecting geometric dimensional deviations and surface defects in industrial workpieces such as free-form surfaces, shell structures, and complex irregular shapes.
[0178] Furthermore, the present invention also provides a computer device / apparatus / system, including a memory, a processor, and a computer program stored in the memory, wherein the processor executes the computer program to implement the steps of the above-described method.
[0179] The present invention also provides a computer-readable storage medium having a computer program / instructions stored thereon, which, when executed by a processor, implement the steps of the above-described method.
[0180] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, systems, and computer program products according to embodiments of the invention. It should be understood that each block of the flowchart illustrations and / or block diagrams, as well as combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing apparatus to produce a machine such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in one or more blocks of the flowchart illustrations and / or block diagrams.
[0181] These computer program instructions may also be stored in a computer-readable storage medium capable of directing a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means that implement the functions specified in one or more flowcharts and / or one or more blocks in a block diagram.
[0182] These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable data processing apparatus to produce a computer-implemented process, thereby providing steps for implementing the functions specified in one or more flowcharts and / or one or more blocks in a block diagram.
[0183] It should be noted that, depending on the implementation needs, the various steps / components described in this invention can be broken down into more steps / components, or two or more steps / components or parts of the operation of steps / components can be combined into new steps / components to achieve the purpose of this invention.
[0184] Those skilled in the art will readily understand that the above are merely preferred embodiments of the present invention and are not intended to limit the present invention. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.
Claims
1. A method for measuring defects in curved workpieces based on point cloud registration, characterized in that, include: S1. Obtain the 3D point cloud model and theoretical point cloud model of the workpiece, and determine the corresponding matching point pairs; S2. Based on matching point pairs, a graph-optimized point cloud registration method is used to rigidly register the 3D point cloud model with the theoretical point cloud model. Specifically, this includes: S21. Based on the matching point pairs, construct a graph optimization model. The graph optimization model regards each matching point pair as an edge in the graph structure and defines the registration error as a multimodal residual including geometric residual, normal vector residual and curvature residual. S22. An optimization objective function is constructed by combining multimodal residuals and robust kernel functions, and the global optimal rigid transformation matrix is solved based on graph optimization algorithm to achieve point cloud registration; wherein, the rigid transformation matrix includes rotation matrix and translation vector; S3. Based on the point cloud registration results, calculate the multimodal residual norm of each point and generate a residual heatmap. S4. Identify defect areas using residual heatmaps; Among them, the i Multimodal residuals of matched point pairs Defined as: ; Among them, geometric residuals Normal vector residual Curvature residual ; , and These are the adaptive weights of the residuals for each component; and For the first i Group matching point pairs; Let be a rotation matrix. It is a translation vector; The normal vector of the corresponding point. The curvature of the corresponding point; The scaling parameter for the curvature residual; To prevent constants from being divided by zero; The objective function is then optimized as follows: ; in, For robust kernel functions; This represents the total number of matching point pairs.
2. The method for measuring defects in curved workpieces based on point cloud registration according to claim 1, characterized in that, The adaptive weights for the residuals of each component are: ; ; ; in, To match confidence levels; The density correction factor is used to characterize the density of the point cloud distribution of the matching points in their local neighborhood and to weight the geometric residual term to compensate for the impact of uneven point cloud sampling density on the registration results. is the scaling parameter of the normal vector residual.
3. The method for measuring defects in curved workpieces based on point cloud registration according to claim 2, characterized in that, Density correction factor for: ; in, For local point cloud density, The average density of the global point cloud. To prevent regularization terms with a denominator of zero.
4. The method for measuring defects in curved workpieces based on point cloud registration according to any one of claims 1 to 3, characterized in that, The multimodal residual norm is defined as the corresponding multimodal residual. The Euclidean norm, i.e.: ; in, The multimodal residual norm is used to characterize the overall deviation between the corresponding points in the point cloud and the theoretical model in terms of geometric shape consistency. The multimodal residual norm is used to enhance the discriminative power of local anomaly regions on the surface in the residual distribution.
5. The method for measuring defects in curved workpieces based on point cloud registration according to claim 1, characterized in that, Based on the 3D model of the workpiece, the theoretical point cloud model of the workpiece is obtained by using mesh surface segmentation and raster sampling methods.
6. The method for measuring defects in curved workpieces based on point cloud registration according to claim 1, characterized in that, Defect regions are identified using residual heatmaps, including: Statistical analysis is performed on the multimodal residual norm of the registered point cloud to obtain the distribution characteristics of the multimodal residual norm in the whole or local area of the workpiece. Based on the aforementioned distribution characteristics, an adaptive multimodal residual norm threshold is determined to distinguish between normal and abnormal regions: ; in, The multimodal residual norm threshold; The mean of the multimodal residual norm. The standard deviation of the multimodal residual norm; This is a correction factor; Correction coefficient The calculation formula is as follows: ; In the formula, The base correction factor; For the allowable dimensional tolerances of the workpiece, The standard tolerance reference value; Select a multimodal residual norm that exceeds the multimodal residual norm threshold. The points are used as candidate defect points to form a candidate defect point cloud; Based on the defect candidate point cloud, each defect region is identified, and the location, size, and maximum multimodal residual norm of each defect region are determined.
7. The method for measuring defects in curved workpieces based on point cloud registration according to claim 6, characterized in that, Each defect region is identified using a density clustering algorithm, specifically: The neighborhood radius of the density clustering algorithm is determined based on the spatial distribution characteristics of the defect candidate point cloud. ; in, The neighborhood radius, This is a preset proportional coefficient. The average point spacing of the defect candidate point cloud; The minimum number of points required for the density clustering algorithm is determined based on the spatial distribution characteristics of the defect candidate point cloud and the multimodal residual norm. ; in, To be the minimum number of points, For adjustment coefficients, The neighborhood radius of all points in the candidate point cloud for defects The average number of points within; Cluster the candidate point cloud of defects based on the neighborhood radius and the minimum number of points to form a continuous cluster of defect points, and remove isolated noise points. The cluster of defect points is identified as the defect region.
8. A computer device comprising a memory, a processor, and a computer program stored in the memory, characterized in that, The processor executes the computer program to implement the steps of the method according to any one of claims 1 to 7.
9. A computer-readable storage medium having a computer program / instructions stored thereon, characterized in that, When the computer program / instructions are executed by the processor, they implement the steps of the method according to any one of claims 1 to 7.