Intelligent welding quality detection method and system

By using video image processing technology, the neatness, uniformity, and color difference characteristics of the weld are extracted to generate a comprehensive judgment index, which solves the problem of inaccurate welding quality inspection in the past and realizes rapid and accurate welding quality assessment.

CN118710641AActive Publication Date: 2024-09-27ENDU HEAVY IND (NANTONG) CO LTD

Patent Information

Application Number
CN202411187489.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-28
Publication Date
2024-09-27
Estimated Expiration
2044-08-28

Smart Images

  • Figure CN118710641A
    Figure CN118710641A
Patent Text Reader

Abstract

The invention provides an intelligent welding quality detection method and system, and relates to the field of welding quality detection.The intelligent welding quality detection method comprises the steps that an image at a welding seam is obtained, the image is processed into a gray level image and an HSV color space image, the uniformity and the neatness of pixel points of the welding seam are obtained in the gray level image, and the uniformity deviation rate and the neatness deviation rate are calculated; and a weld joint hue value and a base metal hue value are obtained in the HSV color space image, hue value deviation ratios are calculated, and a comprehensive judgment index is generated by combining the three kinds of deviation ratios to judge the welding quality. According to the method, the influence of various factors on the welding quality is comprehensively considered, judgment can be conducted only through pictures at the welding position, and accuracy and convenience are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of welding detection, and in particular to an intelligent welding quality detection method and system. Background Art

[0002] The welding process is widely used in daily life to connect objects because of its convenient operation and excellent effect. The appearance quality of welding not only affects the aesthetics of the product, but more importantly, it is an intuitive indicator for evaluating the quality of welding connections. High-quality welding can ensure the safety of the assembly or structure and the performance of the structure. At present, the main welding inspection methods are manual inspection and machine inspection. Manual inspection is that the welder visually observes the welding point. This method is quick and convenient, but it relies too much on the welder's experience and the accuracy cannot be guaranteed; machine inspection usually uses ultrasonic or X-rays to penetrate the material for inspection. Although this method is accurate, it is costly and inefficient.

[0003] In the prior art, publication number CN115007992B discloses a method: the thickness value of the workpiece before welding is subtracted from the thickness value of the workpiece after welding to generate a welding depth, the welding depth and the workpiece thickness are detected by ultrasonic wave to determine the welding collapse ratio, the collapse ratio of the workpiece that meets the quality requirements is used as the standard collapse ratio in advance, and the actual workpiece collapse ratio is compared with the standard collapse ratio. If the actual collapse ratio is less than the standard collapse ratio, it may be that the welding depth is too small or the workpiece thickness is too large, and it is judged that the welding is not in place; if the actual collapse ratio is greater than the standard collapse ratio, it may be that the welding depth is too large or the workpiece thickness is too small, and it is judged that the welding is excessive.

[0004] The main problem with the above method is that the welding quality is judged by the collapse ratio of the welding point. However, the actual weld may not be completely collapsed, but may also have bulges. Therefore, judging the welding quality only by the collapse degree is incomplete and inaccurate. Summary of the invention

[0005] The purpose of the present invention is to provide a welding quality intelligent detection method and system to solve the problems raised in the above background technology.

[0006] To achieve the above object, the present invention provides the following technical solutions:

[0007] A method and system for coal mine supervision based on video images, the specific steps include:

[0008] Step 1: Obtain an image of the weld, scale the image, adjust the image size to 224*224, and then copy the image into two identical sets of images. One set is grayscaled to obtain a first recognition image, and the other set is converted from RGB color space to HSV color space to obtain a second recognition image. The pixel positions of the first recognition image and the second recognition image are mapped one by one.

[0009] Step 2: Filter the first recognition image using a bilateral filter, count the frequency of pixels at each level in the 256 gray levels to form a grayscale histogram, calculate the inter-class variance of each threshold in the histogram, select the optimal separation threshold by the maximum inter-class variance, use the optimal separation threshold to separate the first recognition image after filtering, identify the foreground part and the background part, extract the foreground part to form a third recognition image, and extract the background part as a fourth recognition image;

[0010] Step 3: Process the third recognition image with the Soble operator to obtain edge points of the third recognition image, perform curve fitting on each edge pixel point to obtain an approximate curve of the weld, take the inflection point of the curve on the fitted curve, use the curvature formula to obtain the curvature value of the inflection point of the fitted curve, and generate the weld curvature from the curvature value; the weld curvature represents the neatness of the weld, and a neatness threshold is preset;

[0011] Step 4: Evenly divide the third recognition image according to the vertical coordinate to obtain a number of equal-height areas, count the number of retained pixels in each area, calculate the variance of the number of pixels in each area, record it as the weld uniformity, and preset a uniformity threshold;

