Intelligent positioning and detection system for welding defects based on image processing

By adaptively adjusting the standard deviation of the Gaussian filtering algorithm and Retinex image enhancement, the problem of poor noise reduction in welding images is solved, and the accuracy of welding defect detection is improved.

CN120782759BActive Publication Date: 2025-11-21JIANGSU ZHIXIANG HAIGONG ROBOTICS CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202511159618.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-08-19
Publication Date
2025-11-21
Estimated Expiration
2045-08-19

AI Technical Summary

Technical Problem

In the process of denoising welding images, the existing Gaussian filtering algorithm has a fixed standard deviation, which leads to poor denoising effect or excessive blurring, affecting the accuracy of welding defect detection.

Method used

By acquiring the suspected noise level, grayscale confidence, and structural confidence of each pixel, the standard deviation of the Gaussian filtering algorithm is adjusted, and adaptive standard deviation is used for denoising. Finally, the Retinex image enhancement algorithm is combined for image enhancement.

Benefits of technology

It improves the accuracy of welding defect detection, effectively removes noise while preserving welding details.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120782759B_ABST
    Figure CN120782759B_ABST
Patent Text Reader

Abstract

The present application relates to the technical field of image processing, in particular to a kind of intelligent positioning detection system of welding flaw based on image processing;Suspected noise degree is obtained according to the gradient feature and neighborhood gray scale distribution feature of pixel in welding image;Gray scale confidence is obtained according to the gray scale feature of pixel, the gray scale difference feature of pixel and neighborhood;Structure confidence is obtained according to the area feature of the connected domain where pixel is located, the profile variation feature of the edge line of connected domain, the gradient distribution feature in the normal direction of edge line;The denoising coefficient of pixel is obtained according to suspected noise degree, gray scale confidence and structure confidence;The standard deviation in Gaussian filter algorithm is adjusted according to denoising coefficient.The present application carries out denoising to welding image according to adaptive standard deviation, carries out image enhancement to the welding image after denoising, obtains the image to be detected;Welding flaw detection is carried out to the image to be detected, and the detection accuracy is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of image processing technology, and more specifically to an intelligent positioning and detection system for welding defects based on image processing. Background Technology

[0002] Welding technology is widely used in modern manufacturing industries, such as automotive, shipbuilding, aerospace, and construction. Welding quality directly affects the structural strength and stability of products; defects in welding can lead to safety hazards. Therefore, it is necessary to detect and locate welding defects after welding. Currently, machine vision technology is commonly used for large-scale inspection of welding quality. Welding images often exhibit overexposure and underexposure due to metal reflections and shadows. Therefore, image denoising and enhancement are required before inspection. The existing Retinex image enhancement algorithm estimates non-uniform illumination through multi-scale Gaussian filtering and dynamically adjusts the reflection component, significantly enhancing details in dark areas (such as cracks and pores) while avoiding saturation in bright areas, resulting in better image enhancement.

[0003] Noise is unavoidable during image acquisition. Before image enhancement, to prevent noise from being mistaken for details and amplified in the calculation of the reflection component, leading to more obvious noise artifacts in the enhanced image, denoising using a Gaussian filtering algorithm is necessary. However, existing Gaussian filtering algorithms use a fixed standard deviation. A larger standard deviation results in a wider smoothing range and stronger denoising ability, but may excessively blur details, thus losing minute defects in the welding image. Conversely, a smaller standard deviation preserves more details but results in insufficient denoising, leading to poor denoising of the welding image and misidentification of noise as welding defect areas during detection. Therefore, existing Gaussian filtering algorithms affect the accuracy of welding defect detection after denoising. Summary of the Invention

[0004] To address the aforementioned technical problems, the present invention aims to provide an intelligent positioning and detection system for welding defects based on image processing. The specific technical solution adopted is as follows:

[0005] The image acquisition module is used to acquire welding images of parts after welding.

[0006] The image analysis module is used to obtain the suspected noise level of a pixel based on the gradient features and neighborhood grayscale distribution features of the pixel in the welding image; to obtain the grayscale confidence level of the pixel based on the grayscale features of the pixel and the grayscale difference features between the pixel and its neighbors; and to obtain the structural confidence level of the pixel based on the area features of the connected region where the pixel is located, the contour change features of the edge lines of the connected region, and the gradient distribution features in the normal direction of the edge lines.

