A Visual Inspection Method for Welding Quality
By calculating the grayscale difference, gradient uniformity and light diffusion factor, combined with adaptive parameter adjustment, the problem that the light impact in the existing welding quality visual detection methods is not fully considered, and high-precision and efficient welding quality detection are achieved.
Patent Information
- Application Number
- CN202411335249.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-24
- Publication Date
- 2025-07-18
- Estimated Expiration
- 2044-09-24
AI Technical Summary
The existing visual inspection methods for welding quality do not fully consider complex factors such as light source type and lighting direction, resulting in poor detection results under certain special lighting conditions and cumbersome parameter adjustments.
By calculating the grayscale difference, gradient uniformity and light diffusion factors, combining the weight coefficient, the degree of light influence is obtained, and the weight coefficient is dynamically adjusted using the support vector regression model to adapt to different lighting conditions and welding scenarios.
It improves the accuracy and adaptability of welding quality inspection, reduces false detection and missed inspection caused by light changes, simplifies the operation process, and improves work efficiency and detection accuracy.
Smart Images

Figure CN119444664B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of weld defect detection, and particularly to a visual inspection method for welding quality. Background Art
[0002] With the continuous progress of industrial automation technology, more and more production lines have started to adopt automated welding equipment. The equipment needs to have an efficient and accurate welding quality inspection method to ensure that the welding quality meets product standards and customer requirements. During the automated welding process, the stability of welding quality directly affects the overall quality and production efficiency of the product. Therefore, it is necessary to develop a visual inspection method that can monitor and evaluate welding quality in real time. Machine vision technology is a technology that uses a computer to simulate the visual function of humans, collects, processes, and analyzes images. It captures images through a high-resolution camera or sensor and uses image processing algorithms to extract useful information. In the field of welding quality inspection, machine vision technology can capture subtle changes during the welding process, such as the shape, size, position of the weld, and welding defects, providing data support for the evaluation of welding quality.
[0003] The existing invention patent CN117689662B provides a visual inspection method and system for the welding quality of heat exchanger tube heads. This invention obtains the degree of influence of light on each pixel neighborhood block based on the gray level features and gradient features of each pixel point within each pixel neighborhood block; determines the same type of edges based on the position distribution features between the edge endpoints of adjacent edges in the weld gray image to be measured; obtains the gamma value adjustment coefficient of the pixel point at the center position within each pixel neighborhood block by obtaining the confidence level that each same type of edge is the inner edge of the weld and the degree of defect of each same type of edge; then adjusts the gamma value of each pixel point to obtain the gray output value of each pixel point within each pixel neighborhood block and obtains an optimized weld gray image. Conducting quality inspection on the welding of heat exchanger tube heads can improve the accuracy of welding quality inspection, but there are still the following problems: 1. The calculation of the degree of influence of light mainly based on gray values and gradient features does not fully consider complex factors such as light source type and light direction, which may lead to poor effects under certain special lighting conditions; 2. For different types of welds and welding conditions, the current method may require a large amount of parameter adjustment and optimization to adapt to different application scenarios. Summary of the Invention
[0004] By providing a visual inspection method for welding quality in the embodiments of the present application, the problem in the prior art that the calculation of the degree of influence of light mainly based on gray values and gradient features does not fully consider complex factors such as light source type and light direction, which may lead to poor effects under certain special lighting conditions, is solved, and the accuracy of welding quality inspection is improved.
[0005] An embodiment of the present application provides a visual inspection method for welding quality, including:
[0006] S1: Obtain the welding image of the object to be measured, perform grayscale processing on the image to obtain the grayscale image of the welding to be measured;
[0007] Set the welding area of the object to be measured as a metal material with high reflectivity, and set a point light source above the object to be measured, irradiating obliquely downward from the upper left corner of the object to be measured. Use a camera to collect the welding image of the object to be measured, and perform grayscale processing on the collected welding image to obtain the grayscale image of the welding to be measured;
[0008] S2: Obtain the pixel neighborhood block corresponding to each pixel point in the grayscale image of the welding to be measured, and obtain the degree of illumination influence within each pixel neighborhood block according to the grayscale characteristics and gradient characteristics of each pixel point within each pixel neighborhood block;
[0009] Affected by illumination, the illumination influence area in the image has a diffusive characteristic, that is, the smaller the grayscale difference between the pixel points closer to the center pixel of the area, and the larger the grayscale value of the area affected by illumination;
[0010] In an embodiment of the present invention, the method for obtaining the degree of illumination influence includes:
[0011] S101: Calculate the degree of change difference of the grayscale values within the pixel neighborhood block, denoted as grayscale difference, and the calculation formula is:
[0012]
[0013] where G1 represents the grayscale difference, σ1 represents the standard deviation of the grayscale values within the pixel neighborhood block, G max represents the maximum value of the grayscale values within the pixel neighborhood block, and G min represents the minimum value of the grayscale values within the pixel neighborhood block;
[0014] S102: Evaluate the uniformity of the gradient direction within the pixel neighborhood block, denoted as gradient uniformity, and the calculation formula is:
[0015]
[0016] where G2 represents the gradient uniformity, and σ2 represents the standard deviation of the gradient directions within the pixel neighborhood block;
[0017] S103: Simulate the attenuation effect of light diffusion from the center to the surrounding by a Gaussian function, denoted as the light diffusion factor, and the calculation formula is:
[0018]
[0019] where G3 represents the light diffusion factor, d represents the distance from the center of the light source, and σ3 represents the standard deviation of the Gaussian function;
[0020] S104: Obtain the degree of illumination influence by combining the gray - scale difference, gradient uniformity, and illumination diffusion factor and assigning different weight coefficients. The calculation formula is:
[0021] G = α×G1 + β×G2×G3;
[0022] G represents the degree of illumination influence, α and β are weight coefficients, G1 represents the gray - scale difference, G2 represents the gradient uniformity, and G3 represents the illumination diffusion factor;
[0023] It should be noted that the sobel operator is used to calculate the image gradient direction. The specific calculation methods of the sobel operator and the standard deviation are calculation means well - known to those skilled in the art;
[0024] S3: Obtain the edge endpoints of each edge in the weld gray - scale image to be measured, and judge the same - type edges according to the position distribution characteristics between the edge endpoints of adjacent edges;
[0025] Obtain the center point of each same - type edge, and obtain the confidence level that each same - type edge is the inner edge of the weld according to the relative distance between each edge pixel point on each same - type edge and the center point and the circular fitting degree of the corresponding same - type edge;
[0026] Obtain the defect degree of each same - type edge according to the confidence level of each same - type edge and the local edge pixel point density on the corresponding same - type edge;
[0027] S4: Obtain the gamma - value adjustment coefficient of the pixel point at the center position of each pixel neighborhood block according to the degree of illumination influence in each pixel neighborhood block and the defect degree of the corresponding same - type edge;
[0028] Adjust the preset gamma value of each pixel point according to the gamma - value adjustment coefficient to obtain the optimized gamma value of each pixel point in each pixel neighborhood block;
[0029] Obtain the gray - scale output value of each pixel point in each pixel neighborhood block according to the optimized gamma value of each pixel point in each pixel neighborhood block and the gray - scale value of the corresponding pixel point, and obtain the optimized weld gray - scale image;
[0030] S5: Perform quality detection on the gray - scale image of the object to be measured according to the optimized weld gray - scale image.
[0031] In some embodiments, a large number of weld images of the object to be measured under different illumination conditions are collected, feature extraction is performed on the object - to - be - measured images, and a regression model is constructed so that the input image can automatically adjust the weight coefficients according to the actual illumination conditions. The specific steps are as follows:
[0032] S201: Collect the welding images of the object to be measured under a large number of different lighting conditions. By annotating each image, obtain the welding images of the object to be measured containing the lighting conditions and welding quality, and then perform grayscale and normalization processing to obtain the grayscale image set of the welding to be measured;
[0033] The collected welding images of the object to be measured contain images with various lighting intensities, directions, and welding quality conditions, ensuring the richness of the data set;
[0034] S202: Statistically calculate the grayscale mean and variance of the images in the grayscale image set of the welding to be measured, and use the sobel operator to extract the gradient features of the images in the grayscale image set of the welding to be measured;
[0035] S203: Construct a support vector regression model. By using the image features of the images in the grayscale image set of the welding to be measured as the model input, output the predicted weight coefficients;
[0036] Preset the convergence condition of the model, and adjust the model parameters through cross-validation until the preset convergence condition is reached;
[0037] The preset convergence condition of the model can be set that the model parameters change little and are close to zero in consecutive multiple rounds;
[0038] S204: Through grayscale processing and feature extraction of the newly collected welding images of the object to be measured, obtain the image features of the welding images of the object to be measured;
[0039] Input the image features of the welding images of the object to be measured into the trained support vector regression model to obtain the predicted weight coefficients;
[0040] By substituting the predicted weight coefficients into the calculation formula of the lighting influence degree, calculate the lighting influence degree within each pixel neighborhood block.
[0041] In some embodiments, by taking pictures from multiple angles to obtain the image information of the weld seam under different perspectives, and using an adaptive parameter adjustment mechanism to dynamically adjust the weight coefficients in the lighting influence degree formula to obtain the evaluation result of the weld seam quality, which specifically includes the following steps:
[0042] S301: During the collection process, add shooting at oblique angles, side views, and top views. Perform grayscale and normalization processing on the collected welding images of the object to be measured from multiple angles to obtain the grayscale image set of the welding to be measured from multiple angles;
[0043] During the collection process, add shooting at oblique angles, side views, and top views to ensure that the collected data set contains images of the weld seam from all perspectives;
[0044] S302: Annotate the images taken from multiple angles, including the quality grade, specific position and direction of the weld seam, and existing defects;
[0045] S303: Extract the grayscale features and gradient features of each image in the multi-angle welding grayscale image set to be measured;
[0046] The gradient features are extracted by the sobel operator;
[0047] Fuse the grayscale features and gradient features of images at different angles to obtain a comprehensive feature vector;
[0048] S304: Input the multi-angle welding grayscale image set to be measured into the support vector regression model for model training, and dynamically adjust the weight coefficients;
[0049] S305: Perform grayscale processing and feature extraction on the newly acquired multi-angle welding grayscale image to be measured to obtain the image comprehensive features of the multi-angle welding grayscale image to be measured;
[0050] Input the image comprehensive features of the multi-angle welding grayscale image to be measured into the trained support vector regression model to predict the weight coefficients of each angle image;
[0051] Substitute the predicted weight coefficients into the formula for the degree of illumination influence to calculate the degree of illumination influence within each pixel neighborhood block;
[0052] S306: Combine the degree of illumination influence in the multi-angle welding grayscale image to be measured to evaluate the weld quality.
[0053] In some embodiments, the weld area is dynamically excited by vibrations at a specific frequency, and by collecting and analyzing the image changes of the weld during dynamic vibrations, key dynamic features are extracted and combined with static image features to construct a comprehensive feature vector for intelligent evaluation of weld quality, specifically including the following steps:
[0054] S401: Collect the welding image of the object to be measured in the static state as reference data;
[0055] S402: Use a vibration generator to simulate the production environment to add vibrations at a fixed frequency to the object to be measured, and collect a sequence of dynamic welding images of the object to be measured under vibration conditions;
[0056] Analyze the dynamic image sequence and calculate the vibration characteristics of the weld area, such as the direction offset and position offset;
[0057] S403: Extract the features of the sequence of dynamic welding images of the object to be measured collected under vibration conditions through a dynamic feature extraction algorithm, specifically the features of frequency, amplitude, and direction offset, and combine them with the features of the static image to form a vibration comprehensive feature vector;
[0058] S404: Dynamically adjust the weight coefficients by inputting the comprehensive vibration feature vector into the support vector regression model for model training;
[0059] S405: Obtain the comprehensive vibration feature vector by performing gray processing and feature extraction on the dynamic welding image sequence of the object to be measured under the newly collected vibration conditions;
[0060] Input the comprehensive vibration feature vector into the trained support vector regression model to predict the weight coefficients of each angular image;
[0061] Substitute the predicted weight coefficients into the formula for the degree of illumination influence to calculate the degree of illumination influence within each pixel neighborhood block.
[0062] One or more technical solutions provided in the embodiments of the present application have at least the following technical effects or advantages:
[0063] By calculating the gray difference, the regions with large changes in pixel gray values caused by illumination are identified, which helps to distinguish the illumination influence regions from the normal welding regions; the evaluation of gradient uniformity considers the continuity of edge information in the image, which helps to distinguish the pseudo-edges caused by illumination from the real welding edges; the illumination diffusion factor simulates the attenuation effect of illumination through the Gaussian function, making the calculation of the degree of illumination influence more in line with the actual physical phenomenon and improving the calculation accuracy.
[0064] When calculating the degree of illumination influence, introducing weight coefficients can flexibly adjust the contribution of different features in the final evaluation according to the actual situation, which helps to meet the requirements of different illumination conditions and welding scenarios. BRIEF DESCRIPTION OF THE DRAWINGS
[0065] Figure 1 It is a schematic flowchart of a visual inspection method for welding quality of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0066] To facilitate the understanding of the present invention, the present application will be described more comprehensively with reference to the relevant drawings; the drawings show preferred embodiments of the present invention, however, the present invention can be implemented in many different forms and is not limited to the embodiments described herein; on the contrary, these embodiments are provided to make the disclosure of the present invention more thorough and comprehensive.
[0067] It should be noted that the terms "vertical", "horizontal", "upper", "lower", "left", "right" and similar expressions used herein are for illustrative purposes only and do not represent the only embodiments.
[0068] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the technical field to which this invention belongs; the terms used in the description of the present invention herein are for the purpose of describing specific embodiments only and are not intended to limit the present invention; the term "and / or" used herein includes any and all combinations of one or more of the related listed items.
[0069] Example 1: As Figure 1 shown, a visual inspection method for welding quality of this application includes:
[0070] S1: Obtain the welding image of the object to be measured, perform grayscale processing on the image to obtain the grayscale image of the welding to be measured;
[0071] Set the welding area of the object to be measured as a metal material with high reflectivity, and set a point light source above the object to be measured, irradiate obliquely downward from the upper left corner of the object to be measured, use a camera to collect the welding image of the object to be measured, and perform grayscale processing on the collected welding image to obtain the grayscale image of the welding to be measured;
[0072] S2: Obtain the pixel neighborhood block corresponding to each pixel point in the grayscale image of the welding to be measured, and obtain the degree of illumination influence within each pixel neighborhood block according to the grayscale feature and gradient feature of each pixel point within each pixel neighborhood block;
[0073] Affected by illumination, the illumination-affected area in the image has a diffusive feature, that is, the smaller the grayscale difference between the pixel points closer to the center pixel of the area, and the larger the grayscale value of the area affected by illumination;
[0074] In an embodiment of the present invention, the method for obtaining the degree of illumination influence includes:
[0075] S101: Calculate the degree of change difference of the grayscale values within the pixel neighborhood block, denoted as grayscale difference, and the calculation formula is:
[0076]
[0077] wherein, G1 represents the grayscale difference, σ1 represents the standard deviation of the grayscale values within the pixel neighborhood block, G max represents the maximum value of the grayscale values within the pixel neighborhood block, G min represents the minimum value of the grayscale values within the pixel neighborhood block;
[0078] S102: Evaluate the uniformity of the gradient direction within the pixel neighborhood block, denoted as gradient uniformity, and the calculation formula is:
[0079]
[0080] wherein, G2 represents the gradient uniformity, and σ2 represents the standard deviation of the gradient directions within the pixel neighborhood block;
[0081] S103: Simulate the attenuation effect of light diffusion from the center to the surroundings through the Gaussian function, denoted as the light diffusion factor, and the calculation formula is:
[0082]
[0083] where G3 represents the light diffusion factor, d represents the distance from the center of the light source, and σ3 represents the standard deviation of the Gaussian function;
[0084] S104: Combine the gray - level difference, gradient uniformity, and light diffusion factor, and assign different weight coefficients to obtain the degree of light influence. The calculation formula is:
[0085] G = α×G1 + β×G2×G3;
[0086] G represents the degree of light influence, α and β are weight coefficients, G1 represents the gray - level difference, G2 represents the gradient uniformity, and G3 represents the light diffusion factor;
[0087] It should be noted that the sobel operator is used to calculate the image gradient direction. The specific calculation methods of the sobel operator and the standard deviation are well - known calculation means for those skilled in the art;
[0088] S3: Obtain the edge endpoints of each edge in the gray - level image of the welding to be measured, and judge the same - type edges according to the position distribution characteristics between the edge endpoints of adjacent edges;
[0089] Obtain the center point of each same - type edge, and obtain the confidence level that each same - type edge is the inner edge of the weld according to the relative distance between each edge pixel point on each same - type edge and the center point and the circular fitting degree of the corresponding same - type edge;
[0090] Obtain the defect degree of each same - type edge according to the confidence level of each same - type edge and the local edge pixel point density on the corresponding same - type edge;
[0091] S4: Obtain the gamma - value adjustment coefficient of the pixel point at the center position of each pixel neighborhood block according to the degree of light influence within each pixel neighborhood block and the defect degree of the corresponding same - type edge;
[0092] Adjust the preset gamma value of each pixel point according to the gamma - value adjustment coefficient to obtain the optimized gamma value of each pixel point within each pixel neighborhood block;
[0093] Obtain the gray - level output value of each pixel point within each pixel neighborhood block according to the optimized gamma value of each pixel point within each pixel neighborhood block and the gray - level value of the corresponding pixel point, and obtain the optimized gray - level image of the welding;
[0094] S5: Perform quality inspection on the gray-scale image of the object to be measured according to the optimized welding gray-scale image;
[0095] In an embodiment of the present invention, performing quality inspection on the welding of the heat exchanger tube head according to the optimized welding gray-scale image includes:
[0096] Perform threshold segmentation on the optimized welding gray-scale image to obtain the weld area, analyze the parameters of each weld area, and compare them with the parameters in the standard welding gray-scale image to obtain the deviation between the parameters of the object to be measured and the standard parameters. Preset a deviation threshold. When the deviation between the parameters of the object to be measured and the standard parameters exceeds the deviation threshold, it is indicated that the welding quality of the object to be measured is unqualified.
[0097] The technical solutions in the embodiments of the present application at least have the following technical effects or advantages:
[0098] By calculating the gray-scale difference, the areas with large changes in pixel gray-scale values caused by light are identified, which helps to distinguish the light-affected areas from the normal welding areas; the evaluation of gradient uniformity considers the continuity of edge information in the image, which helps to distinguish the pseudo-edges caused by light from the real welding edges; the light diffusion factor simulates the attenuation effect of light through the Gaussian function, making the calculation of the degree of light influence more in line with the actual physical phenomenon and improving the accuracy of the calculation.
[0099] When calculating the degree of light influence, introducing a weight coefficient can flexibly adjust the contribution of different features in the final evaluation according to the actual situation, which helps to meet the requirements of different light conditions and welding scenarios.
[0100] Embodiment 2: In Embodiment 1, there are limitations in the fixed-angle light. Therefore, by introducing an adaptive parameter adjustment mechanism to dynamically adjust the weight coefficient in the formula for calculating the degree of light influence, the degree of light influence of the image under different light conditions can be calculated, thereby further improving the accuracy of weld quality inspection.
[0101] Therefore, the embodiments of the present application are optimized based on the above embodiments.
[0102] In some embodiments, collect a large number of welding images of the object to be measured under different light conditions, extract features from the images of the object to be measured and construct a regression model, so that the input image can automatically adjust the weight coefficient according to the actual light conditions, specifically including the following steps:
[0103] S201: Collect a large number of welding images of the object to be measured under different light conditions. By annotating each image, obtain the welding images of the object to be measured containing light conditions and welding quality, and then perform gray-scale conversion and normalization processing to obtain a set of gray-scale images of the welding to be measured;
[0104] The collected welding images of the object to be measured contain images with various light intensities, directions, and welding quality conditions, ensuring the richness of the dataset;
[0105] S202: Calculate the grayscale mean and variance of the images in the grayscale image set of the welding to be measured, and use the sobel operator to extract the gradient features of the images in the grayscale image set of the welding to be measured;
[0106] S203: Construct a support vector regression model. By using the image features of the images in the grayscale image set of the welding to be measured as the model input, output the predicted weight coefficients;
[0107] Preset the convergence condition of the model, and adjust the model parameters through cross-validation until the preset convergence condition is reached;
[0108] The preset convergence condition of the model can be set as that the model parameters change little and are close to zero in consecutive multiple rounds;
[0109] S204: Through grayscale processing and feature extraction of the newly collected welding images of the object to be measured, obtain the image features of the welding images of the object to be measured;
[0110] Input the image features of the welding images of the object to be measured into the trained support vector regression model to obtain the predicted weight coefficients;
[0111] By substituting the predicted weight coefficients into the calculation formula of the illumination influence degree, calculate the illumination influence degree within each pixel neighborhood block.
[0112] The technical solutions in the embodiments of the present application above have at least the following technical effects or advantages:
[0113] By introducing an adaptive parameter adjustment mechanism, it is possible to dynamically adjust the weight coefficients in the illumination influence degree formula according to the image features under different illumination conditions. The adaptive adjustment can more accurately reflect the influence of actual illumination on the weld image, thereby improving the accuracy and reliability of weld quality detection; Since the system can automatically adjust the parameters according to the illumination conditions, it can adapt to a variety of different illumination environments, including strong light, weak light, and illumination in different directions, making the system more stable and reliable in practical applications and reducing false detections and missed detections caused by illumination changes.
[0114] Traditional weld quality detection requires manual adjustment of detection parameters according to illumination conditions by humans, which is not only time-consuming and laborious but also prone to errors. By introducing an adaptive parameter adjustment mechanism, the system can automatically complete this process, thereby simplifying the operation process and improving work efficiency.
[0115] Embodiment 3: In Embodiment 1 and Embodiment 2, fixed-angle shooting has limitations. By combining multi-angle shooting technology and an adaptive parameter adjustment mechanism, the accuracy and robustness of weld quality detection can be further improved.
[0116] Therefore, the embodiments of the present application are optimized based on the above embodiments.
[0117] In some embodiments, image information of the weld at different perspectives is obtained through multi-angle shooting, and the weight coefficient in the formula for the degree of illumination influence is dynamically adjusted using an adaptive parameter adjustment mechanism to obtain an evaluation result of the weld quality, which specifically includes the following steps:
[0118] S301: During the acquisition process, shooting at oblique, side, and top-down angles is added, and the multi-angle welding images of the object to be measured collected are grayscaled and normalized to obtain a multi-angle grayscale image set of the welding of the object to be measured;
[0119] During the acquisition process, shooting at oblique, side, and top-down angles is added to ensure that the collected data set contains images of the weld at various perspectives;
[0120] S302: The images taken at multiple angles are labeled, including the quality grade, specific position and direction of the weld, and existing defects;
[0121] S303: By extracting the grayscale features and gradient features of each angle image in the multi-angle grayscale image set of the welding of the object to be measured;
[0122] The gradient features are extracted through the sobel operator;
[0123] The grayscale features and gradient features of the images at different angles are fused to obtain a comprehensive feature vector;
[0124] S304: By inputting the multi-angle grayscale image set of the welding of the object to be measured into a support vector regression model for model training, the weight coefficient is dynamically adjusted;
[0125] S305: By performing grayscale processing and feature extraction on the newly collected multi-angle grayscale image of the welding of the object to be measured, the image comprehensive feature of the multi-angle grayscale image of the welding of the object to be measured is obtained;
[0126] The image comprehensive feature of the multi-angle grayscale image of the welding of the object to be measured is input into the trained support vector regression model to predict the weight coefficient of each angle image;
[0127] The predicted weight coefficient is substituted into the formula for the degree of illumination influence to calculate the degree of illumination influence within each pixel neighborhood block;
[0128] S306: Combining the degree of illumination influence in the multi-angle grayscale image of the welding of the object to be measured, the weld quality is evaluated.
[0129] The technical solutions in the embodiments of the present application at least have the following technical effects or advantages:
[0130] Through multi-angle shooting, it is possible to capture the detailed information of the weld seam from different perspectives, including angles such as bevel, side, and top-down. These information cannot be fully presented from a single angle. The fusion and analysis of multi-angle images make the evaluation of weld quality more comprehensive and accurate, thereby improving the detection accuracy.
[0131] By annotating and extracting features from multi-angle images, the system can more accurately identify defects in the weld seam, such as cracks, slag inclusions, and lack of fusion, which can ensure the welding quality.
[0132] This solution realizes a weld quality detection method that can combine multi-angle shooting and an adaptive parameter adjustment mechanism. More comprehensive weld information is obtained through multi-angle images, and the calculation accuracy of the influence degree of light is improved by dynamically adjusting the weight coefficient, thereby improving the accuracy and robustness of weld quality detection.
[0133] Embodiment 4: In the above embodiment, in the actual production environment, the environment where the object to be measured is located may have a certain degree of vibration. This embodiment introduces the analysis of dynamic vibration characteristics and combines image recognition to achieve precise detection of weld quality.
[0134] Therefore, the embodiments of the present application are optimized based on the above embodiments.
[0135] In some embodiments, dynamic excitation is applied to the weld area using vibrations at a specific frequency. By collecting and analyzing the image changes of the weld seam during dynamic vibration, key dynamic features are extracted and combined with static image features to construct a comprehensive feature vector for intelligent evaluation of weld quality. The specific steps are as follows:
[0136] S401: Collect the welding image of the object to be measured in a static state as reference data;
[0137] S402: Use a vibration generator to simulate the production environment to add vibrations at a fixed frequency to the object to be measured, and collect a sequence of dynamic welding images of the object to be measured under vibration conditions;
[0138] Analyze the dynamic image sequence and calculate the vibration characteristics of the weld area, such as direction offset and position offset;
[0139] S403: Extract the features of the sequence of dynamic welding images of the object to be measured collected under vibration conditions through a dynamic feature extraction algorithm, specifically the features of frequency, amplitude, and direction offset, and combine them with the features of the static image to form a vibration comprehensive feature vector;
[0140] S404: Dynamically adjust the weight coefficients by inputting the comprehensive vibration feature vector into the support vector regression model for model training;
[0141] S405: Obtain the comprehensive vibration feature vector by performing gray-scale processing and feature extraction on the dynamic welding image sequence of the object to be measured under the newly collected vibration conditions;
[0142] Input the comprehensive vibration feature vector into the trained support vector regression model to predict the weight coefficients of each angular image;
[0143] Substitute the predicted weight coefficients into the formula for the degree of illumination influence to calculate the degree of illumination influence within each pixel neighborhood block.
[0144] The technical solutions in the embodiments of the present application at least have the following technical effects or advantages:
[0145] By introducing dynamic vibration characteristic analysis and combining image recognition technology, it is possible to more comprehensively capture the actual performance of the weld seam in a dynamic environment. This solution takes into account the features in static images and simultaneously adds the changing features during the dynamic vibration process, thereby improving the accuracy and reliability of weld seam quality detection.
[0146] Through the combination of dynamic vibration excitation and image recognition technology, efficient and accurate detection of weld seam quality is achieved, significantly improving the automation level and product quality of the welding production line.
[0147] The above are only the preferred embodiments of the present invention and are not used to limit the present invention. For those skilled in the art, various changes and modifications can be made to the present invention. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principle of the present invention shall be included within the protection scope of the present invention.
Claims
1. A visual inspection method for welding quality, characterized in that Including: S1: Obtain the welding image of the object to be measured, perform grayscale processing on the image to obtain the grayscale image of the welding to be measured; S2: Obtain the pixel neighborhood blocks corresponding to each pixel point in the grayscale image of the welding to be measured, and obtain the degree of illumination influence within each pixel neighborhood block according to the grayscale features and gradient features of each pixel point within each pixel neighborhood block; S3: Obtain the edge endpoints of each edge in the grayscale image of the welding to be measured, and judge the same type of edges according to the position distribution characteristics between the edge endpoints of adjacent edges; Obtain the center points of each same type of edge, and obtain the confidence level that each same type of edge is the inner edge of the weld according to the relative distance between each edge pixel point on each same type of edge and the center point and the circular fitting degree of the corresponding same type of edge; Obtain the degree of defect of each same type of edge according to the confidence level of each same type of edge and the local edge pixel point density on the corresponding same type of edge; S4: Obtain the gamma value adjustment coefficient of the pixel point at the center position of each pixel neighborhood block according to the degree of illumination influence within each pixel neighborhood block and the degree of defect of the corresponding same type of edge; Adjust the preset gamma value of each pixel point according to the gamma value adjustment coefficient to obtain the optimized gamma value of each pixel point within each pixel neighborhood block; Obtain the grayscale output value of each pixel point within each pixel neighborhood block according to the optimized gamma value of each pixel point within each pixel neighborhood block and the grayscale value of the corresponding pixel point, and obtain the optimized grayscale image of the welding; S5: Perform quality inspection on the grayscale image of the object to be measured according to the optimized grayscale image of the welding; The method for obtaining the degree of illumination influence includes: S101: Calculate the degree of change difference of the grayscale values within the pixel neighborhood block, denoted as grayscale difference, and the calculation formula is: Among them, G1 represents the grayscale difference, σ1 represents the standard deviation of the grayscale values within the pixel neighborhood block, G max represents the maximum value of the grayscale values within the pixel neighborhood block, G min represents the minimum value of the grayscale values within the pixel neighborhood block; S102: Evaluate the uniformity of the gradient direction within the pixel neighborhood block, denoted as gradient uniformity, and the calculation formula is: Wherein, G2 represents the gradient uniformity, and σ2 represents the standard deviation of the gradient direction within the pixel neighborhood block; S103: Simulate the attenuation effect of the illumination spreading from the center to the surroundings through a Gaussian function, denoted as the illumination diffusion factor, and the calculation formula is: Wherein, G3 represents the illumination diffusion factor, d represents the distance from the center of the light source, and σ3 represents the standard deviation of the Gaussian function; S104: Combine the grayscale difference, gradient uniformity, and illumination diffusion factor and assign different weight coefficients to obtain the degree of illumination influence, and the calculation formula is: G = α×G1 + β×G2×G3; G represents the degree of illumination influence, α and β are weight coefficients, G1 represents the grayscale difference, G2 represents the gradient uniformity, and G3 represents the illumination diffusion factor.
2. The visual inspection method for welding quality according to claim 1, characterized in that, Set the welding area of the object to be measured as a metal material, and set a point light source above the object to be measured, irradiating obliquely downward from the upper left corner of the object to be measured, use a camera to collect the welding image of the object to be measured, and perform grayscale processing on the collected welding image to obtain the grayscale image of the welding to be measured.
3. The visual inspection method for welding quality according to claim 2, characterized in that, Collect a large number of welding images of the object to be measured under different illumination conditions, perform feature extraction on the object to be measured image and construct a regression model, so that the input image can automatically adjust the weight coefficients according to the actual illumination conditions.
4. The visual inspection method for welding quality according to claim 3, wherein The above-mentioned collection of a large number of welding images of the object to be measured under different illumination conditions is specifically: S201: Collect welding images of the object to be measured under a large number of different lighting conditions. By annotating each image, obtain welding images of the object to be measured that contain lighting conditions and welding quality, and perform grayscale and normalization processing to obtain a set of grayscale welding images of the object to be measured. The collected welding images of the object to be measured contain images with various lighting intensities, directions, and welding quality conditions.
5. The visual inspection method for welding quality according to claim 4, wherein Feature extraction is performed on the images of the object to be measured and a regression model is constructed so that the input image can automatically adjust the weight coefficients according to the actual lighting conditions. Specifically, it includes the following steps: S202: Statistically calculate the grayscale mean and variance of the images in the set of grayscale welding images of the object to be measured, and use the sobel operator to extract the gradient features of the images in the set of grayscale welding images of the object to be measured. S203: Construct a support vector regression model. By using the image features of the images in the set of grayscale welding images of the object to be measured as the model input, output the predicted weight coefficients. Preset the convergence conditions of the model, and adjust the model parameters through cross-validation until the preset convergence conditions are reached. S204: Through grayscale processing and feature extraction of the newly collected welding images of the object to be measured, obtain the image features of the welding images of the object to be measured. Input the image features of the welding images of the object to be measured into the trained support vector regression model to obtain the predicted weight coefficients. By substituting the predicted weight coefficients into the calculation formula of the lighting influence degree, calculate the lighting influence degree within each pixel neighborhood block.
6. The visual inspection method for welding quality according to claim 5, characterized in that, Obtain image information of the weld seam from different perspectives through multi-angle shooting, and use an adaptive parameter adjustment mechanism to dynamically adjust the weight coefficients in the lighting influence degree formula to obtain the evaluation result of the weld seam quality.
7. The visual inspection method for welding quality according to claim 6, wherein, The obtaining of image information of the weld seam from different perspectives through multi-angle shooting and the use of an adaptive parameter adjustment mechanism to dynamically adjust the weight coefficients in the lighting influence degree formula specifically include the following steps: S301: During the collection process, increase the shooting at oblique, side, and top-down angles. Perform grayscale and normalization processing on the collected multi-angle welding images of the object to be measured to obtain a set of multi-angle grayscale welding images of the object to be measured. S302: Annotate the images taken from multiple angles, including the quality grade, specific position and direction of the weld seam, and existing defects. S303: By extracting the grayscale features and gradient features of each angle image in the set of multi-angle grayscale welding images of the object to be measured; The gradient features are extracted through the sobel operator. Fuse the grayscale features and gradient features of images from different angles to obtain a comprehensive feature vector. S304: Input the set of multi-angle grayscale welding images of the object to be measured into the support vector regression model for model training, and dynamically adjust the weight coefficients. S305: Through grayscale processing and feature extraction of the newly collected multi-angle grayscale welding images of the object to be measured, obtain the comprehensive image features of the multi-angle grayscale welding images of the object to be measured. Input the comprehensive image features of the multi-angle grayscale welding images of the object to be measured into the trained support vector regression model to predict the weight coefficients of each angle image. Substitute the predicted weight coefficients into the lighting influence degree formula to calculate the lighting influence degree within each pixel neighborhood block.
8. The visual inspection method for welding quality according to claim 7, wherein The weld area is dynamically excited by vibrations of a specific frequency. By collecting and analyzing the image changes of the weld during dynamic vibrations, key dynamic features are extracted and combined with static image features to construct a comprehensive feature vector. By inputting the comprehensive feature vector into a support vector regression model, prediction weight coefficients are obtained.
9. The visual inspection method for welding quality according to claim 8, characterized in that, The method of dynamically exciting the weld area by vibrations of a specific frequency, collecting and analyzing the image changes of the weld during dynamic vibrations, extracting key dynamic features and combining static image features to construct a comprehensive feature vector specifically includes the following steps: S401: Collect the welding image of the object to be measured in a static state as reference data; S402: Use a vibration generator to simulate the production environment to add vibrations of a fixed frequency to the object to be measured, and collect a sequence of dynamic welding images of the object to be measured under vibration conditions; Analyze the dynamic image sequence and calculate the vibration characteristics of the weld area; S403: Extract the features of the sequence of dynamic welding images of the object to be measured collected under vibration conditions through a dynamic feature extraction algorithm, specifically the features of frequency, amplitude, and direction offset, and combine them with the features of the static image to form a vibration comprehensive feature vector.
10. The visual inspection method for welding quality according to claim 9, characterized in that, The method of obtaining prediction weight coefficients by inputting the comprehensive feature vector into a support vector regression model specifically includes the following steps: S404: Input the vibration comprehensive feature vector into a support vector regression model for model training, and dynamically adjust the weight coefficients; S405: By collecting a new sequence of dynamic welding images of the object to be measured under vibration conditions and performing gray-scale processing and feature extraction, a vibration comprehensive feature vector is obtained; Input the vibration comprehensive feature vector into the trained support vector regression model to predict the weight coefficients of each angular image; Substitute the predicted weight coefficients into the formula for the degree of illumination influence to calculate the degree of illumination influence within each pixel neighborhood block.
Citation Information
Patent Citations
A method and system for visual inspection of heat exchanger tube head welding quality
CN117689662B
Hardware part production quality detection method and system based on artificial intelligence
CN116205919A
Watch shell quality detection method based on image data
CN117218122A