[0012] Step 5: Map the position of each pixel in the third recognition image to the second recognition image, and collect the hue value corresponding to each retained pixel in the third recognition image to obtain the average hue value of the weld; collect the hue value corresponding to each pixel in the fourth recognition image to obtain the average hue value of the base material;

[0013] Step 6: Generate the uniformity deviation rate based on the uniformity and uniformity threshold of the weld, generate the uniformity deviation rate based on the weld uniformity and uniformity threshold, generate the hue deviation rate based on the average hue value of the weld and the average hue value of the base material, and generate a comprehensive judgment index based on the deviation rate to judge the welding quality.

[0014] Furthermore, the logic for calculating the optimal separation threshold is as follows: traverse all possible thresholds, separate the first recognition image into a background part and a foreground part according to the value of each threshold, count the number of pixels in the background part and the foreground part, calculate the mean of the grayscale values ​​of the pixels in the background part and the foreground part, and calculate the inter-class variance by a formula;

[0015] The formula for calculating the between-class variance is:

[0016]

[0017] in: The threshold is The between-class variance at The threshold is The ratio of the target (foreground) part to the total image. The threshold is When the gray value of the target part is The threshold is The ratio of the background part to the total image is The threshold is The gray value of the background part;

[0018] when When the maximum value is taken, the corresponding threshold is the optimal separation threshold.

[0019] Furthermore, the principle of using the Soble operator to process the third recognition image to obtain the edge points of the third recognition image is as follows: multiply the grayscale value of each pixel and the grayscale values ​​of its eight adjacent pixels by the Soble operator horizontal template, and add all the products to obtain the horizontal gradient value of the pixel; multiply the grayscale value of the pixel and the grayscale values ​​of its eight adjacent pixels by the Soble operator vertical template, and add all the results to obtain the vertical gradient value. The horizontal gradient value calculation formula is:

[0020]

[0021] The vertical gradient value calculation formula is:

[0022]

[0023] in: The coordinates are ( , )’s horizontal gradient value, The coordinates are ( , )’s vertical gradient value, The coordinates are ( , ) The gray value of the pixel;

[0024] The formula for generating the gradient magnitude is:

[0025]

[0026] in: The coordinates are The gradient amplitude of the pixel point;

[0027] Set an edge threshold, when the coordinate is When the pixel gradient amplitude is greater than the edge threshold, the pixel is regarded as an edge pixel.

[0028] Furthermore, the formula for calculating the inflection point curvature is:

[0029]

[0030] in: Indicates The curvature of the weld at the inflection point, Indicates that the horizontal axis is Find the second-order derivative of the inflection point, Indicates that the horizontal axis is Find the first derivative of the inflection point.

[0031] Furthermore, the formula for generating weld evenness from the inflection point curvature is:

[0032]

[0033] in: Indicates the uniformity of the weld, n indicates the number of inflection points, Indicates The curvature of the inflection point.

[0034] Furthermore, the formula for calculating the variance of the number of pixels in each area, that is, the uniformity of the weld seam, is:

[0035]

[0036]

[0037] in: Represents the average number of pixels in each area, Indicates The number of pixels in the area, Indicates the number of regions, Represents the variance of the number of pixels in each region.

[0038] Furthermore, the formula for calculating the average hue value of the weld is:

[0039]

[0040] in: represents the average hue value of the weld, s represents the number of weld pixels, Indicates the weld The hue value of each pixel;

[0041] The formula for calculating the average hue value of the parent material is:

[0042]

[0043] in: Indicates the average hue value of the parent material. Indicates the number of pixels of the parent material. Indicates the parent material The hue value of a pixel.

[0044] Furthermore, the formula for generating the neatness deviation rate is:

[0045]

[0046] in: Indicates the uniformity deviation rate, Indicates the neatness threshold, the actual neatness The larger the uniformity deviation rate The larger the deviation is, the smaller the error is. ≤1, the neatness deviation is within the threshold;

[0047] The formula for generating the uniformity deviation rate is:

[0048]

[0049] in: represents the uniformity deviation rate, Indicates the uniformity of the weld. represents the uniformity threshold, when When ≤1, the uniformity deviation rate is within the threshold;

[0050] The formula for generating the hue deviation rate is:

[0051]

[0052] in: represents the hue deviation rate, Indicates the hue value threshold, the actual weld hue value The larger the hue deviation rate The larger the deviation rate is, the greater the ≤ When , the hue value deviation rate is within the threshold;

[0053] The formula for generating the comprehensive judgment index is:

[0054]

[0055] in: represents the comprehensive judgment index, represents the uniformity deviation rate, Indicates the uniformity deviation rate, Indicates the hue deviation rate.

[0056] The present invention further provides a welding quality intelligent detection system, which is used to implement the above welding quality detection method, including:

[0057] Image acquisition module: obtain the image of the welding point, scale the image of the welding point, adjust the size of the image to 224*224, and then copy the image into two identical groups of images. One group is grayed to obtain the first recognition image, and the other group is converted from the RGB color space to the HSV color space to obtain the second recognition image, and the pixel positions of the first recognition image and the second recognition image are mapped one by one;

[0058] Image separation module: filter the first recognition image using a bilateral filter, count the frequency of pixels at each level in 256 gray levels to form a grayscale histogram, calculate the inter-class variance of each threshold in the histogram, select the optimal separation threshold by the maximum inter-class variance, use the optimal separation threshold to separate the first recognition image after filtering, identify the foreground part and the background part, extract the foreground part to form a third recognition image, and extract the background part as the fourth recognition image;

[0059] Curve fitting module: the third recognition image is processed with the Soble operator to obtain the edge points of the third recognition image, curve fitting is performed on each edge pixel point to obtain the approximate curve of the weld, the inflection point of the curve is taken on the fitted curve, the curvature value of the inflection point of the fitted curve is obtained with the curvature formula, and the weld curvature is generated from the curvature value; the weld curvature represents the neatness of the weld, and a neatness threshold is preset at the same time;

[0060] Pixel recognition module: evenly divide the third recognition image according to the vertical coordinate to obtain several equal-height areas, count the number of retained pixels in each area, calculate the variance of the number of pixels in each area, record it as the weld uniformity, and preset the uniformity threshold;

[0061] Tone recognition module: maps the position of each pixel in the third recognition image to the second recognition image, and collects the tone value corresponding to each retained pixel in the third recognition image to obtain the average tone value of the weld; collects the tone value corresponding to each pixel in the fourth recognition image to obtain the average tone value of the base material;

[0062] Comprehensive processing module: Generate the uniformity deviation rate according to the uniformity threshold of the weld, generate the uniformity deviation rate according to the weld uniformity and uniformity threshold, generate the hue deviation rate according to the average hue value of the weld and the average hue value of the parent material, and generate a comprehensive judgment index based on the deviation rate to judge the welding quality.

[0063] Compared with the prior art, the present invention has the following beneficial effects:

[0064] The present invention evaluates the welding quality by analyzing the image features of the weld, specifically including the uniformity of the weld, the neatness of the weld and the color difference value of the weld. The method of mutually mapping the gray value image and the image of the HSV color space is adopted. The uniformity of the weld is represented by the variance of the pixel points in different regions, and the uniformity deviation rate is generated with the uniformity threshold. The uniformity of the weld is represented by the curvature of the image inflection point, and the neatness deviation rate is generated with the neatness threshold. The hue characteristics of the weld and the base material are identified by the HSV color space to generate the hue deviation rate. The three deviation rates generate a comprehensive judgment index to judge the welding quality. This method only needs the image of the welding point to analyze and judge, which is cost-saving and very fast. BRIEF DESCRIPTION OF THE DRAWINGS

[0065] Figure 1 This is a flow chart of a method for intelligent detection of welding quality according to an embodiment of the present invention;

[0066] Figure 2 This is a system module diagram of intelligent welding quality detection according to an embodiment of the present invention. DETAILED DESCRIPTION

[0067] In order to make the objectives, technical solutions and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with specific embodiments.

[0068] It should be noted that, unless otherwise defined, the technical terms or scientific terms used in the present invention should be understood by people with ordinary skills in the field to which the present invention belongs. The words "first", "second" and similar words used in the present invention do not indicate any order, quantity or importance, but are only used to distinguish different components. "Include" or "comprise" and similar words mean that the elements or objects appearing before the word include the elements or objects listed after the word and their equivalents, without excluding other elements or objects. "Connect" or "connected" and similar words are not limited to physical or mechanical connections, but may include electrical connections, whether direct or indirect. "Up", "down", "left", "right" and the like are only used to indicate relative positional relationships. When the absolute position of the described object changes, the relative positional relationship may also change accordingly.

[0069] Example:

[0070] See also Figure 1 The present invention provides a welding quality intelligent detection method and system, which solves the problem of inaccurate welding quality detection. The specific steps include:

[0071] Step 1: Get the image of the welding point, scale the image of the welding point, adjust the size of the image to 224*224, and then copy the image into two identical groups of images. One group is grayed to obtain the first recognition image, and the other group is converted from the RGB color space to the HSV color space to obtain the second recognition image, and the pixel positions of the first recognition image and the second recognition image are mapped one by one.

[0072] In this embodiment, the image size is adjusted to 224*224, which can retain the main features and structural information of the image and avoid excessive distortion. At the same size, data can be more easily compared, reducing the computational complexity. The purpose of copying the image into two groups of images and graying one of the groups to generate the first recognition image is: the grayed image retains the brightness information of the image, reduces the interference of the image color, enhances the image contrast, and makes the structural features of the image easier to identify. Subsequently, it is necessary to find the optimal separation threshold for the first recognition image after the graying process to retrieve the number of pixels. The formula for graying is:

[0073]

[0074] in, is the grayscale value of the first recognition image, represents the brightness value of the red channel of the initial image, Represents the brightness value of the green channel of the initial image, Indicates the brightness value of the blue channel of the original image.

[0075] In this embodiment, the purpose of converting the image from the RGB color space to the HSV color space to generate the second recognition image is: the HSV color space uses a method that is more in line with human perception to describe color, and it divides the attributes of color into: hue, saturation, and value; where hue indicates the type of color, which is an angle value from 0 to 360°, corresponding to the position on the color spectrum, 0° and 360° correspond to red, 120° corresponds to green, and 240° corresponds to blue; saturation indicates the intensity of the color, when the saturation is 0, it indicates grayscale color, the lightest color, the higher the saturation, the brighter the color; brightness indicates the lightness of the color, ranging from 0-100%, when the brightness is 0 it indicates black, and when the brightness is 100% it indicates white. The principle of converting an image from the RGB color space to the HSV color space is: for any pixel in the image, its RGB color space is ( ), the HSV color space is , first The value is converted to the range [0,1]:

[0076]

[0077]

[0078]

[0079] Then calculate The value of

[0080]

[0081]

[0082]

[0083] When processing images through OpenCV, it is necessary to visualize the HSV image. The value is converted to [0,255]:

[0084]

[0085]

[0086]

[0087] This completes the conversion of the image from RGB color space to HSV color space.

[0088] In this embodiment, the pixel points after image scaling are marked with coordinates, the bottom pixel point of the image is taken as the first row, the most coordinate pixel point is taken as the first column, a coordinate system is established, and the first recognition image and the second recognition image are mapped according to the coordinate system to ensure that each pixel point has unique coordinates.

[0089] Step 2: Filter the first recognition image using a bilateral filter, count the frequency of pixels at each level in 256 gray levels to form a grayscale histogram, and calculate the inter-class variance of each threshold in the histogram, select the best separation threshold by the maximum inter-class variance, use the best separation threshold to separate the first recognition image after filtering, identify the foreground part and the background part, extract the foreground part to form the third recognition image, and extract the background part as the fourth recognition image; the logic for calculating the best separation threshold is: traverse all possible thresholds, separate the first recognition image into the background part and the foreground part according to the value of each threshold, count the number of pixels in the background part and the foreground part, calculate the mean of the grayscale values ​​of the pixels in the background part and the foreground part, and calculate the inter-class variance by the formula;

[0090] The calculation formula of the inter-class variance is:

[0091] In this embodiment, the calculation formula of the inter-class variance is the formula of the Otsu threshold method OTSU, The threshold is The between-class variance at Indicates the proportion of the target (foreground) part to the total image, The threshold is When the gray value of the target part is The threshold is The ratio of the background part to the total image is The threshold is When the gray value of the background part; when The larger the value, the greater the difference between the two parts of the image, and the better the separation effect. This is the optimal separation threshold. In this example, the tonal values ​​of the weld and the base material need to be compared later. The image is separated into the foreground part including the weld and the background part including the base material by the optimal separation threshold.

[0092] Step 3: Use the Soble operator to process the third recognition image to obtain the edge points of the third recognition image, perform curve fitting on each edge pixel point to obtain the approximate curve of the weld, take the curve inflection point on the fitted curve, use the curvature formula to obtain the curvature value of the inflection point of the fitting curve, and generate the weld curvature from the curvature value; the weld curvature represents the uniformity of the weld, and the uniformity threshold is preset; the principle of identifying edge points by the Soble operator is: multiply the grayscale value of each pixel point and the grayscale values ​​of its eight adjacent pixels by the Soble operator horizontal template, and add all the products to obtain the horizontal gradient value of the pixel point, multiply the grayscale value of the pixel point and the grayscale values ​​of its eight adjacent pixels by the Soble operator vertical template, and add all the results to obtain the vertical gradient value, the coordinates are , gray value is The calculation formula for the horizontal gradient value of a pixel is:

[0093]

[0094] The vertical gradient value calculation formula is:

[0095]

[0096] Gradient Amplitude The calculation formula is:

[0097]

[0098] In this embodiment, the greater the curvature of the inflection point, the greater the deviation of the arc between the weld and the horizontal plane, and the smaller the neatness; the smaller the curvature of the inflection point, the smaller the deviation of the arc between the weld and the horizontal plane; Indicates Row, No. The horizontal gradient value of the column pixel; Indicates Row, No. The vertical gradient value of the column pixel; Indicates Row, No. Gray value of the column pixel; Indicates Row, No. The gradient magnitude of the pixel column.

[0099] By traversing all the gradient amplitudes, the optimal edge threshold is set. When the gradient amplitude of a pixel point is greater than the optimal edge threshold, the pixel point is regarded as an edge pixel point;

[0100] Assume that the image has n inflection points, then The curvature of the inflection point The calculation formula is:

[0101] By the inflection point curvature Generate weld evenness The formula is:

[0102]

[0103] in, Indicates the function graph The curvature value corresponding to the inflection point is Indicates The horizontal coordinate of the inflection point is , the first-order derivative of the corresponding function, Indicates The horizontal coordinate of the inflection point is , the corresponding second-order derivative of the function.

[0104] The neatness threshold is: the base material is set as a horizontal plane, and the level difference between the weld and the base material surface is the neatness. By observing or measuring the range of the weld protrusion or depression, the neatness threshold that meets the quality standards and aesthetics is determined. .

[0105] Step 4: Evenly divide the third recognition image according to the vertical coordinate to obtain a number of equal-height areas, count the number of retained pixels in each area, calculate the variance of the number of pixels in each area, record it as the weld uniformity, and preset a uniformity threshold;

[0106] In this embodiment, the uniformity of the weld seam means dividing the weld seam into equal-sized regions, and calculating the variance of the pixels in all regions to determine whether the number of pixels in each region is close. The larger the variance of the number of pixels, the larger the difference in the number of pixels in each region, and the smaller the uniformity of the weld seam; the smaller the variance of the number of pixels, the smaller the difference in the number of pixels in each region, and the greater the uniformity of the weld seam;

[0107] If there are m regions, then calculate the average number of pixels in all m regions for:

[0108] Pixel number variance for:

[0109]

[0110] in, Represents the average number of pixels in all regions. Indicates The number of pixels in the area, Represents the variance of the number of pixels in all regions, i.e., the uniformity of the weld;

[0111] Setting of the uniformity threshold: Collect materials with unqualified welding quality, detect the uniformity of the weld, and determine the optimal uniformity threshold based on the morphology of samples with unqualified welds and samples with qualified welds .

[0112] Step 5: Map the position of each pixel in the third recognition image to the second recognition image, and collect the hue value corresponding to each retained pixel in the third recognition image to obtain the average hue value of the weld; collect the hue value corresponding to each pixel in the fourth recognition image to obtain the average hue value of the base material, and set the hue deviation threshold.

[0113] In this embodiment, the average hue value is collected in the HSV color space. The target color space for conversion can be determined by cv2.COLOR_BGR2HSV of the OpenCV library in Python. The hue value of the point with coordinates (r, t) is extracted by hsv_image[r, t, 0]. The hue value is the hue information of the pixel point. The hue value of each pixel point is output by h_values. , calculate the The average hue value of the weld at each pixel for:

[0114]

[0115] Using the same method, we can calculate The average hue value of the base material of each pixel is:

[0116]

[0117] in, Represents the average hue value of all pixels at the weld. Indicates the number of pixels at the weld. Indicates the weld The hue value of each pixel;

[0118] Represents the average hue value of all pixels of the base material. Indicates the number of pixels of the parent material. Indicates the parent material The hue value of each pixel;

[0119] The hue deviation threshold: collect the hue value of the base material, and determine the optimal deviation threshold by observing and comparing the hue deviations between the welding materials with different hue values ​​and the base material. .

[0120] Step 6: Generate the uniformity deviation rate based on the uniformity and uniformity threshold of the weld, generate the uniformity deviation rate based on the weld uniformity and uniformity threshold, generate the hue deviation rate based on the average hue value of the weld and the average hue value of the base material, and generate a comprehensive judgment index based on the deviation rate to judge the welding quality.

[0121] In this embodiment, the parent material is regarded as a horizontal plane, and the uniformity deviation rate of the weld represents the surface difference between the weld and the parent material. The larger the surface difference, the lower the uniformity of the weld and the worse the welding quality; the smaller the surface difference, the closer the weld and the parent material are to being flush, the higher the uniformity and the better the welding quality; the calculation formula of the uniformity deviation rate is:

[0122] Indicates the neatness threshold, the actual neatness The larger the uniformity deviation rate The larger the deviation is, the smaller the error is. ≤1, the evenness test passes;

[0123] In this embodiment, materials with unqualified welding quality are collected, and the uniformity at the weld is detected. The optimal uniformity threshold is determined according to the morphology of samples with unqualified welds and qualified welds. The closer the weld uniformity is to the threshold, the greater the uniformity deviation rate is, and the worse the welding quality is; the farther the weld uniformity is from the threshold, the smaller the uniformity deviation rate is, and the better the welding quality is. The calculation formula of the uniformity deviation rate is:

[0124]

[0125] Indicates the uniformity threshold, the actual uniformity The larger the uniformity deviation rate The larger the deviation is, the smaller the error is. ≤1, the uniformity test passes;

[0126] In this embodiment, the hue deviation rate represents the deviation between the hue value at the weld and the hue value of the base material in the HSV color space. The smaller the hue deviation rate, the closer the hue of the weld is to that of the base material, and the better the welding quality. The larger the hue deviation value, the greater the difference between the hue of the weld and the base material, and the worse the welding quality. The calculation formula of the hue deviation rate is:

[0127]

[0128] Indicates the hue value threshold, the actual weld hue value The larger the hue deviation rate The larger the deviation rate is, the greater the ≤ When , the hue value detection passes;

[0129] The formula for generating the comprehensive judgment index based on the three deviation rates is:

[0130]

[0131] in, and The coefficient of the comprehensive judgment index has a value range of [0,1]. If all three deviation rates are within the threshold range, the quality can be judged as qualified. At this time, the uniformity threshold is 0≤ ≤1, neatness threshold 0≤△ ≤1, hue deviation rate ≤ ,Right now: The value range is [ ].

[0132] See also Figure 2 The present invention further provides a welding quality intelligent detection system, which is used to implement the above welding quality detection method, including:

[0133] Image acquisition module: obtain the image of the welding point, scale the image of the welding point, adjust the size of the image to 224*224, and then copy the image into two identical groups of images. One group is grayed to obtain the first recognition image, and the other group is converted from the RGB color space to the HSV color space to obtain the second recognition image, and the pixel positions of the first recognition image and the second recognition image are mapped one by one;

[0134] Image separation module: filter the first recognition image using a bilateral filter, count the frequency of pixels at each level in 256 gray levels to form a grayscale histogram, calculate the inter-class variance of each threshold in the histogram, select the optimal separation threshold by the maximum inter-class variance, use the optimal separation threshold to separate the first recognition image after filtering, identify the foreground part and the background part, extract the foreground part to form a third recognition image, and extract the background part as the fourth recognition image;

[0135] Curve fitting module: the third recognition image is processed with the Soble operator to obtain the edge points of the third recognition image, curve fitting is performed on each edge pixel point to obtain the approximate curve of the weld, the inflection point of the curve is taken on the fitted curve, the curvature value of the inflection point of the fitted curve is obtained with the curvature formula, and the weld curvature is generated from the curvature value; the weld curvature represents the neatness of the weld, and a neatness threshold is preset at the same time;

[0136] Pixel recognition module: evenly divide the third recognition image according to the vertical coordinate to obtain several equal-height areas, count the number of retained pixels in each area, calculate the variance of the number of pixels in each area, record it as the weld uniformity, and preset the uniformity threshold;

[0137] Tone recognition module: maps the position of each pixel in the third recognition image to the second recognition image, and collects the tone value corresponding to each retained pixel in the third recognition image to obtain the average tone value of the weld; collects the tone value corresponding to each pixel in the fourth recognition image to obtain the average tone value of the base material;

[0138] Comprehensive processing module: Generate the uniformity deviation rate according to the uniformity threshold of the weld, generate the uniformity deviation rate according to the weld uniformity and uniformity threshold, generate the hue deviation rate according to the average hue value of the weld and the average hue value of the parent material, and generate a comprehensive judgment index based on the deviation rate to judge the welding quality.

[0139] The above formulas are all dimensionless and numerical calculations. The formula is a formula for the most recent real situation obtained by collecting a large amount of data and performing software simulation. The preset parameters in the formula are set by technicians in this field according to actual conditions.

[0140] The above embodiments may be implemented in whole or in part by software, hardware, firmware or any other combination thereof. When implemented by software, the above embodiments may be implemented in whole or in part in the form of a computer program product. Those skilled in the art may appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein may be implemented by electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed by hardware or software methods depends on the specific application and design constraints of the technical solution.