[0007] The feature processing module is used to obtain the denoising coefficient of the pixel based on the suspected noise level, the gray level confidence level, and the structure confidence level; adjust the standard deviation in the Gaussian filtering algorithm based on the denoising coefficient to obtain the adaptive standard deviation of the pixel; denoise the welding image using the Gaussian filtering algorithm based on the adaptive standard deviation; and perform image enhancement on the denoised welding image to obtain the image to be detected.

[0008] A welding defect detection module is used to detect welding defects in the image to be inspected.

[0009] Further, the step of obtaining the suspected noise level of the pixel based on the gradient features and neighborhood grayscale distribution features of the pixel in the welding image includes:

[0010] Calculate the proportion of other pixels with the same grayscale value as the pixel within a preset neighborhood of the pixel to obtain an anomaly level value; calculate the product of the gradient value of the pixel and the anomaly level value to obtain the suspected noise level of the pixel.

[0011] Further, the step of obtaining the grayscale confidence level of the pixel based on the grayscale features of the pixel and the grayscale difference features between the pixel and its neighbors includes:

[0012] Calculate the absolute value of the difference between the grayscale value of the pixel and the maximum grayscale value in the welding image to obtain the grayscale difference value; calculate and normalize the standard deviation of the grayscale values ​​within a preset neighborhood of the pixel to obtain the grayscale dispersion; calculate and normalize the sum of the absolute values ​​of the grayscale differences between the pixel and each other pixel within the preset neighborhood to obtain the neighborhood dispersion; calculate the sum of the grayscale dispersion and the neighborhood dispersion to obtain the local grayscale distribution value; calculate and normalize the product of the grayscale difference value and the local grayscale distribution value to obtain the grayscale confidence level of the pixel.

[0013] Further, the step of obtaining the structural confidence of the pixel based on the area features of the connected region where the pixel is located, the contour change features of the edge lines of the connected region, and the gradient distribution features in the normal direction of the edge lines includes:

[0014] Calculate the reciprocal of the area of ​​the minimum bounding rectangle of the connected region containing the pixel to obtain the small area feature value; calculate the standard deviation of the curvature at all edge pixels on the edge line of the connected region to obtain the edge shape complexity; construct a window excluding the edge pixel along the normal direction of the edge line with the edge pixel as the center, calculate and normalize the information entropy of the gradient direction of all window pixels within the window to obtain the direction change degree; calculate and normalize the reciprocal of the average gradient value of the window pixels within the window to obtain the edge abrupt change degree; calculate the sum of the direction change degree and the edge abrupt change degree to obtain the local gradient feature value of the edge pixel; calculate the average of the local gradient feature values ​​of all edge pixels on the edge line to obtain a first value; calculate and normalize the product of the small area feature value, the edge shape complexity, and the first value to obtain the structure confidence of the pixel; when the pixel does not have a connected region, the structure confidence of the pixel is a constant 1.

[0015] Further, the step of obtaining the denoising coefficient of the pixel based on the suspected noise level, the grayscale confidence level, and the structural confidence level includes:

[0016] The denoising coefficient of the pixel is obtained by multiplying the average of the grayscale confidence and the structure confidence with the suspected noise level and normalizing the product.

[0017] Further, the step of adjusting the standard deviation in the Gaussian filtering algorithm according to the denoising coefficients to obtain the adaptive standard deviation of the pixel includes:

[0018] Calculate the difference between the preset maximum and preset minimum values ​​of the standard deviation in the Gaussian filtering algorithm to obtain the adjustment benchmark; calculate the product of the denoising coefficient and the adjustment benchmark to obtain the adjustment amount; calculate the sum of the adjustment amount and the preset minimum value to obtain the adaptive standard deviation in the Gaussian filtering algorithm corresponding to the pixel.

[0019] Furthermore, the step of performing image enhancement on the denoised welding image to obtain the image to be detected includes:

[0020] The Retinex image enhancement algorithm is used to enhance the denoised welding image to obtain the image to be detected.

[0021] The present invention has the following beneficial effects:

[0022] In this invention, obtaining the suspected noise level can initially determine the probability that a pixel is a noise pixel based on the gray-level jump characteristics of the noise. Since the features of some welding defects are similar to those of noise, further analysis of the local features of the pixel is needed to avoid smoothing the defect details and affecting accuracy. Obtaining the gray-level confidence level can determine the probability that a pixel is a noise pixel based on the difference in gray-level features between the welding defect area and the noise area. The structural confidence level of the pixel is obtained based on the area features of the connected region where the pixel is located, the contour change features of the edge lines of the connected region, and the gradient distribution features in the normal direction of the edge lines. This can further determine the probability that a pixel is a noise pixel based on the difference in structural features between the welding defect area and the noise area. Obtaining the denoising coefficient can accurately characterize the probability that a pixel is a noise pixel and determine the smoothing degree when denoising the pixel. Obtaining the adaptive standard deviation corresponding to the pixel can accurately smooth and denoise pixels in the welding image to different degrees, so that while removing noise, the details of the welding defect area are well preserved. Finally, defect detection is performed based on the image to be detected, improving the accuracy of welding defect detection. Attached Figure Description

[0023] To more clearly illustrate the technical solutions and advantages in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0024] Figure 1 This is a block diagram of an image processing-based intelligent positioning and detection system for welding defects, provided as an embodiment of the present invention. Detailed Implementation

[0025] To further illustrate the technical means and effects adopted by the present invention to achieve its intended purpose, the following, in conjunction with the accompanying drawings and preferred embodiments, details the specific implementation, structure, features, and effects of an image processing-based intelligent positioning and detection system for welding defects proposed according to the present invention. In the following description, different "one embodiment" or "another embodiment" do not necessarily refer to the same embodiment. Furthermore, specific features, structures, or characteristics in one or more embodiments can be combined in any suitable form.

[0026] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention pertains.

[0027] The following description, in conjunction with the accompanying drawings, details the specific solution of the intelligent positioning and detection system for welding defects based on image processing provided by the present invention.

[0028] Please see Figure 1 The diagram illustrates a block diagram of an image processing-based intelligent positioning and detection system for welding defects according to an embodiment of the present invention. The system includes the following modules:

[0029] The image acquisition module S1 is used to acquire welding images of the parts after welding.

[0030] In this embodiment of the invention, the implementation scenario is the detection of welding defects, aiming to improve the accuracy of defect detection. First, a welding image of the part after welding is acquired; after welding, the image is transmitted to a shooting location for capture, and the captured image is processed into grayscale to obtain the welding image of the part after welding.

[0031] The image analysis module S2 is used to obtain the suspected noise level of a pixel based on the gradient features and neighborhood gray-level distribution features of the pixel in the welding image; to obtain the gray-level confidence level of the pixel based on the gray-level features of the pixel and the gray-level difference features between the pixel and its neighbors; and to obtain the structural confidence level of the pixel based on the area features of the connected region where the pixel is located, the contour change features of the edge lines of the connected region, and the gradient distribution features in the normal direction of the edge lines.

[0032] Traditional Gaussian filtering algorithms use the same standard deviation globally during denoising, which can easily lead to over-denoising, blurring welding defects, or poor denoising, causing noisy areas to be mistaken for welding defects, thus affecting the accuracy of welding defect detection. Therefore, to improve the accuracy of defect detection, potentially noisy areas in the welding image can be denoised to a greater extent, while welding defect areas can be denoised to a lesser extent. First, the probability of a pixel in the welding image being noise is determined. Since noise is randomly distributed at any location in the image and exhibits significant abrupt changes compared to other areas, the degree of suspected noise for a pixel can be obtained based on its gradient features and neighborhood grayscale distribution characteristics.

[0033] Preferably, in this embodiment of the invention, the step of obtaining the suspected noise level includes: calculating the reciprocal of the proportion of other pixels with the same gray value as the pixel within a preset neighborhood of the pixel to obtain an anomaly value; the fewer the number of other pixels with the same gray value as the pixel within the preset neighborhood, the larger the anomaly value, meaning that the difference between the gray value of the pixel and the gray value features of its neighboring regions is greater, the more obvious the gray value jump feature of the pixel is, and the more likely the pixel is to be a noise pixel. In this embodiment of the invention, the preset neighborhood range is a range with a side length of 5 pixels centered on the pixel, which can be determined by the implementer according to the implementation scenario. The product of the pixel's gradient value and the similarity value is calculated to obtain the suspected noise level of the pixel. The larger the gradient value of the pixel, the more obvious the local gray value jump feature of the pixel is, and the more likely it is to be a noise pixel; therefore, the larger the suspected noise level of the pixel, the more likely the pixel is to be a noise pixel.

