Adaptive welding seam detection and three-dimensional reconstruction method based on deep learning and binocular vision

Through an adaptive weld detection method based on deep learning and binocular vision, the problems of low efficiency and poor adaptability of traditional weld detection have been solved, efficient and accurate automatic detection of weld position and size has been achieved, the robustness and accuracy of detection have been improved, and the intelligence and automation of the welding industry have been supported.

CN120707530APending Publication Date: 2025-09-26HOHAI UNIV
View PDF 0 Cites 5 Cited by

Patent Information

Application Number
CN202510833885.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-06-20
Publication Date
2025-09-26

AI Technical Summary

Technical Problem

Existing weld detection methods have the disadvantages of low detection efficiency, poor adaptability, and poor real-time performance. They cannot meet the automation and intelligent requirements of weld detection in modern manufacturing, and their anti-interference capabilities are insufficient in special environments.

Method used

An adaptive weld detection method based on deep learning and binocular vision is adopted. By constructing a training data set, wavelet transform and local variance analysis are used to evaluate image quality, and edge detection parameters are dynamically generated. RANSAC, weighted least squares and polynomial fitting algorithms are combined to perform parallel fitting, dynamically score and select the optimal fitting result, and finally perform three-dimensional coordinate transformation.

Benefits of technology

It realizes efficient, accurate and automatic detection of weld position and size, improves the robustness and precision of detection, adapts to the detection needs of multiple scenarios, and supports the intelligent and automated development of the welding industry.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120707530A_ABST
    Figure CN120707530A_ABST
Patent Text Reader

Abstract

The invention provides an adaptive welding seam detection and three-dimensional reconstruction method based on deep learning and binocular vision. The adaptive welding seam detection and three-dimensional reconstruction method comprises the steps of S1, collecting samples and making a training data set; s2, the picture of the sample to be welded is processed, a feature region is recognized, the image quality of the region to be welded is analyzed and evaluated through wavelet transform and local variance, and the noise level and the contrast ratio are calculated; s3, dynamically generating edge detection parameters and model fitting parameters according to the image quality; s4, using an edge detection algorithm to extract edge point cloud of the welding seam area; s5, performing RANSAC linear fitting, weighted least square fitting and polynomial curve fitting on the edge point cloud in parallel; s6, selecting an optimal fitting result based on an image quality adaptive dynamic scoring model; and S7, carrying out three-dimensional coordinate conversion in combination with the three-dimensional matching model IGEV-Stereo, and outputting a final welding seam three-dimensional coordinate. According to the invention, automatic detection of the position and size of the welding seam can be efficiently and accurately realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of automated welding, and in particular to an adaptive weld detection and three-dimensional reconstruction method based on deep learning and binocular vision. Background Art

[0002] Welding, a widely used joining process in industrial manufacturing, plays a particularly important role in the automotive, aviation, construction, and energy sectors. Weld quality directly impacts product performance, strength, and durability. Therefore, accurately inspecting weld characteristics such as position, geometry, and dimensions is crucial to ensuring welding quality. Weld inspection generally falls into two categories: weld position inspection and weld geometry inspection.

[0003] Traditional weld inspection methods mostly rely on manual inspection or traditional measurement tools. These methods include visual inspection, laser ranging and optical sensing, and mechanical tool measurement. While these traditional methods can meet weld inspection needs to a certain extent, they generally suffer from low inspection efficiency, poor adaptability, and poor real-time performance. These limitations make them unable to meet the modern manufacturing industry's demand for automated and intelligent weld inspection processes. With the rapid development of image processing technology and deep learning, the degree of automation in weld inspection has been greatly improved.

[0004] Computer vision technology, combined with deep learning algorithms, can efficiently and accurately perform automated weld inspection. Computer vision not only captures real-time images of the welding process but also identifies key information such as the weld's location, shape, and size through image analysis. Currently, weld inspection methods that incorporate deep learning algorithms include structured light reflectance systems based on deep learning and weld tracking systems based on deep learning combined with depth cameras. While these methods meet weld inspection requirements in terms of real-time performance and detection efficiency, they suffer from limitations in weld location accuracy and lack robustness against interference in some challenging environments. Summary of the Invention

