Welding seam track extraction method and system based on RANSAC parameter fitting
By introducing a method based on RANSAC parameter fitting and combining it with region growing and multi-scale RANSAC algorithms, the accuracy and efficiency problems of traditional welding trajectory extraction methods in complex backgrounds are solved, and highly robust and efficient weld trajectory extraction is achieved.
Patent Information
- Application Number
- CN202510707230.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-29
- Publication Date
- 2025-09-19
AI Technical Summary
Traditional welding trajectory extraction methods have low accuracy and computational efficiency in the face of noise, outliers and complex backgrounds, and are difficult to adapt to situations where multiple surfaces are intertwined and weld information is discontinuous.
A RANSAC-based parameter fitting method is adopted to calculate the normal vector and curvature through the local neighborhood covariance matrix, and the region growing algorithm is combined for preliminary segmentation. Then, the multi-scale RANSAC algorithm is used to accurately fit the geometric model.
The accuracy and versatility of weld trajectory fitting are improved, the adaptability to features of different scales is enhanced, the tolerance to outliers and local missing points is significantly improved, and the computational complexity and the impact of interference noise are reduced.
Smart Images

Figure CN120673031A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of weld trajectory extraction, and in particular to a weld trajectory extraction method and system based on RANSAC parameter fitting. Background Art
[0002] Welding robots are industrial robots engaged in welding (including cutting and spraying). In the process of industrial manufacturing and automated welding, welding robots are gradually replacing manual labor, and obtaining weld trajectories is an important prerequisite for realizing autonomous operation of robots.
[0003] Welding robots are widely used in manufacturing and automation. Traditional welding trajectory extraction methods typically use feature extraction algorithms based on raw images or 3D point cloud data. These methods are susceptible to interference from noise, outliers, and complex backgrounds, resulting in low fitting accuracy and computational efficiency. This is particularly true when dealing with multi-faceted intersections and discontinuous weld information. While common algorithms such as Hough transforms and surface fitting can extract geometric features to a certain extent, they are typically computationally intensive, highly dependent on initial conditions, and struggle to cope with complex scenarios.
[0004] Therefore, developing a trajectory extraction method with high robustness, low computational cost and strong adaptability has important application value. Summary of the Invention
[0005] The present invention provides a weld trajectory extraction method and system based on RANSAC parameter fitting, which improves the accuracy and versatility of weld trajectory fitting by fitting the weld trajectories of different welding workpieces.
[0006] In a first aspect, the present invention provides a weld trajectory extraction method based on RANSAC parameter fitting, comprising:
[0007] S1, acquiring three-dimensional point cloud data, constructing a local neighborhood covariance matrix of each point cloud data point in the three-dimensional point cloud data, obtaining a normal vector and a local curvature of each point cloud data point; and selecting an initial seed point from the three-dimensional point cloud data based on the local curvature of each point cloud data point;
[0008] S2: Establish a feature similarity evaluation system to find similar neighboring points of the initial seed point; add the initial seed point and the corresponding similar neighboring points to the same plane; and perform rough segmentation of the plane area based on the different planes where each point cloud data point is located;
[0009] S3, determining the welding area where the welding trajectory is located according to the relative positions of each plane; constructing multiple geometric fitting models for the welding trajectory based on the RANSAC algorithm, and selecting the geometric fitting model with the highest matching degree to extract the welding trajectory in the welding area.
[0010] Furthermore, step S1 specifically includes:
[0011] S101, constructing a covariance matrix of a local neighborhood of each point cloud data point using a principal component analysis algorithm; obtaining a normal vector of each point cloud data point by solving the covariance matrix of the local neighborhood;
[0012] S102, for any point cloud data point, calculate the local curvature of the point cloud data point by combining the normal vector of the point cloud data point and the normal vectors of the data points in the neighborhood of the point cloud data point;
[0013] S103 , based on the local curvature of each point cloud data point in the point cloud data, selecting the point cloud data point with the lowest local curvature from different regions as an initial seed point.
[0014] Furthermore, step S101 specifically includes:
[0015] S1011, for any point cloud data point in the point cloud data, selecting a neighboring point set of the point cloud data point by using a k-nearest neighbor or radius search method;
[0016] S1012, calculating the mean centroid of the neighboring point set;
[0017] S1013, constructing the covariance matrix of the local neighborhood based on the mean centroid;
[0018] S1014: Perform eigendecomposition on the covariance matrix to obtain the normal vector of the point cloud data point.
[0019] Furthermore, step S2 specifically includes:
[0020] S201, establish a feature similarity evaluation system;
[0021] S202, searching for similar neighboring points of the initial seed point based on the feature similarity evaluation system, and adding the initial seed point and the similar neighboring points to the same seed set; searching for similar neighboring points of all data points in the seed set, and performing seed expansion on the seed set;
[0022] S203, adding point cloud data points in different seed sets to different planes; for point cloud data points that are not added to the seed set, selecting one or more initial seed points and searching for corresponding similar neighboring points until all point cloud data points in the three-dimensional point cloud data are added to different planes.
[0023] Furthermore, step S3 specifically includes:
[0024] S301, determining the welding area and welding type of the welding trajectory based on different planes formed by each point cloud data;
[0025] S302, collecting data from the welding area, and iteratively constructing multiple candidate geometric fitting models based on the RANSAC algorithm;
[0026] S303 , based on the matching conditions between each candidate geometric fitting model and each point cloud data point in the welding area, the optimal geometric fitting model is selected as the target model of the welding trajectory, and the welding trajectory in the welding area is extracted.
[0027] Furthermore, step S302 specifically includes:
[0028] S3021, collect point cloud data points of the welding area and construct a point cloud trajectory data set;
[0029] S3022, selecting a certain number of necessary points in the point cloud trajectory dataset to construct a sample subset;
[0030] S3023, constructing a current geometric fitting model based on the current sample subset, and calculating parameters of the current geometric fitting model;
[0031] S3024, counting the proportion of samples in the point cloud trajectory dataset that conform to the current geometric fitting model; estimating the probability of parameter errors after a certain number of extractions based on the current sample proportion; if the error probability is less than a preset threshold, adding the current geometric fitting model to the candidate geometric fitting models;
[0032] S3025, repeat steps S3022-S3024 to obtain multiple candidate geometric fitting models.
[0033] Furthermore, step S3025 specifically includes: setting the maximum number of iterations; preliminarily screening the current candidate geometric fitting models by dynamically adjusting the error threshold of the inliers and the minimum inlier number threshold; and re-screening the remaining candidate geometric fitting models using the statistical significance criterion.
[0034] In a second aspect, the present invention provides a weld trajectory extraction system based on RANSAC parameter fitting, comprising:
[0035] An initial point selection unit is used to obtain three-dimensional point cloud data of the welding area, construct a local neighborhood covariance matrix of each point cloud data point in the three-dimensional point cloud data, obtain a normal vector and a local curvature of each point cloud data point; and select an initial seed point from the three-dimensional point cloud data based on the local curvature of each point cloud data point;
[0036] The plane coarse segmentation unit is used to establish a feature similarity evaluation system, find similar neighboring points of the initial seed point, add the initial seed point and the corresponding similar neighboring points to the same plane, and perform coarse segmentation of the plane area based on the different planes where each point cloud data point is located.
[0037] The trajectory extraction unit is used to determine the welding area where the welding trajectory is located according to the relative positions of each plane; construct multiple geometric fitting models for the welding trajectory based on the RANSAC algorithm, and select the geometric fitting model with the highest matching degree to extract the welding trajectory in the welding area.
[0038] In a third aspect, an embodiment of the present invention provides an electronic device, the electronic device including:
[0039] at least one processor; and a memory communicatively connected to the at least one processor; wherein,
[0040] The memory stores a computer program that can be executed by at least one processor. The computer program is executed by at least one processor so that the at least one processor can perform the steps of the weld trajectory extraction method based on RANSAC parameter fitting in any embodiment of the present invention.
[0041] In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium, which stores computer instructions, and the computer instructions are used to enable a processor to implement the steps of the weld trajectory extraction method based on RANSAC parameter fitting of any embodiment of the present invention when executed.
[0042] Compared with the prior art, the present invention has the following beneficial effects:
[0043] The technical solution in the embodiment of the present invention proposes to combine the region growing algorithm with the RANSAC model. First, by introducing a region growing algorithm based on local curvature and normal vector consistency, the preliminary positioning and rough segmentation of the weld area are quickly completed, effectively reducing the overall data volume and interference noise; then, a multi-scale RANSAC algorithm is used to accurately fit the geometric model, which not only enhances the adaptability to features of different scales, but also significantly improves the tolerance to outliers and local missing points. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only preferred embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0045] Figure 1 A schematic flow chart of a weld trajectory extraction method based on RANSAC parameter fitting provided in the first embodiment of the present invention;
[0046] Figure 2 A schematic diagram of the process flow of the double-layer optimization processing framework algorithm provided in the first embodiment of the present invention;
[0047] Figure 3 A schematic diagram of the process of extracting weld trajectory according to the first embodiment of the present invention;
[0048] Figure 4 A schematic diagram showing the effect of the straight line trajectory extraction process provided in the first embodiment of the present invention;
[0049] Figure 5 A structural diagram of a weld trajectory extraction system based on RANSAC parameter fitting provided in the second embodiment of the present invention;
[0050] Figure 6 This is a structural diagram of an electronic device provided in Example 3 of the present invention. DETAILED DESCRIPTION
[0051] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of the present invention.
[0052] Before introducing the embodiments of the present invention, it should be noted that the traditional method has the following shortcomings:
[0053] 1. There are high requirements for the consistency of the specifications of the welding workpiece and its point cloud data, and the versatility is poor.
[0054] 2. In the case of sparse point clouds or partial occlusion, existing algorithms find it difficult to fully reconstruct the three-dimensional geometric features of the weld, resulting in large deviations in trajectory extraction.
[0055] 3. It is very difficult to identify complex three-dimensional curved welds.
[0056] Example 1
[0057] Figure 1 A flow chart of a weld trajectory extraction method based on RANSAC parameter fitting is provided in Example 1 of the present invention. This embodiment is applicable to situations where welding trajectories are extracted, especially situations where there is a large amount of noise and abnormal points around the welding trajectory. The method can be executed by a weld trajectory extraction system based on RANSAC parameter fitting, which can be implemented in software and / or hardware, and can be configured in an electronic device.
[0058] like Figure 1 As shown, the method specifically includes:
[0059] S1, obtain three-dimensional point cloud data, construct the local neighborhood covariance matrix of each point cloud data point in the three-dimensional point cloud data, obtain the normal vector and local curvature of each point cloud data point; according to the local curvature of each point cloud data point, select the initial seed point from the three-dimensional point cloud data.
[0060] Furthermore, step S1 specifically includes:
[0061] S101, constructing a covariance matrix of a local neighborhood of each point cloud data point through a principal component analysis algorithm; and obtaining a normal vector of the point cloud data point by solving the covariance matrix of the local neighborhood.
[0062] Furthermore, step S101 specifically includes:
[0063] S1011, for any point cloud data point P in the point cloud data, select a neighboring point set Q of the point cloud data point P by using a k-nearest neighbor or radius search method. The neighboring point set Q is mathematically expressed as:
[0064]
[0065] in, , ,…, They all represent the three-dimensional coordinates of the neighboring points of the point cloud data point P.
[0066] S1012, calculate the mean centroid of the neighboring point set Q Among them, the mean centroid The mathematical representation of is:
[0067]
[0068] The calculation of the mean centroid is essentially to obtain the mean coordinates based on the three-dimensional coordinates of each neighboring point.
[0069] S1013, based on mean centroid , construct the covariance matrix M of the local neighborhood. The mathematical representation of the covariance matrix M is:
[0070]
[0071] S1014, perform eigendecomposition on the covariance matrix M to obtain the normal vector of the point cloud data point P. The mathematical expression after eigendecomposition is:
[0072]
[0073] in, represents the eigenvector of the covariance matrix, Represents the eigenvalue corresponding to the eigenvector, and the eigenvector corresponding to the smallest eigenvalue is the normal vector of the point cloud data point P.
[0074] The process of eigendecomposition is to construct the eigenvector corresponding to each element in the covariance matrix M.
[0075] In an embodiment of the present invention, the normal vector of each data point is calculated using a principal component analysis algorithm. The normal vector direction should be consistent across a planar region. Each data point in a point cloud is surrounded by numerous neighboring points, which form a local plane. The normal vector should be perpendicular to this plane. The principal component analysis algorithm can be used to analyze the principal directions of these neighboring points, i.e., the principal components of the covariance matrix. The eigenvector corresponding to the smallest eigenvalue is the normal vector, because the normal vector has the smallest direction variation, i.e., the smallest variance.
[0076] S102 , for any point cloud data point P, the local curvature of the point cloud data point P is calculated by combining the normal vector of the point cloud data point P and the normal vectors of the neighboring data points of the point cloud data point P.
[0077] Select the three eigenvalues with the smallest values among the eigenvalues and record them as , and , and satisfies , then the local curvature of the point cloud data point P is The mathematical representation of is:
[0078]
[0079] For flat areas, Close to 0; if the neighborhood fluctuates greatly, then Larger. The normal vector of point P is the minimum eigenvalue The corresponding eigenvector.
[0080] S103 , based on the local curvature of each point cloud data point in the point cloud data, selecting the point cloud data point with the lowest local curvature from different regions as an initial seed point.
[0081] In the embodiment of the present invention, the point with the lowest local curvature is preferably selected as the initial seed point, because the point with small local curvature is more likely to be located on a plane. If there are multiple planes, the initial seed points of different areas need to be selected in sequence.
[0082] S2, establish a feature similarity evaluation system to find similar neighboring points of the initial seed point; add the initial seed point and the corresponding similar neighboring points to the same plane; and perform rough segmentation of the plane area based on the different planes where each point cloud data point is located.
[0083] After selecting the initial seed point, the algorithm checks the points in its neighborhood starting from that initial seed point to determine whether they meet the merging criteria, which include normal similarity and distance from the point to the plane. The distance from the point to the current plane is calculated. If it is less than a threshold and the normals are similar, the point is added to the region. Finally, a new seed point is selected from the remaining points, and the above steps are repeated until all points have been processed. Regions that are too small are merged into adjacent planes or treated as noise, and the segmentation boundaries are refined using morphological operations or edge detection.
[0084] The region growing segmentation algorithm is a segmentation method based on geometric features. Its core concept is to extract targets by progressively merging neighboring points. Using a region growing algorithm based on normal vector consistency, distance threshold constraints, and curvature similarity conditions, it rapidly iteratively expands the point cloud, aggregating points within the same planar region. This process effectively reduces the amount of data required for subsequent fitting, significantly improving overall computational efficiency.
[0085] Furthermore, step S2 specifically includes:
[0086] S201, establish a feature similarity evaluation system.
[0087] Optionally, multi-dimensional data such as the normal vector and local curvature of the point cloud data points can be used as one of the bases for the feature similarity assessment system. At the same time, a smoothing threshold is pre-set, and neighboring points that meet the preset smoothing threshold are continuously included in the seed set; neighboring points that exceed the preset smoothing threshold and deviate from the smooth curve are removed.
[0088] For example: establish a geometric constraint on the normal angle, use a certain normal vector angle threshold (such as 15°) as a constraint, and perform similarity evaluation by calculating the normal angle deviation between the seed point and the neighboring points; and establish a numerical constraint on the local curvature, use a certain Euclidean distance threshold (such as 0.05 meters) as a constraint, and perform similarity evaluation by calculating the Euclidean distance between the seed point and the neighboring points.
[0089] S202, according to the feature similarity evaluation system, find similar neighboring points of the initial seed point, and add the initial seed point and the similar neighboring points to the same seed set; find similar neighboring points of all data points in the seed set, and perform seed expansion on the seed set.
[0090] Region growth is performed sequentially using a priority queue approach to form multiple candidate plane regions. This process primarily enables rapid initial screening to eliminate isolated points or noise clusters.
[0091] S203, adding point cloud data points in different seed sets to different planes; for point cloud data points that are not added to the seed set, selecting one or more initial seed points and searching for corresponding similar neighboring points until all point cloud data points in the three-dimensional point cloud data are added to different planes.
[0092] Optionally, a seed number threshold is pre-established, and seed sets with a number of point cloud data points below the seed number threshold are removed.
[0093] Specifically, using smooth surface consistency as the criterion, a feature similarity judgment system is established by comprehensively utilizing multi-dimensional data such as the normal direction and curvature value of the point cloud. In particular, the system relies on the geometric constraint of the normal angle, and similarity is assessed by calculating the normal angle deviation between the seed point and its neighboring points. A seed expansion mechanism is used to continuously incorporate neighboring points that meet a preset smoothness threshold into the current cluster. Through iterative comparison and feature fusion, connected regions with uniform geometric characteristics are gradually formed. Ultimately, several independent clusters are generated, each of which strictly meets the surface smoothness constraint and corresponds to physical entities in the scene with continuous smooth surfaces.
[0094] This angular tolerance-based segmentation method can effectively distinguish objects with significant geometric differences. By manually setting key parameters such as the normal angle threshold, the algorithm's sensitivity to subtle surface fluctuations can be adjusted to meet the object segmentation needs of different scenarios. It is particularly suitable for extracting objects with regular geometric features, such as industrial parts and architectural structures.
[0095] In this embodiment, the optimal seed point is first adaptively selected based on local curvature analysis and intensity gradient distribution, eliminating manual intervention. Secondly, robust region expansion is achieved by dynamically adjusting the growth threshold. This strategy significantly reduces the computational effort required to calculate candidate regions while maintaining segmentation accuracy, providing high-quality input for subsequent processing.
[0096] In summary, both steps S1 and S2 are part of the first stage of rough plane segmentation. In this embodiment of the present invention, the input 3D point cloud data is first preprocessed. For each point cloud data point, a principal component analysis algorithm is used to construct the covariance matrix of its local neighborhood and solve for the principal directions to obtain the normal vector for that data point. Then, the local curvature information for each point is calculated by combining the normal vector differences between that data point and its neighboring points.
[0097] On this basis, an adaptive threshold is applied based on the calculated curvature values, selecting data points with minimal curvature and stable local features as initial seed points. Subsequently, a region-growing algorithm based on normal vector consistency, distance threshold constraints, and curvature similarity conditions is employed to rapidly iteratively expand the point cloud, aggregating points within the same planar region. This process effectively reduces the amount of data required for subsequent fitting, significantly improving overall computational efficiency.
[0098] S3, according to the relative positions of each plane, determine the welding area where the welding trajectory is located; build multiple geometric fitting models for the welding trajectory based on the RANSAC algorithm, and select the geometric fitting model with the highest matching degree to extract the welding trajectory in the welding area.
[0099] Optionally, after completing the plane region segmentation, the weld region of the weld is quickly located and the RANSAC algorithm is applied to weld feature extraction. This algorithm can accurately extract the backbone information of the plane structure in the presence of outliers and noise, and significantly improve the accuracy and stability of trajectory fitting.
[0100] Finally, the plane parameter information obtained by fitting is combined to extract the weld center trajectory lines or other key geometric feature lines on each plane, thereby completing the effective extraction of various types of weld point cloud trajectories.
[0101] Furthermore, step S3 specifically includes:
[0102] S301, determining the welding area and welding type of the welding trajectory according to different planes formed by each point cloud data.
[0103] It should be noted that the welding area is often located at the intersection line between planes or the edge line of the planes.
[0104] Among them, welding types include but are not limited to: straight line, arc, broken line and compound curve trajectories, etc.
[0105] Since the welding trajectory may be affected by surrounding noise and local data loss, only the approximate welding area of the welding trajectory can be obtained. Therefore, the RANSAC algorithm is needed to accurately determine the specific trajectory of the welding trajectory. The RANSAC algorithm can still stably extract the trajectory skeleton in high noise or local missing scenarios, and the fitting error is significantly lower than the traditional least squares fitting method.
[0106] S302, collecting data from the welding area, and iteratively constructing multiple candidate geometric fitting models based on the RANSAC algorithm.
[0107] In this embodiment of the present invention, the RANSAC algorithm is used to replace the traditional least squares fitting method to fit the weld trajectory extracted from the point cloud data. A probability-driven random sampling mechanism is combined with a consistency verification strategy to screen the inliers in the iterative process.
[0108] Furthermore, step S302 specifically includes:
[0109] S3021, collect point cloud data points of the welding area and construct a point cloud trajectory dataset p. The mathematical representation of the point cloud trajectory dataset p is:
[0110]
[0111] in, Represents the point cloud data points in the point cloud trajectory dataset p, and N represents the number of point cloud data points in the point cloud trajectory dataset p.
[0112] S3022: Select a certain number of necessary points from the point cloud trajectory dataset p to construct a sample subset s.
[0113] S3023: Based on the current sample subset s, construct a current geometric fitting model and calculate parameters of the current geometric fitting model.
[0114] There are two common types of geometric fitting models: straight line fitting model and arc fitting model.
[0115] When the geometric fitting model is a straight line fitting model, two points are randomly selected from the point cloud. and , establish a straight line model:
[0116]
[0117] For any point , its distance to the straight line is:
[0118]
[0119] like , then the point is considered as an interior point, that is, a sample point that conforms to the current geometric fitting model.
[0120] When the geometric fitting model is an arc fitting model, select any three points p and let them be:
[0121]
[0122] Solve the following system of equations to find the center of the circle and radius r:
[0123]
[0124] Distance error from point to arc:
[0125]
[0126] Determine whether the error is less than the threshold , if it is less than , it is an interior point.
[0127] S3024, counting the proportion of samples in the point cloud trajectory dataset p that conform to the current geometric fitting model; estimating the probability of parameter errors after a certain number of extractions based on the current sample proportion; and adding the current geometric fitting model to the candidate geometric fitting models if the error probability is less than a preset threshold.
[0128] Furthermore, step S3024 specifically includes: determining whether each point cloud data point in the point cloud trajectory data set is an interior point of the current geometric fitting model.
[0129] S3025, repeat steps S3022-S3024 to obtain multiple candidate geometric fitting models.
[0130] Step S3025 specifically includes: setting the maximum number of iterations; preliminarily screening the current candidate geometric fitting models by dynamically adjusting the error threshold of the inliers and the minimum inlier number threshold; and re-screening the remaining candidate geometric fitting models using the statistical significance criterion.
[0131] Specifically, the residual mean square value of each geometric fitting model is fitted and evaluated one by one through the error threshold of the inliers (for example, 0.01 meters) and the minimum number of inliers. The model is scored using statistical significance criteria (such as AIC or inlier ratio), and the incorrectly fitted models are screened out, retaining only the plane results with complete structure and good fitting.
[0132] Through step S302, a plurality of candidate geometric fitting models that fit the welding trajectory can be obtained, and further, a target model that best fits the welding trajectory can be selected from them.
[0133] Preferably, in each fitting process, the proportion of inliers and the sum of squared residuals are calculated, and the best model is selected based on statistical significance criteria (such as error distribution and goodness of fit). Invalid planes with poor fitting effects and a small number of inliers are eliminated to further improve the accuracy and robustness of trajectory extraction.
[0134] S303 , based on the matching conditions between each candidate geometric fitting model and each point cloud data point in the welding area, the optimal geometric fitting model is selected as the target model of the welding trajectory, and the welding trajectory in the welding area is extracted.
[0135] Optionally, the number of inliers in each candidate geometric fitting model is counted, the candidate geometric fitting model with the largest number of inliers is used as the target model of the welding trajectory, and the welding trajectory is identified based on the trajectory equation of the target model.
[0136] In this embodiment of the present invention, a region growing algorithm is combined with the RANSAC model to form a two-layer processing framework of "coarse segmentation and fine fitting." In the first stage, a region growing algorithm based on local curvature and normal vector consistency, combined with a dynamic threshold adjustment mechanism, quickly completes the initial positioning and rough segmentation of the weld area, effectively reducing the overall data volume and interference noise.
[0137] In the second stage, a multi-scale RANSAC algorithm is used to accurately fit the geometric model to the candidate regions obtained from the coarse segmentation. By introducing stratified sampling and interior point optimization strategies, this algorithm not only enhances its adaptability to features of different scales but also significantly improves its tolerance to outliers and local missing points, thus achieving an optimal balance between segmentation efficiency and fitting accuracy.
[0138] In summary, step S3 is the second-stage process of fine plane fitting. In this embodiment of the present invention, through multiple rounds of iteration, error threshold control, and a consistent interior point maximization strategy, highly robust extraction of weld features such as straight lines and arcs in the point cloud is achieved. Compared to traditional least squares fitting methods, RANSAC parameter fitting has stronger anti-interference capabilities and is particularly suitable for trajectory extraction tasks in complex environments such as workpiece jitter and reflective occlusion.
[0139] In order to more fully understand the implementation mechanism of the present invention, a complete implementation process is further described below.
[0140] Figure 2 A schematic diagram of the process flow of the double-layer optimization processing framework algorithm provided in the first embodiment of the present invention, combined with Figure 2 The technical solution in the embodiment of the present invention adopts a two-stage optimization strategy: in the first stage, plane segmentation is achieved based on the region growing algorithm; in the second stage, the weld trajectory extracted from the point cloud is fitted based on the RANSAC algorithm.
[0141] In the first stage: First, the normal vector of each point in the input point cloud is estimated. The normal vector can be calculated in a local neighborhood through the principal component analysis method. Then, the normal vector angle and Euclidean distance between adjacent point pairs are jointly judged, and a threshold is set to determine whether they belong to the same continuous planar region. Finally, points with low curvature and stable normal vectors are used as seed points, and a region growing strategy is used to expand outward to gradually generate multiple rough planar regions.
[0142] The goal of the first stage is to quickly segment candidate plane areas with geometric consistency and preliminarily remove background noise points or non-structural stray points to reduce subsequent computational overhead.
[0143] In the second stage: First, the RANSAC algorithm is applied to the candidate plane areas obtained in the first stage to perform geometric model fitting; then, in each fitting process, key indicators such as the inlier ratio and the sum of squared residuals of the current model are calculated; then, based on statistical significance criteria, including error distribution characteristics, goodness of fit and other indicators, the fitting effect of each model is evaluated; finally, valid models with sufficient number of inliers and high fitting accuracy are screened out, and invalid planes with large fitting errors or low inlier ratios are eliminated.
[0144] The goal of the second phase is to further improve the overall accuracy, robustness, and applicability of trajectory extraction through a refined screening strategy.
[0145] Figure 3 The schematic diagram of the process of extracting the weld trajectory provided by the first embodiment of the present invention is combined with Figure 3 First, the original point cloud data is preprocessed to preliminarily propose the noise in the point cloud data; then, based on the plane segmentation method in the first stage, the point cloud data points in the point cloud data are divided into different segmentation planes; then the plane fitting method in the second stage is used to determine whether the intersection line of the plane meets the preset geometric model; finally, based on the fitting results, the weld trajectory is extracted.
[0146] In order to further illustrate the implementation process of extracting welding trajectories by comparing geometric models, a typical recognition example is provided below.
[0147] Figure 4 This is a schematic diagram of the effect of the straight line trajectory extraction process provided by the first embodiment of the present invention, as shown in FIG. Figure 4 As shown, taking a long lap plate or a multi-faceted lap plate as an example, the intersection line between the planes is first obtained, and then the point cloud data on the plane intersection line is obtained. The intersection line of the plane is a straight line. Through the method in the embodiment of the present invention, the intersection line is matched with the RANSAC straight line model to identify the weld trajectory of the plane intersection line.
[0148] The technical solution in the embodiment of the present invention organically combines region growing with the RANSAC algorithm to form a two-stage trajectory extraction process, which greatly reduces the data processing burden while ensuring the accuracy of trajectory extraction. It has strong robustness and wide engineering adaptability, and is particularly suitable for weld trajectory recognition tasks under complex background interference.
[0149] Example 2
[0150] Figure 5A schematic diagram of a weld trajectory extraction system based on RANSAC parameter fitting provided in the second embodiment of the present invention is shown in FIG. Figure 5 As shown, the system specifically includes:
[0151] The initial point selection unit 100 is used to obtain the three-dimensional point cloud data of the welding area, construct the local neighborhood covariance matrix of each point cloud data point in the three-dimensional point cloud data, obtain the normal vector and local curvature of each point cloud data point; and select the initial seed point from the three-dimensional point cloud data based on the local curvature of each point cloud data point.
[0152] The plane coarse segmentation unit 200 is used to establish a feature similarity evaluation system, find similar neighboring points of the initial seed point; add the initial seed point and the corresponding similar neighboring points to the same plane; and perform coarse segmentation of the plane area based on the different planes where each point cloud data point is located.
[0153] The trajectory extraction unit 300 is used to determine the welding area where the welding trajectory is located based on the relative positions of each plane; construct multiple geometric fitting models for the welding trajectory based on the RANSAC algorithm, and select the geometric fitting model with the highest matching degree to extract the welding trajectory in the welding area.
[0154] The technical solution in this embodiment of the present invention first implements plane segmentation based on a region growing algorithm, and then fits the weld trajectory extracted from the point cloud using the RANSAC algorithm. This two-stage optimization strategy can fit the weld trajectory of different welded workpieces, improving the accuracy and versatility of weld trajectory fitting.
[0155] Example 3
[0156] Figure 6 1 is a schematic diagram of the structure of an electronic device for implementing the weld trajectory extraction method based on RANSAC parameter fitting according to an embodiment of the present invention. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital assistants, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.) and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present invention described and / or claimed herein.
[0157] like Figure 6As shown, the electronic device 10 includes at least one processor 11 and a memory, such as a read-only memory (ROM) 12, a random access memory (RAM) 13, etc., which is communicatively connected to the at least one processor 11. The memory stores a computer program that can be executed by the at least one processor. The processor 11 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 12 or the computer program loaded from the storage unit 18 into the random access memory (RAM) 13. Various programs and data required for the operation of the electronic device 10 can also be stored in the RAM 13. The processor 11, ROM 12, and RAM 13 are connected to each other via a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.
[0158] Multiple components in the electronic device 10 are connected to the I / O interface 15, including an input unit 16, such as a keyboard, a mouse, etc.; an output unit 17, such as various types of displays, speakers, etc.; a storage unit 18, such as a magnetic disk, an optical disk, etc.; and a communication unit 19, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information / data with other devices via a computer network such as the Internet and / or various telecommunication networks.
[0159] The processor 11 can be any general-purpose and / or specialized processing component with processing and computing capabilities. Some examples of the processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. The processor 11 executes the various methods and processes described above, such as the weld trajectory extraction method based on RANSAC parameter fitting.
[0160] In some embodiments, the weld trajectory extraction method based on RANSAC parameter fitting can be implemented as a computer program, which is tangibly contained in a computer-readable storage medium, such as a storage unit 18. In some embodiments, part or all of the computer program can be loaded and / or installed on the electronic device 10 via the ROM 12 and / or the communication unit 19. When the computer program is loaded into the RAM 13 and executed by the processor 11, one or more steps of the weld trajectory extraction method based on RANSAC parameter fitting described above can be performed. Alternatively, in other embodiments, the processor 11 can be configured to execute the weld trajectory extraction method based on RANSAC parameter fitting by any other appropriate means (for example, by means of firmware).
[0161] Various embodiments of the systems and techniques described herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), system-on-chip systems (SOCs), programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments can include being implemented in one or more computer programs that are executable and / or interpreted on a programmable system that includes at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0162] Computer programs for implementing the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, such that when the computer program is executed by the processor, the functions / operations specified in the flowcharts and / or block diagrams are implemented. The computer program may be executed entirely on the machine, partially on the machine, as a stand-alone software package, partially on the machine and partially on a remote machine, or entirely on a remote machine or server.
[0163] In the context of the present invention, computer-readable storage media can be tangible media that can contain or store a computer program for use with an instruction execution system, device or equipment or used in combination with an instruction execution system, device or equipment. Computer-readable storage media can include but are not limited to electronic, magnetic, optical, electromagnetic, infrared or semiconductor systems, devices or equipment, or any suitable combination of the foregoing. Alternatively, computer-readable storage media can be machine-readable signal media. More specific examples of machine-readable storage media can include electrical connections based on one or more lines, portable computer disks, hard disks, random access memories (RAM), read-only memories (ROM), erasable programmable read-only memories (EPROM or flash memory), optical fibers, portable compact disk read-only memories (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.
[0164] To provide interaction with a user, the systems and techniques described herein can be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the electronic device. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).
[0165] The systems and techniques described herein can be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., a user computer with a graphical user interface or web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such back-end components, middleware components, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.
[0166] A computing system may include clients and servers. The clients and servers are typically remote from each other and typically interact via a communication network. This client-server relationship arises through computer programs running on the respective computers, creating a client-server relationship. The server may be a cloud server, also known as a cloud computing server or cloud host. This server is a hosting product within the cloud computing service ecosystem that addresses the management difficulties and limited scalability of traditional physical hosting and VPS services.
[0167] It should be understood that the various forms of the processes shown above can be used to reorder, add, or delete steps. For example, the steps described in the present invention can be performed in parallel, sequentially, or in a different order, as long as the desired results of the technical solution of the present invention can be achieved. This is not limited herein.
[0168] The above are only preferred embodiments of the present invention and are not intended to limit the present invention. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of the present invention should be included in the scope of protection of the present invention.
Claims
1. A weld trajectory extraction method based on RANSAC parameter fitting, characterized in that: include: S1, acquiring three-dimensional point cloud data, constructing a local neighborhood covariance matrix of each point cloud data point in the three-dimensional point cloud data, obtaining a normal vector and a local curvature of each point cloud data point; and selecting an initial seed point from the three-dimensional point cloud data based on the local curvature of each point cloud data point; S2: Establish a feature similarity evaluation system to find similar neighboring points of the initial seed point; add the initial seed point and the corresponding similar neighboring points to the same plane; and perform rough segmentation of the plane area based on the different planes where each point cloud data point is located; S3, determining the welding area where the welding trajectory is located according to the relative positions of each plane; constructing multiple geometric fitting models for the welding trajectory based on the RANSAC algorithm, and selecting the geometric fitting model with the highest matching degree to extract the welding trajectory in the welding area.
2. The method according to claim 1, characterized in that Step S1 specifically includes: S101, constructing a covariance matrix of a local neighborhood of each point cloud data point using a principal component analysis algorithm; obtaining a normal vector of each point cloud data point by solving the covariance matrix of the local neighborhood; S102, for any point cloud data point, calculate the local curvature of the point cloud data point by combining the normal vector of the point cloud data point and the normal vectors of the data points in the neighborhood of the point cloud data point; S103 , based on the local curvature of each point cloud data point in the point cloud data, selecting the point cloud data point with the lowest local curvature from different regions as an initial seed point.
3. The method according to claim 2, characterized in that Step S101 specifically includes: S1011, for any point cloud data point in the point cloud data, selecting a neighboring point set of the point cloud data point by using a k-nearest neighbor or radius search method; S1012, calculating the mean centroid of the neighboring point set; S1013, constructing the covariance matrix of the local neighborhood based on the mean centroid; S1014: Perform eigendecomposition on the covariance matrix to obtain the normal vector of the point cloud data point.
4. The method according to claim 1, wherein Step S2 specifically includes: S201, establish a feature similarity evaluation system; S202, searching for similar neighboring points of the initial seed point based on the feature similarity evaluation system, and adding the initial seed point and the similar neighboring points to the same seed set; searching for similar neighboring points of all data points in the seed set, and performing seed expansion on the seed set; S203, adding point cloud data points in different seed sets to different planes; for point cloud data points that are not added to the seed set, selecting one or more initial seed points and searching for corresponding similar neighboring points until all point cloud data points in the three-dimensional point cloud data are added to different planes.
5. The method according to claim 1, wherein Step S3 specifically includes: S301, determining the welding area and welding type of the welding trajectory based on different planes formed by each point cloud data; S302, collecting data from the welding area, and iteratively constructing multiple candidate geometric fitting models based on the RANSAC algorithm; S303 , based on the matching conditions between each candidate geometric fitting model and each point cloud data point in the welding area, the optimal geometric fitting model is selected as the target model of the welding trajectory, and the welding trajectory in the welding area is extracted.
6. The method according to claim 5, characterized in that Step S302 specifically includes: S3021, collect point cloud data points of the welding area and construct a point cloud trajectory data set; S3022, selecting a certain number of necessary points in the point cloud trajectory dataset to construct a sample subset; S3023, constructing a current geometric fitting model based on the current sample subset, and calculating parameters of the current geometric fitting model; S3024, counting the proportion of samples in the point cloud trajectory dataset that conform to the current geometric fitting model; estimating the probability of parameter errors after a certain number of extractions based on the current sample proportion; if the error probability is less than a preset threshold, adding the current geometric fitting model to the candidate geometric fitting models; S3025, repeat steps S3022-S3024 to obtain multiple candidate geometric fitting models.
7. The method according to claim 5, characterized in that Step S3025 specifically includes: setting the maximum number of iterations; preliminarily screening the current candidate geometric fitting models by dynamically adjusting the error threshold of the inliers and the minimum inlier number threshold; and re-screening the remaining candidate geometric fitting models using the statistical significance criterion.
8. A weld trajectory extraction system based on RANSAC parameter fitting, characterized in that: The system is configured to implement the method according to any one of claims 1 to 7, and the system includes: An initial point selection unit is used to obtain three-dimensional point cloud data of the welding area, construct a local neighborhood covariance matrix of each point cloud data point in the three-dimensional point cloud data, obtain a normal vector and a local curvature of each point cloud data point; and select an initial seed point from the three-dimensional point cloud data based on the local curvature of each point cloud data point; The plane coarse segmentation unit is used to establish a feature similarity evaluation system, find similar neighboring points of the initial seed point, add the initial seed point and the corresponding similar neighboring points to the same plane, and perform coarse segmentation of the plane area based on the different planes where each point cloud data point is located. The trajectory extraction unit is used to determine the welding area where the welding trajectory is located according to the relative positions of each plane; construct multiple geometric fitting models for the welding trajectory based on the RANSAC algorithm, and select the geometric fitting model with the highest matching degree to extract the welding trajectory in the welding area.
9. An electronic device, characterized in that: The electronic device comprises: at least one processor; and a memory communicatively connected to the at least one processor; wherein, The memory stores a computer program that can be executed by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can perform the steps of the weld trajectory extraction method based on RANSAC parameter fitting according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the steps of the weld trajectory extraction method based on RANSAC parameter fitting according to any one of claims 1 to 7 when executed.
Citation Information
Cited By
Construction wall inclination detection method and system suitable for constructional engineering
CN121353269A
Construction wall inclination detection method and system suitable for construction engineering
CN121353269B
Casting surface convex riser cutting track generation method based on machine vision
CN121391903A
A method for generating a cutting track of a convex riser on a casting surface based on machine vision
CN121391903B
T-shaped fillet weld identification method and system based on laser vision
CN121861031A