[0034] Furthermore, due to improper welding during the welding process, defects such as weld beads may occur. Weld beads exhibit a random, point-like abrupt structure, similar to the characteristics of noise pixels. Although pixels belonging to both noise and weld bead regions appear as spot-like areas with local abrupt changes, they differ in grayscale and structural features. Therefore, to improve the accuracy of noise pixel identification, it is necessary to analyze the grayscale and structural features of the connected regions to which the pixel belongs. Weld beads are metal nodules formed when molten metal flows outside the weld and remains unmelted in the base material. Therefore, their reflective characteristics are more pronounced, and their grayscale values ​​are usually close to saturation, approaching the maximum grayscale value in the entire welding image. In contrast, the grayscale values ​​of noise pixels are more random. Simultaneously, the weld bead region exhibits uniform reflection and small internal grayscale differences, displaying a consistent grayscale characteristic. Noise pixels, on the other hand, show a large grayscale difference from their surroundings, exhibiting a low consistency characteristic. Therefore, the grayscale confidence level of a pixel can be obtained based on its grayscale characteristics and the grayscale difference between the pixel and its neighborhood.

[0035] Preferably, in this embodiment of the invention, the step of obtaining grayscale confidence includes: calculating the absolute value of the difference between the grayscale value of a pixel and the maximum grayscale value in the welding image to obtain a grayscale difference value; the smaller the grayscale difference value, the closer the grayscale value of the pixel is to the maximum grayscale value, and the more likely the pixel is to be a pixel in the weld bead region. The standard deviation of the grayscale values ​​within a preset neighborhood of the pixel is calculated and normalized to obtain grayscale dispersion; the more similar the grayscale values ​​within the preset neighborhood, the smaller the grayscale dispersion, and the less likely the pixel is to be a noise pixel; the larger the grayscale dispersion, the more likely the pixel is to be a noise pixel. The sum of the absolute values ​​of the grayscale differences between the pixel and each other pixel within the preset neighborhood is calculated and normalized to obtain neighborhood dispersion; the larger the neighborhood dispersion, the more obvious the grayscale difference between the pixel and the local region, and the more likely the pixel is to be a noise pixel. The sum of grayscale dispersion and neighborhood difference is calculated to obtain the local grayscale distribution value; the larger the local grayscale distribution value, the more likely the pixel is to be a noise pixel. The product of the grayscale difference value and the local grayscale distribution value is calculated and normalized to obtain the grayscale confidence score of the pixel; the larger the grayscale confidence score of the pixel, the more likely the pixel is to be a noise pixel; in this embodiment of the invention, the normalization method is as follows: A represents the normalized object. This represents an exponential function with the natural constant as its base. Implementers can determine the normalization method according to the implementation scenario.

[0036] Furthermore, structurally, weld beads are blocky or spot-like regions with relatively large connected domain areas; while noise consists of single pixels or extremely small regions with small or nonexistent connected domain areas. Therefore, the likelihood of a pixel being noise can be determined by the area characteristics of its connected domain. At the interface between the weld bead and the base material, a gradient edge is formed due to differences in reflection, and the edge contour is relatively smooth; while noise exhibits abrupt grayscale changes compared to surrounding pixels and lacks a clear contour. Therefore, the structural confidence level of a pixel can be obtained based on the area characteristics of its connected domain, the contour variation characteristics of the edge lines of the connected domain, and the gradient distribution characteristics along the normal direction of the edge lines.