[0005] The purpose of the present invention is to provide a weld detection method based on deep learning and binocular vision, which can realize automatic detection of weld position and size efficiently and accurately.

[0006] Technical solution:

[0007] An adaptive weld detection and 3D reconstruction method based on deep learning and binocular vision includes the following steps:

[0008] Step 1: construct a training dataset for the object detection model YOLO and a training dataset for the stereo matching model IGEV-Stereo, and train the models;

[0009] Step 2: The image quality of the area to be welded is evaluated by wavelet transform and local variance analysis to calculate the noise level and contrast.

[0010] Step 3: Dynamically generate edge detection parameters and model fitting parameters based on image quality;

[0011] Step 4: Use edge detection algorithm to extract edge point cloud of weld area;

[0012] Step 5: Perform RANSAC linear fitting, weighted least squares fitting, and polynomial curve fitting on the edge point cloud in parallel;

[0013] In step 6, the optimal fitting result is selected based on the dynamic scoring model of image quality adaptation. In step 7, the three-dimensional coordinate transformation is performed in combination with the stereo matching model IGEV-Stereo, and the three-dimensional coordinates of the weld are finally output.

[0014] Preferably, in step 1, for the target detection model, obtain the sample image to be welded, use the LabelImg image annotation tool to annotate it, and calibrate the weld area with a frame; for the stereo matching model, download the image dataset for binocular vision from the KITTI dataset.

[0015] Preferably, step 2 includes: step 2.1, cropping the weld feature area, applying Hough wavelet transform to perform two-dimensional discrete wavelet transform, and decomposing it into low-frequency, horizontal high-frequency, vertical high-frequency and diagonal high-frequency sub-bands; extracting the diagonal high-frequency sub-band, calculating its median absolute deviation, and converting it into the noise standard deviation through a normalization factor; step 2.2, dividing the cropped image into non-overlapping small blocks, calculating the standard deviation of each small block, and using the median of the standard deviation as the local contrast.

[0016] Preferably, in step 3, dynamically generating edge detection parameters includes: setting the Canny low threshold to: the base value minus the noise level to retain weak edges; setting the Canny high threshold to: the base value plus contrast to suppress false edges.

[0017] Preferably, in step 4, the Canny edge detection algorithm is used, and adaptive high and low thresholds are input to obtain a binary image, which is then converted into point cloud data.

[0018] Preferably, step 5 includes: step 5.1, RANSAC linear fitting: randomly select a point set to iteratively fit a straight line, and screen the optimal straight line with the proportion of inner points and residuals; step 5.2, weighted least squares fitting: assign weights according to the consistency of the points and the direction of the preliminary fitting straight line, and fit the straight line by weighted adjustment of the design matrix; step 5.3, polynomial fitting: select the order according to the contrast, use quadratic curve fitting for high contrast, and use linear linear fitting for low contrast; use the normal equation to solve the coefficient a, thereby obtaining the coefficient of the fitting polynomial, and forming a polynomial function of the prediction curve.

[0019] Preferably, step 6 specifically includes: first calculating the evaluation indicators of each fitting model, screening valid points, and calculating the error, standard deviation of the residual, and inlier ratio based on the residual of the valid points; then dynamically weighting the score based on the image quality, and standardizing the evaluation indicators; finally calculating the comprehensive score, the comprehensive score = ω1×standardized mean square error + ω2×(1-standardized inlier ratio) + ω3×residual standard deviation.

[0020] As a preference, when calculating the proportion of inliers, the proportion of points with statistical residuals less than 2 times the standard deviation among all points is:

[0021] Preferably, the dynamic weighted scoring based on image quality is as follows: first, an initial weight is assigned to each evaluation indicator, and then the weight is adjusted according to the image quality: if the noise is >50, the weight of the inlier ratio is increased and the weight of the mean square error is reduced; if the contrast is <30, the weight of the residual standard deviation is increased; finally, the adjusted weights are normalized.