[0141] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, and may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0142] The above description is only a specific implementation manner of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application.

Claims

1. A welding quality intelligent detection method and system, characterized in that: The specific steps include: Step 1: Obtain an image of the weld, scale the image, adjust the image size to 224*224, and then copy the image into two identical sets of images. One set is grayscaled to obtain a first recognition image, and the other set is converted from RGB color space to HSV color space to obtain a second recognition image. The pixel positions of the first recognition image and the second recognition image are mapped one by one. Step 2: Filter the first recognition image using a bilateral filter, count the frequency of pixels at each level in the 256 gray levels to form a grayscale histogram, calculate the inter-class variance of each threshold in the histogram, select the optimal separation threshold by the maximum inter-class variance, use the optimal separation threshold to separate the first recognition image after filtering, identify the foreground part and the background part, extract the foreground part to form a third recognition image, and extract the background part as a fourth recognition image; Step 3: Process the third recognition image with the Soble operator to obtain edge points of the third recognition image, perform curve fitting on each edge pixel point to obtain an approximate curve of the weld, take the inflection point of the curve on the fitted curve, use the curvature formula to obtain the curvature value of the inflection point of the fitted curve, and generate the weld curvature from the curvature value; the weld curvature represents the neatness of the weld, and a neatness threshold is preset; Step 4: Evenly divide the third recognition image according to the vertical coordinate to obtain a number of equal-height areas, count the number of retained pixels in each area, calculate the variance of the number of pixels in each area, record it as the weld uniformity, and preset a uniformity threshold; Step 5: Map the position of each pixel in the third recognition image to the second recognition image, and collect the hue value corresponding to each pixel in the third recognition image to obtain the average hue value of the weld; collect the hue value corresponding to each pixel in the fourth recognition image to obtain the average hue value of the base material, and preset the hue deviation threshold; Step 6: Generate the uniformity deviation rate based on the uniformity and uniformity threshold of the weld, generate the uniformity deviation rate based on the weld uniformity and uniformity threshold, generate the hue deviation rate based on the average hue value of the weld and the average hue value of the base material, and generate a comprehensive judgment index based on the deviation rate to judge the welding quality.

2. A welding quality intelligent detection method as claimed in claim 1, characterized in that: The logic for calculating the optimal separation threshold in step 2 is: traverse all possible thresholds, separate the first recognition image into a background part and a foreground part according to the value of each threshold, count the number of pixels in the background part and the foreground part, calculate the mean of the grayscale values ​​of the pixels in the background part and the foreground part, and calculate the inter-class variance by a formula; The formula for calculating the between-class variance is: in: The threshold is The between-class variance at The threshold is The ratio of the target (foreground) part to the total image. The threshold is When the gray value of the target part is The threshold is The ratio of the background part to the total image is The threshold is The gray value of the background part; when When the maximum value is taken, the corresponding threshold is the optimal separation threshold.

3. A welding quality intelligent detection method as claimed in claim 1, characterized in that: The principle of processing the third recognition image with the Soble operator to obtain the edge points of the third recognition image in step 3 is as follows: multiplying the grayscale value of each pixel and the grayscale values ​​of its eight adjacent pixels with the Soble operator horizontal template, and adding all the products to obtain the horizontal gradient value of the pixel; multiplying the grayscale value of the pixel and the grayscale values ​​of its eight adjacent pixels with the Soble operator vertical template, and adding all the results to obtain the vertical gradient value; the horizontal gradient value calculation formula is: The vertical gradient value calculation formula is: in: The coordinates are ( , )’s horizontal gradient value, The coordinates are ( , )’s vertical gradient value, The coordinates are ( , ) The gray value of the pixel; The formula for generating the gradient magnitude is: in: The coordinates are The gradient amplitude of the pixel point; Set an edge threshold, when the coordinate is When the pixel gradient amplitude is greater than the edge threshold, the pixel is regarded as an edge pixel.

4. The intelligent welding quality detection method according to claim 1, characterized in that: The formula for calculating the inflection point curvature in step 3 is: in: Indicates The curvature of the weld at the inflection point, Indicates that the horizontal axis is No. Find the second-order derivative of the inflection point, Indicates that the horizontal axis is No. Find the first-order derivative of the inflection point.

5. The intelligent welding quality detection method according to claim 1, characterized in that: The formula for generating the weld evenness from the inflection point curvature in step 3 is: in: Indicates the uniformity of the weld, n indicates the number of inflection points, Indicates The curvature of the inflection point.