[0037] Preferably, in this embodiment of the invention, the step of obtaining structural confidence includes: calculating the reciprocal of the area of ​​the minimum bounding rectangle of the connected region where the pixel is located, to obtain a small area feature value; the smaller the area of ​​the connected region, the larger the small area feature value, meaning that the pixel is more likely to be in a noise region, and more likely to be a noise pixel. Calculating the standard deviation of the curvature at all edge pixels on the edge line of the connected region to obtain the edge shape complexity; since the contour of the noise region is irregular, the larger the standard deviation of the curvature, the greater the edge shape complexity, and the more likely the pixel is to be in a noise region; while the edge of the weld bead region is relatively smooth, and the edge shape complexity is smaller. Constructing a window excluding the edge pixel along the normal direction of the edge line with the edge pixel as the center; in this embodiment of the invention, the window length is 6, with half on the outside and half on the inside of the normal line of the edge pixel. The implementer can determine the window length according to the implementation scenario. Calculate and normalize the information entropy of the gradient directions of all window pixels within the window to obtain the directional change degree. It should be noted that information entropy is an existing technology, and the specific calculation steps will not be elaborated here. The more discrete the gradient directions, the greater the information entropy and the greater the directional change degree. The worse the consistency of the gradient direction features along the normal direction of the edge line, the less it conforms to the gradual transition characteristics on both sides of the edge line, and the more likely the connected region is to be a noise region. When the connected region is a weld bead region, the gray-scale gradual transition characteristics on both sides of the edge line are more obvious, and the directional change degree is smaller. Calculate and normalize the reciprocal of the average gradient values ​​of the window pixels within the window to obtain the edge abruptness degree. When the connected region is a weld bead region, due to the gradual transition characteristics, the average gradient value is larger, and the edge abruptness degree is smaller. Conversely, when the connected region is a noise region, the edges are relatively clear, and the gradient values ​​within the window are smaller, so the larger the edge abruptness degree, the more likely the connected region is to be a noise region. Calculate the sum of the directional change degree and the edge abruptness degree to obtain the local gradient feature value of the edge pixel. When the local gradient feature value is larger, it means that the connected region is more likely to be a noise region. Calculate the average of the local gradient feature values ​​of all edge pixels on the edge line to obtain the first value; calculate and normalize the product of the small area feature value, the edge shape complexity, and the first value to obtain the structure confidence of the pixel; the higher the structure confidence, the more likely the connected region containing the pixel is a noise region, and the more likely the pixel is a noise pixel. When the pixel does not have a connected region, it means that the pixel may be a single noise pixel, so the structure confidence of the pixel is a constant 1. When the pixel has a connected region, the formula for obtaining the structure confidence includes:

[0038] ,

[0039] In the formula, R represents the structural confidence level of a pixel. This indicates normalization, and S represents the area of ​​the smallest bounding rectangle of the connected region containing the pixel. This represents a small feature value for the area, and N represents the number of edge pixels on the edge lines of the connected domain. This represents the degree of directional change corresponding to the nth edge pixel. This represents the edge abrupt change degree corresponding to the nth edge pixel. Represents the local gradient eigenvalues. Let K represent the first numerical value, and K represent the edge shape complexity.

[0040] The feature processing module S3 is used to obtain the denoising coefficient of the pixel based on the suspected noise level, gray level confidence and structural confidence; adjust the standard deviation in the Gaussian filtering algorithm based on the denoising coefficient to obtain the adaptive standard deviation of the pixel; denoise the welding image based on the adaptive standard deviation using the Gaussian filtering algorithm; and enhance the denoised welding image to obtain the image to be detected.

[0041] After obtaining the suspected noise level, grayscale confidence level, and structural confidence level of pixels in the welding image, the denoising coefficient of the pixel can be obtained based on these parameters. Preferably, in this embodiment of the invention, the step of obtaining the denoising coefficient of the pixel includes: calculating and normalizing the product of the average value of the grayscale confidence level and the structural confidence level with the suspected noise level to obtain the denoising coefficient of the pixel. When the grayscale confidence level, structural confidence level, and suspected noise level of the pixel are all higher, the pixel is more likely to be a noise pixel, and thus the denoising coefficient is larger. Therefore, a greater degree of denoising is needed for this pixel to reduce the impact on the accuracy of welding defect detection. The formula for obtaining the denoising coefficient includes:

[0042] ,

[0043] In the formula, W represents the denoising coefficient of a pixel. E represents normalization, R represents gray level confidence, and H represents suspected noise level.