[0022] Preferably, step 7 specifically includes: first, generating a disparity map through IGEV-Stereo, calculating the depth value Z, Z = (F*B) / disparity, where F is the focal length of the camera and B is the baseline length of the camera; then calculating the three-dimensional coordinates X and Y based on the camera intrinsic parameters: X = (U-CX)*Z / f, Y = (V-CY)*Z / f, where f is the focal length of the camera, (CX, CY) are the principal point coordinates, corresponding to the optical center position of the image, respectively, and (U, V) are the weld pixel coordinates; finally, generating and outputting the three-dimensional point cloud data of the weld, completing the mapping from two-dimensional pixel coordinates to three-dimensional space coordinates.

[0023] The present invention also discloses a weld detection system based on deep learning and binocular vision, comprising:

[0024] Dataset building module: used to build image datasets for two deep learning models;

[0025] The image quality analysis module performs Hough wavelet transform on the weld feature area, extracts the diagonal high-frequency sub-band and calculates the noise standard deviation; divides the image into blocks and calculates the local standard deviation, using the median as the contrast index;

[0026] An adaptive parameter generation module dynamically generates a Canny low threshold / high threshold according to the noise standard deviation / contrast index;

[0027] Edge point cloud extraction module, which uses the Canny algorithm with adaptive parameters to extract binary edge maps and convert them into three-dimensional point cloud data;

[0028] Parallel fitting module, which simultaneously performs RANSAC linear fitting, direction consistency weighted weighted least squares fitting and contrast-based polynomial fitting on point cloud data;

[0029] The dynamic scoring module calculates the mean square error, residual standard deviation, and inlier ratio of each fitting model, dynamically adjusts the weight of each fitting model according to the noise level and contrast, and generates a comprehensive score by weighted summation after standardization of the indicators;

[0030] The 3D reconstruction module includes the IGEV-Stereo stereo matching model, generates a disparity map and calculates the depth value Z. It calculates the pixel coordinates based on Z and converts them into 3D coordinates to output the 3D point cloud data of the weld.

[0031] Beneficial effects

[0032] The present invention proposes a weld detection method based on deep learning and binocular vision, which can realize automatic detection of weld position and size efficiently and accurately.

[0033] In the image quality analysis module, the present invention decomposes the cropped feature area into four sub-bands through two-dimensional discrete wavelet transform, which can specifically extract noise information from the diagonal high-frequency sub-bands, providing an accurate basis for dynamically adjusting parameters such as the Canny low threshold, ensuring that the threshold is lowered to retain the real edge when the noise is large; local variance analysis divides the image into non-overlapping small blocks and calculates the standard deviation, and uses the median of the small block contrast to represent the overall local contrast, which can not only capture the contrast distribution of non-uniform areas of the image, but also reflect the degree of discreteness of pixel values, laying the foundation for adaptive adjustment of contrast enhancement parameters and optimization of edge detection effects.

[0034] In the adaptive parameter generation module of the present invention, the Canny threshold is adaptively generated based on the image quality analysis results, which can specifically solve the limitations of fixed parameters in complex scenes and enable the algorithm to stably extract edges in weld images with different lighting and materials. At the same time, there is no need for manual parameter debugging, and it adapts to the detection needs of multiple scenes, laying a high-quality data foundation for subsequent point cloud fitting and three-dimensional coordinate positioning.

[0035] In the parallel fitting module of the present invention, the parallel fitting module forms a highly complementary fitting system by integrating RANSAC, weighted least squares, and polynomial fitting algorithms, significantly improving the robustness and accuracy of weld detection, and automatically adapting the optimal algorithm to different noise levels and weld shapes: RANSAC effectively suppresses outlier interference in high-noise scenes through random sampling and interior point screening, avoiding the fitting line being dominated by noise points; weighted least squares assigns higher weights to weld area points to enhance the real weld features; polynomial fitting adapts to arc-shaped and curved welds through feature expansion, making up for the limitations of straight line fitting.