6. A welding quality intelligent detection method as claimed in claim 1, characterized in that: The formula for calculating the variance of the number of pixels in each region in step 4, i.e., the uniformity of the weld seam, is: in: Represents the average number of pixels in each area, Indicates The number of pixels in the area, Indicates the number of regions, Represents the variance of the number of pixels in each region.

7. The intelligent welding quality detection method according to claim 1, characterized in that: The formula for calculating the average hue value of the weld in step 5 is: in: represents the average hue value of the weld, s represents the number of weld pixels, Indicates the weld The hue value of each pixel; The formula for calculating the average hue value of the parent material is: in: Indicates the average hue value of the parent material. Indicates the number of pixels of the base material. Indicates the parent material The hue value of a pixel.

8. The intelligent welding quality detection method according to claim 1, characterized in that: The principle for generating the comprehensive judgment index in step 6 is: the formula for generating the neatness deviation rate is: in: Indicates the uniformity deviation rate, Indicates the neatness threshold, the actual neatness The larger the uniformity deviation rate The larger the deviation is, the smaller the error is. ≤1, the neatness deviation is within the threshold; The formula for generating the uniformity deviation rate is: in: represents the uniformity deviation rate, Indicates the uniformity of the weld. represents the uniformity threshold, when When ≤1, the uniformity deviation rate is within the threshold; The formula for generating the hue deviation rate is: in: represents the hue deviation rate, Indicates the hue value threshold, the actual weld hue value The larger the hue deviation rate The larger the deviation rate is, the greater the ≤ When , the hue value deviation rate is within the threshold; The formula for generating the comprehensive judgment index is: in: represents the comprehensive judgment index, represents the uniformity deviation rate, Indicates the uniformity deviation rate, Indicates the hue deviation rate.

9. An intelligent welding quality detection system, characterized in that: The early warning system is used to implement the intelligent welding quality detection method according to any one of claims 1 to 7, comprising: Image acquisition module: obtain the image of the welding point, scale the image of the welding point, adjust the size of the image to 224*224, and then copy the image into two identical groups of images. One group is grayed to obtain the first recognition image, and the other group is converted from the RGB color space to the HSV color space to obtain the second recognition image, and the pixel positions of the first recognition image and the second recognition image are mapped one by one; Image separation module: filter the first recognition image using a bilateral filter, count the frequency of pixels at each level in 256 gray levels to form a grayscale histogram, calculate the inter-class variance of each threshold in the histogram, select the optimal separation threshold by the maximum inter-class variance, use the optimal separation threshold to separate the first recognition image after filtering, identify the foreground part and the background part, extract the foreground part to form a third recognition image, and extract the background part as the fourth recognition image; Curve fitting module: the third recognition image is processed with the Soble operator to obtain the edge points of the third recognition image, curve fitting is performed on each edge pixel point to obtain the approximate curve of the weld, the inflection point of the curve is taken on the fitted curve, the curvature value of the inflection point of the fitted curve is obtained with the curvature formula, and the weld curvature is generated from the curvature value; the weld curvature represents the neatness of the weld, and a neatness threshold is preset at the same time; Pixel recognition module: evenly divide the third recognition image according to the vertical coordinate to obtain several equal-height areas, count the number of retained pixels in each area, calculate the variance of the number of pixels in each area, record it as the weld uniformity, and preset the uniformity threshold; Tone recognition module: maps the position of each pixel in the third recognition image to the second recognition image, and collects the tone value corresponding to each retained pixel in the third recognition image to obtain the average tone value of the weld; collects the tone value corresponding to each pixel in the fourth recognition image to obtain the average tone value of the base material; Comprehensive processing module: Generate the uniformity deviation rate according to the uniformity threshold of the weld, generate the uniformity deviation rate according to the weld uniformity and uniformity threshold, generate the hue deviation rate according to the average hue value of the weld and the average hue value of the parent material, and generate a comprehensive judgment index based on the deviation rate to judge the welding quality.

Citation Information

Patent Citations

  • Connecting method and device for various metals

    CN105689859A

  • Weld surface defect feature extraction method based on image gray scale B sweeping curve

    CN105931227A

  • Method for identifying welded seam based on image distinctiveness detection

    CN107424142A

  • Abnormal production detection method for laser welding products

    CN114972343A

  • Formed foil appearance defect detection method and system

    CN118501177A

Cited By

  • Pineapple leaf fiber fabric evaluation method based on multispectral image

    CN120219392A

  • Evaluation method of pineapple leaf fiber fabric based on multispectral image

    CN120219392B

  • Tunnel lining surface crack risk detection method and system and medium

    CN120339190A