[0044] Furthermore, a larger denoising coefficient for a pixel indicates that the pixel is more likely to be noise, and the smoothness during denoising should be greater to reduce the impact of noise on detection accuracy. Conversely, a smaller denoising coefficient for a pixel indicates that the pixel is less likely to be noise, and the smoothness during denoising should be less to avoid over-smoothing of welding defects. Therefore, the standard deviation in the Gaussian filtering algorithm is adjusted based on the denoising coefficient to obtain the adaptive standard deviation of the pixel. Preferably, in this embodiment, the step of obtaining the adaptive standard deviation includes: calculating the difference between the preset maximum and preset minimum values ​​of the standard deviation in the Gaussian filtering algorithm to obtain the adjustment benchmark. In this embodiment, the preset maximum value of the standard deviation is 3, and the preset minimum value is 0.5, which can be determined by the implementer according to the implementation scenario. The product of the denoising coefficient and the adjustment benchmark is calculated to obtain the adjustment amount. The sum of the adjustment amount and the preset minimum value is calculated to obtain the adaptive standard deviation in the Gaussian filtering algorithm corresponding to the pixel. A larger denoising coefficient and a larger adjustment amount result in a larger adaptive standard deviation for the pixel and a greater smoothness during denoising.

[0045] After obtaining the adaptive standard deviation corresponding to each pixel in the welding image, the welding image can be denoised using a Gaussian filtering algorithm based on the adaptive standard deviation. Denoising using the adaptive standard deviation can achieve a greater degree of smoothing for noisy pixels and a smaller degree of smoothing for non-noisy pixels, thus preserving image details to a greater extent while removing noise. It should be noted that the Gaussian filtering algorithm is existing technology, and the specific denoising steps will not be described in detail. The denoised welding image is then enhanced to obtain the image to be detected. In this embodiment of the invention, the Retinex image enhancement algorithm is used to enhance the denoised welding image to obtain the image to be detected. The Retinex image enhancement algorithm is existing technology, and the specific steps will not be described in detail.

[0046] The welding defect detection module S4 is used to detect welding defects in the image to be inspected.

[0047] Compared to the original welding image, the image to be detected can effectively remove image noise while preserving the details of the weld, thus improving the accuracy of defect detection. Finally, the image to be detected is fed into a trained defect detection and localization model. The training method for this model involves acquiring a large number of manually annotated welding defect images covering various types of defects, and then using an existing convolutional neural network to learn from and train the model on these images. This defect detection and localization model can perform large-scale and accurate defect detection and localization on images to be detected; the implementer can determine the detection method for the images to be detected based on the implementation scenario.

[0048] In summary, this invention provides an intelligent welding defect localization and detection system based on image processing. It obtains the suspected noise level based on the gradient features and neighborhood gray-level distribution features of pixels in the welding image; obtains gray-level confidence based on the gray-level features of pixels and the gray-level difference features between pixels and their neighbors; obtains structural confidence based on the area features of the connected region where the pixel is located, the contour change features of the edge lines of the connected region, and the gradient distribution features in the normal direction of the edge lines; and obtains the denoising coefficient of the pixel based on the suspected noise level, gray-level confidence, and structural confidence, while adjusting the standard deviation in the Gaussian filtering algorithm. This invention denoises the welding image using a Gaussian filtering algorithm based on adaptive standard deviation, enhances the denoised welding image to obtain the image to be detected, and then detects welding defects in the image to be detected, thus improving detection accuracy.

[0049] It should be noted that the order of the above embodiments of the present invention is merely for descriptive purposes and does not represent the superiority or inferiority of the embodiments. The processes depicted in the accompanying drawings do not necessarily require a specific or sequential order to achieve the desired result. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.

[0050] The various embodiments in this specification are described in a progressive manner. The same or similar parts between the various embodiments can be referred to each other. Each embodiment focuses on describing the differences from other embodiments.

Claims