[0036] The dynamic scoring module of this invention automatically selects the fitting model with the highest overall score through dynamic evaluation and weighting of mean square error, residual standard deviation, and inlier ratio. In the 3D reconstruction module, by combining deep learning with binocular vision, this invention not only improves the accuracy and reliability of weld inspection, but also overcomes the limitations of traditional weld inspection methods, providing a new solution for the intelligent and automated development of the welding industry. BRIEF DESCRIPTION OF THE DRAWINGS

[0037] 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 some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0038] Figure 1 A flow chart of a method provided by an embodiment of the present invention;

[0039] Figure 2 A weld area map obtained by a trained target detection model provided in an embodiment of the present invention;

[0040] Figure 3 Point cloud data containing image edges obtained after conversion by an edge detection algorithm provided in an embodiment of the present invention;

[0041] Figure 4 This is a schematic diagram of the three-dimensional reconstruction of the best fitting line and image obtained in an embodiment of the present invention. DETAILED DESCRIPTION

[0042] To make the above-mentioned objects, features, and advantages of the present invention more apparent and understandable, specific embodiments of the present invention are described in detail below with reference to the accompanying drawings. The following description sets forth many specific details to facilitate a full understanding of the present invention. However, the present invention can be implemented in many different ways than those described herein, and those skilled in the art can make similar modifications without violating the scope of the invention. Therefore, the present invention is not limited to the specific embodiments disclosed below. The following embodiments of the present invention are further described in detail with reference to the accompanying drawings.

[0043] Example 1

[0044] like Figures 1 to 4 As shown, this embodiment provides a weld detection method based on deep learning and binocular vision, including:

[0045] Step 1: Build a dataset for the object detection model and a dataset for the stereo matching model. For the object detection model, obtain an image of a sample to be welded and annotate it using the LabelImg image annotation tool, demarcating the weld area with a bounding box. For the stereo matching model, download an image dataset for binocular vision from the KITTI dataset.

[0046] Step 2: The feature areas identified by the target detection model are passed to the image quality analysis module. The image quality of the area to be welded is evaluated through wavelet transform and local variance analysis. Specifically:

[0047] First, if Figure 2 As shown in the figure, the weld candidate area detected by the cropping target detection model is subjected to a two-dimensional discrete wavelet transform using the Hough wavelet transform. The image is decomposed into four sub-bands: low-frequency part (approximate information), horizontal high-frequency part (horizontal edge), vertical high-frequency part (vertical edge), and diagonal high-frequency part (noise and details). The noise is mainly concentrated in the diagonal high-frequency part. The diagonal high-frequency part is extracted and the noise standard deviation is calculated:

[0048] Extract the noise information of the diagonal high-frequency subband and calculate the median absolute deviation (MAD) of this subband. Use a normalization factor (0.6745 in this example) to convert this value to the standard deviation of the noise: Noise standard deviation = Median absolute deviation (MAD) / 0.6745, and output the noise level as a percentage.

[0049] The cropped image is then divided into multiple non-overlapping patches. The standard deviation of each patch is calculated based on the mean value of the pixels within the patch and the total number of pixels within the patch. The standard deviation reflects the degree of dispersion of the pixel values ​​in the image; greater dispersion indicates higher contrast in that area. The median of the standard deviations of all patches is taken as the overall local contrast.

[0050] Step 3: Dynamically adjust the algorithm parameters of the edge detection algorithm (including edge detection parameters and model fitting parameters) based on the image quality analysis results (noise level, contrast) and welding conditions. Specifically:

[0051] In this embodiment, the Canny edge detection algorithm is used. This algorithm generally requires setting different high and low thresholds according to different image requirements. The low threshold retains weak edges, while the high threshold suppresses pseudo-edges. In this embodiment, a base value is set for the low threshold as a standard threshold when there is no noise interference. By subtracting noise from the base value, the threshold is lowered to reduce the impact of noise. A base value is set for the high threshold as a standard value when there is no contrast interference. By increasing the contrast based on the base value, the threshold is raised to detect obvious edges.

[0052] Step 4: If Figure 3 As shown in the figure, the edge detection algorithm is used to extract the edge point cloud information of the weld area to provide a basis for subsequent geometric shape analysis. Specifically,

[0053] According to the adaptive threshold in step 3, the cropped image is subjected to edge detection using Canny to obtain a binary image, which is then converted into point cloud data containing image edges.

[0054] Step 5: Perform RANSAC linear fitting, weighted least squares fitting, and polynomial curve fitting on the edge point cloud in parallel. The specific steps include:

[0055] After obtaining the edge information, the system uses a variety of fitting algorithms to fit the weld geometry, including RANSAC, weighted least squares fitting, and polynomial fitting.

[0056] RANSAC fitting: The dataset from the edge detection results is divided into features (x) and target values ​​(y). Using linear regression as the basic estimator, a line is fitted by randomly selecting a subset of data points for multiple iterations, and the difference between each point and the fitted line is evaluated. Half of the standard deviation of the point cloud data y is calculated as the threshold. By calculating the standard deviation of the target variable y and taking half of its ratio as the residual threshold, automatic adaptation to different data distribution characteristics is achieved. This mechanism dynamically associates the threshold with the degree of discreteness of the data. When the data noise level is high, the inlier determination criteria are automatically relaxed, and when the noise level is low, the criteria are tightened. This maintains good performance in various scenarios without manual intervention. If the difference between a point and the fitted line is less than a predetermined threshold, the point is considered an inlier. The slope and intercept of the fitted line are obtained, and a Boolean mask is used to mark which data points are inliers.

[0057] Weighted least squares fitting: In the dataset of edge detection results, each point is first assigned the same initial weight; then, a preliminary fit is performed to determine the direction of the preliminary fitted line. Based on the results of the preliminary fit, the maximum x and y values ​​of the point set are taken, a rectangle is designed, and weights are assigned according to the following rule: the diagonal of the rectangle aligned with the direction of the initial fit result is given a higher weight, while points farther from the diagonal are given a lower weight. The x and y coordinates are extracted from the input point cloud data, and a design matrix is ​​constructed to represent the characteristics of the data points. The design matrix and the target vector (i.e., the y value) are adjusted according to their respective weights. The weight vector is expanded into a column vector and multiplied element-by-element by the design matrix X, thereby adjusting the contribution of each data point to the fitting result. Ultimately, the slope (m) and intercept (b) of the fitted line are obtained, forming the fitted line equation y = mx + b.

[0058] Polynomial fitting: Set the order of the polynomial according to the contrast of the image. In high contrast scenes, use quadratic curve fitting (y = a0 + a1x + a2x 2 ), while a linear fit (y=a0+a1x) is used in low-contrast scenes. By constructing a design matrix, the x value of the original data set is expanded into a polynomial feature. Then, the normal equation is used to solve the coefficient a=(a0,a1,a2,…), that is, a=(X T X) -1 X T y, thereby obtaining the coefficients of the fitting polynomial and then forming the polynomial function of the prediction curve.

[0059] Step 6: Select the best fitting result based on the image quality adaptive dynamic scoring model, evaluate the performance of each fitting model, and select the best performing model. The specific steps include:

[0060] Step 6.1, calculate the evaluation indicators of each fitting model:

[0061] For the parameters of the interior point set and the fitting model, if a linear fitting model y=kx+b is used, the predicted value is calculated by this formula; if a polynomial fitting is used, the calculation is performed using the polynomial function, and the residual of each data point is calculated, that is, the difference between the actual value and the predicted value, and the absolute value of the residual is obtained, that is, ε i =|yactual-ypredicted|. To exclude outliers, the 3-times standard deviation rule is used to screen valid points. The mean square error, the standard deviation of the residuals, and the proportion of inliers are calculated based on the residuals of valid points. When calculating the proportion of inliers, the proportion of points with residuals less than 2 times the standard deviation among all points is calculated, i.e.

[0062]