1. An image processing-based intelligent positioning and detection system for welding defects, characterized in that, The system includes the following modules: The image acquisition module is used to acquire welding images of parts after welding. The image analysis module is used to obtain the suspected noise level of a pixel based on the gradient features and neighborhood grayscale distribution features of the pixel in the welding image; to obtain the grayscale confidence level of the pixel based on the grayscale features of the pixel and the grayscale difference features between the pixel and its neighbors; and to obtain the structural confidence level of the pixel based on the area features of the connected region where the pixel is located, the contour change features of the edge lines of the connected region, and the gradient distribution features in the normal direction of the edge lines. The feature processing module is used to obtain the denoising coefficient of the pixel based on the suspected noise level, the gray level confidence level, and the structure confidence level; and to adjust the standard deviation in the Gaussian filtering algorithm based on the denoising coefficient to obtain the adaptive standard deviation of the pixel. The welding image is denoised using a Gaussian filtering algorithm based on the adaptive standard deviation, and the denoised welding image is then enhanced to obtain the image to be detected. A welding defect detection module is used to detect welding defects in the image to be inspected; The step of obtaining the structural confidence of the pixel based on the area characteristics of the connected region where the pixel is located, the contour change characteristics of the edge lines of the connected region, and the gradient distribution characteristics in the normal direction of the edge lines includes: Calculate the reciprocal of the area of ​​the minimum bounding rectangle of the connected component containing the pixel to obtain the small area feature value; calculate the standard deviation of the curvature at all edge pixels on the edge line of the connected component to obtain the edge shape complexity; construct a window excluding the edge pixel along the normal direction of the edge line with the edge pixel as the center, calculate and normalize the information entropy of the gradient direction of all window pixels within the window to obtain the direction change degree; calculate and normalize the reciprocal of the average gradient value of the window pixels within the window to obtain the edge abrupt change degree; calculate the sum of the direction change degree and the edge abrupt change degree to obtain the local gradient feature value of the edge pixel; calculate the average of the local gradient feature values ​​of all edge pixels on the edge line to obtain a first value; calculate and normalize the product of the small area feature value, the edge shape complexity, and the first value to obtain the structure confidence of the pixel; when the pixel does not have a connected component, the structure confidence of the pixel is a constant 1. The step of adjusting the standard deviation in the Gaussian filtering algorithm according to the denoising coefficient to obtain the adaptive standard deviation of the pixel includes: Calculate the difference between the preset maximum and preset minimum values ​​of the standard deviation in the Gaussian filtering algorithm to obtain the adjustment benchmark; calculate the product of the denoising coefficient and the adjustment benchmark to obtain the adjustment amount; calculate the sum of the adjustment amount and the preset minimum value to obtain the adaptive standard deviation in the Gaussian filtering algorithm corresponding to the pixel.

2. The intelligent positioning and detection system for welding defects based on image processing according to claim 1, characterized in that, The step of obtaining the suspected noise level of a pixel based on the gradient features and neighborhood grayscale distribution features of the pixel in the welding image includes: Calculate the proportion of other pixels with the same grayscale value as the pixel within a preset neighborhood of the pixel to obtain an anomaly level value; calculate the product of the gradient value of the pixel and the anomaly level value to obtain the suspected noise level of the pixel.

3. The intelligent positioning and detection system for welding defects based on image processing according to claim 1, characterized in that, The step of obtaining the gray level confidence level of the pixel based on the gray level features of the pixel and the gray level difference features between the pixel and its neighbors includes: Calculate the absolute value of the difference between the grayscale value of the pixel and the maximum grayscale value in the welding image to obtain the grayscale difference value; calculate and normalize the standard deviation of the grayscale values ​​within a preset neighborhood of the pixel to obtain the grayscale dispersion; calculate and normalize the sum of the absolute values ​​of the grayscale differences between the pixel and each other pixel within the preset neighborhood to obtain the neighborhood dispersion; calculate the sum of the grayscale dispersion and the neighborhood dispersion to obtain the local grayscale distribution value; calculate and normalize the product of the grayscale difference value and the local grayscale distribution value to obtain the grayscale confidence level of the pixel.

4. The intelligent positioning and detection system for welding defects based on image processing according to claim 1, characterized in that, The step of obtaining the denoising coefficient of the pixel based on the suspected noise level, the grayscale confidence level, and the structural confidence level includes: The denoising coefficient of the pixel is obtained by multiplying the average of the grayscale confidence and the structure confidence with the suspected noise level and normalizing the product.

5. The intelligent positioning and detection system for welding defects based on image processing according to claim 1, characterized in that, The step of enhancing the denoised welding image to obtain the image to be detected includes: The Retinex image enhancement algorithm is used to enhance the denoised welding image to obtain the image to be detected.

Citation Information

Patent Citations

  • Titanium alloy bar quality detection method and system

    CN116309570A

  • Environment-friendly plastic product defect detection method based on computer vision

    CN117058147A

  • Drilling positioning method of torque sensor based on image processing

    CN118014882A