[0063] The final evaluation results include mean square error, inlier ratio and residual standard deviation.

[0064] Step 6.2: Dynamically weight the model fitting evaluation results based on the image quality information.

[0065] First, we assign initial weights to each evaluation metric: mean squared error (MSE) = 50%, inlier ratio = 30%, and residual standard deviation = 20%. We then adjust the weights based on image quality: if image noise is greater than 50, we increase the weight of inlier ratio and decrease the weight of MSE; if image contrast is less than 30, we increase the weight of residual standard deviation. Finally, we normalize the adjusted weights to ensure that the sum of all weights is 1.

[0066] Step 6.3: Standardize each evaluation index by dividing the mean square error and the inlier ratio by their maximum values ​​(100 and 10) respectively, and limit their maximum values ​​to 1, i.e.

[0067]

[0068] Step 6.4, calculate using the weighted comprehensive score.

[0069] The overall score = ω1 × standardized mean square error + ω2 × (1 - standardized inlier ratio) + ω3 × residual standard deviation, where ω1, ω2, and ω3 are weights. The overall score takes into account both fitting performance and image quality; a smaller score indicates a better fit.

[0070] Step 7: Combine the stereo matching model to perform three-dimensional coordinate transformation. The specific steps include:

[0071] In step 7.1, use the stereo matching model IGEV-Stereo to input the left and right views of the binocular camera and generate a disparity map. Based on the disparity map, calculate the depth value Z of each pixel as (F*B) / disparity, where F is the focal length of the camera and B is the baseline length of the camera.

[0072] Step 7.2: Use the depth information to construct a depth map of the image.

[0073] The 3D coordinates of the weld are calculated using the depth value Z and the camera's intrinsic parameters: X = (U - CX) * Z / f, Y = (V - CY) * Z / f, where f is the focal length of the camera, CX and CY are the principal point coordinates, corresponding to the optical center of the image. U and V are the 2D pixel coordinates of the weld in the image.

[0074] In step 7.3, the 3D point cloud data of the weld is generated and output, completing the mapping from 2D pixel coordinates to 3D space coordinates. Finally, the pixels in the image are mapped into 3D space to form point cloud data in the real world.

[0075] The best fitting model is selected based on the evaluation results. The selected best fitting model is combined with the stereo matching algorithm to extract the three-dimensional information of the weld from the input image. Figure 4 shown.

[0076] Example 2

[0077] The embodiment of the present invention discloses a weld detection system based on deep learning and binocular vision, including the following modules:

[0078] Dataset establishment module: used to build image datasets for two deep learning models. Specifically, it includes a binocular vision acquisition module, which is configured to obtain binocular image data of the workpiece to be inspected; and an object detection module, which includes a pre-trained YOLO model and is configured to identify weld feature areas in the input image.

[0079] Image quality analysis module: used to automatically analyze image quality parameters. Specifically, it performs Hough wavelet transform on the weld feature area, extracts diagonal high-frequency sub-bands and calculates the noise standard deviation; divides the image into blocks and calculates the local standard deviation, using the median as the contrast index.

[0080] The adaptive parameter generation module dynamically generates the Canny low threshold according to the noise standard deviation: base value - noise level; and dynamically generates the Canny high threshold according to the contrast index: base value + contrast.

[0081] The edge point cloud extraction module is used for edge information of the weld area. Specifically, the Canny algorithm with adaptive parameters is used to extract the binary edge map and convert it into three-dimensional point cloud data.

[0082] The parallel fitting module is used to fit the weld shape and scale. Specifically, it simultaneously performs the following on the point cloud data: RANSAC linear fitting, directionally consistent weighted least squares fitting, and contrast-based polynomial fitting (quadratic curve for high contrast and linear for low contrast).

[0083] The dynamic scoring module is used to select the best fitting solution for the model. Specifically, it calculates the mean square error, residual standard deviation, and inlier ratio of each fitting model; increases the weight of the inlier ratio when the noise level is >50 and increases the weight of the residual standard deviation when the contrast is <30; and generates a comprehensive score by standardizing the indicators and then taking the weighted sum.

[0084] The 3D reconstruction module, which includes the IGEV-Stereo stereo matching model, generates a disparity map and calculates the depth value Z, where Z = (F * B) / disparity, where F is the camera's focal length and B is the camera's baseline length. The pixel coordinates (U, V) are converted to 3D coordinates using camera intrinsic parameters: X = (U - CX) * Z / f, Y = (V - CY) * Z / f, where f is the camera's focal length and CX and CY are the principal point coordinates, corresponding to the image's optical center. Finally, the 3D point cloud data for the weld is output to the welding actuator.

[0085] The foregoing is merely a detailed description of specific embodiments of the present invention, intended to enable those skilled in the art to understand and implement the present invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present invention is not limited to the embodiments shown herein, but is intended to be construed in the widest manner consistent with the principles and novel features of the present application.

Claims

1. An adaptive weld detection and 3D reconstruction method based on deep learning and binocular vision, comprising the following steps: Step 1: construct a training dataset for the object detection model YOLO and a training dataset for the stereo matching model IGEV-Stereo, and train the models; Step 2: The image quality of the area to be welded is evaluated by wavelet transform and local variance analysis to calculate the noise level and contrast. Step 3: Dynamically generate edge detection parameters and model fitting parameters based on image quality; Step 4: Use edge detection algorithm to extract edge point cloud of weld area; Step 5: Perform RANSAC linear fitting, weighted least squares fitting, and polynomial curve fitting on the edge point cloud in parallel; Step 6: Select the best fitting result based on the dynamic scoring model of image quality adaptation; Step 7: Combine the stereo matching model IGEV-Stereo to perform three-dimensional coordinate transformation and finally output the three-dimensional coordinates of the weld.

2. The adaptive weld detection and 3D reconstruction method according to claim 1, characterized in that: In step 1, for the target detection model, obtain the sample image to be welded, use the LabelImg image annotation tool to annotate it, and calibrate the weld area with a box; for the stereo matching model, download the image dataset for binocular vision from the KITTI dataset.

3. The adaptive weld detection and 3D reconstruction method according to claim 1, characterized in that: Step 2 includes: Step 2.1: Crop the weld feature area and perform a two-dimensional discrete wavelet transform using the Hough wavelet transform to decompose it into low-frequency, horizontal high-frequency, vertical high-frequency, and diagonal high-frequency sub-bands; extract the diagonal high-frequency sub-band, calculate its median absolute deviation, and convert it into the noise standard deviation using a normalization factor; In step 2.2, the cropped image is divided into non-overlapping small blocks, the standard deviation of each small block is calculated, and the median of the standard deviation is used as the local contrast.

4. The adaptive weld detection and 3D reconstruction method according to claim 3, characterized in that: In step 3, the edge detection parameters are dynamically generated including: The Canny low threshold is set to: the base value minus the noise standard deviation to retain weak edges; the Canny high threshold is set to: the base value plus the contrast to suppress false edges.

5. The adaptive weld detection and 3D reconstruction method according to claim 4, characterized in that: In step 4, the Canny edge detection algorithm is used, and adaptive high and low thresholds are input to obtain a binary image, which is then converted into point cloud data.

6. The adaptive weld detection and 3D reconstruction method according to any one of claims 1 to 5, characterized in that: Step 5 includes: Step 5.1, RANSAC linear fitting: randomly select points and iteratively fit a straight line, and select the optimal line based on the inlier ratio and residual error. In the inlier verification stage, half of the standard deviation of the point cloud data y is calculated as the threshold, and the inlier judgment criterion is optimized based on the point set characteristics. Step 5.2, weighted least squares fitting: Assign weights based on the consistency of the points with the initial fitted line direction, and adjust the design matrix to fit the line through weighted adjustment. When assigning weights, first assign the same weight to the point set, use this weight to perform the initial fit, and based on the initial fit result, take the maximum x value and the maximum y value of the point set to design a rectangle. The diagonal design principle of the rectangle is consistent with the initial fit result. The closer the point is to the diagonal, the higher the weight, and the farther the point is from the diagonal, the lower the weight. Step 5.3, polynomial fitting: select the order according to the contrast, use quadratic curve fitting for high contrast and linear linear fitting for low contrast; use the normal equation to solve the coefficient a to obtain the coefficient of the fitting polynomial, which constitutes the polynomial function of the prediction curve.

7. The adaptive weld detection and 3D reconstruction method according to any one of claims 1 to 5, characterized in that: Step 6 specifically includes: first, calculating the evaluation indicators of each fitting model, screening valid points, and calculating the error, standard deviation of the residual, and inlier ratio based on the residual of the valid points; then dynamically weighting the score based on the image quality, and standardizing the evaluation indicators; finally, calculating the comprehensive score, which is ω1×standardized mean square error+ω2×(1-standardized inlier ratio)+ω3×residual standard deviation.

8. The adaptive weld detection and 3D reconstruction method according to claim 7, characterized in that: When calculating the proportion of internal points, the proportion of points with statistical residuals less than 2 times the standard deviation among all points is: The dynamic weighted scoring based on image quality is as follows: first, an initial weight is assigned to each evaluation indicator, and then the weight is adjusted according to the image quality: if the noise is greater than 50, the weight of the inlier ratio is increased and the weight of the mean square error is reduced; if the contrast is less than 30, the weight of the residual standard deviation is increased; Finally, the adjusted weights are normalized. After standardizing the evaluation indicators, the weighted comprehensive score is calculated. The smaller the score, the better the fitting effect.

9. The adaptive weld detection and 3D reconstruction method according to claim 1, characterized in that: Step 7 specifically includes: first, generating a disparity map through IGEV-Stereo and calculating the depth value Z, Z = (F*B) / disparity, where F is the focal length of the camera and B is the baseline length of the camera; then calculating the three-dimensional coordinates X and Y based on the camera intrinsic parameters: X = (U-CX)*Z / f, Y = (V-CY)*Z / f, where f is the focal length of the camera, (CX, CY) are the principal point coordinates, corresponding to the optical center position of the image, and (U, V) are the weld pixel coordinates; finally, generating and outputting the three-dimensional point cloud data of the weld, completing the mapping from two-dimensional pixel coordinates to three-dimensional space coordinates.

10. A weld detection system based on deep learning and binocular vision, characterized in that: include: Dataset building module: used to build image datasets for two deep learning models; The image quality analysis module performs Hough wavelet transform on the weld feature area, extracts the diagonal high-frequency sub-band and calculates the noise standard deviation; divides the image into blocks and calculates the local standard deviation, using the median as the contrast index; An adaptive parameter generation module dynamically generates a Canny low threshold / high threshold according to the noise standard deviation / contrast index; Edge point cloud extraction module, which uses the Canny algorithm with adaptive parameters to extract binary edge maps and convert them into three-dimensional point cloud data; Parallel fitting module, which simultaneously performs RANSAC linear fitting, direction consistency weighted weighted least squares fitting and contrast-based polynomial fitting on point cloud data; The dynamic scoring module calculates the mean square error, residual standard deviation, and inlier ratio of each fitting model, dynamically adjusts the weight of each fitting model according to the noise level and contrast, and generates a comprehensive score by weighted summation after standardization of the indicators; The 3D reconstruction module includes the IGEV-Stereo stereo matching model, generates a disparity map and calculates the depth value Z. It calculates the pixel coordinates based on Z and converts them into 3D coordinates to output the 3D point cloud data of the weld.

Citation Information

Cited By

  • Weld joint parameter anti-interference measurement method

    CN121112903A

  • A method for measuring weld parameters immune to interference

    CN121112903B

  • Binocular vision-based wave height measurement method and system

    CN121392619A

  • A Wave Height Measurement Method and System Based on Binocular Vision

    CN121392619B

  • Cable curvature calculation method based on binocular stereoscopic vision

    CN121582319A