Steel structure welding seam quality detection method
By introducing local thresholds and judgment thresholds in the quality testing of steel structure welds, combined with image coordinates, dynamically adjust the threshold to adapt to the light and texture changes in the weld area, solve the problem of inaccurate detection results in existing technologies, and achieve efficient efficiency , Accurate welding defect recognition and positioning.
Patent Information
- Application Number
- CN202411276375.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-12
- Publication Date
- 2025-01-21
AI Technical Summary
The prior art uses fixed parameters in the quality inspection of steel structure welds, resulting in inaccurate detection results, and weld defects cannot be effectively identified and positioned.
By introducing local thresholds and judging thresholds, combined with image coordinates, dynamically adjust the threshold to adapt to uneven light and texture changes in the weld area, and achieve precise identification and positioning of welded defects.
The accuracy and efficiency of welded quality detection have been improved, artificial errors and costs are reduced, and it can be suitable for a variety of welded seam types and light conditions.
Smart Images

Figure CN119338750A_ABST
Abstract
Description
Technical Field
[0001] The invention relates to the technical field of image processing, and in particular to a method for detecting the quality of welds of steel structures. Background Art
[0002] At present, great importance is attached to the quality inspection of steel structures. Steel requires a strong load-bearing capacity. Since defects will affect the load-bearing capacity of steel, the surface of the steel should be as free of defects as possible. However, welding technology must be used in the assembly process of steel, and welding technology has certain quality defects, such as shrinkage holes, slag inclusions, and pores. These defects will affect the load-bearing capacity of steel. Therefore, quality inspection of welds in steel structures is very important.
[0003] The existing algorithm generally uses fixed parameters to cluster the steel structure weld area images to obtain defect areas. Due to the differences in different steel structure weld areas, the fixed parameters are used to perform quality inspections on different steel structure welds, resulting in inaccurate steel structure welding quality inspection results. Summary of the invention
[0004] The present application provides a steel structure weld quality detection method, which can confirm the defect area and defect type by adding a local threshold and a judgment threshold, making the weld quality detection more accurate. At the same time, image coordinates are introduced to accurately locate the position of the defect area.
[0005] The present application provides a method for detecting the quality of steel structure welds, comprising:
[0006] S101, collecting a color image of the weld area of the steel structure, imaging the weld area using an industrial camera, performing filtering and denoising preprocessing operations on the color image; graying the acquired color image to obtain a gray value of each pixel;
[0007] S102, selecting a neighborhood, that is, a pixel range surrounding each pixel point, for each pixel point in the image, assigning different weights to the pixel values in each neighborhood according to their distance from the central pixel, and then calculating the weighted average value as the local threshold;
[0008] S103, receiving a pixel point in the image, and comparing the pixel value of the pixel point itself with the local threshold calculated in its neighborhood. If the pixel value is higher than the local threshold, it means that the pixel point is in a normal area, that is, the weld or the part around the weld without obvious defects; if the pixel value is lower than the local threshold, it means that the pixel point has a defect;
[0009] S104, locating the position of the detected weld defect by using the image coordinates, locating the position of the weld defect and outputting corresponding position information;
[0010] S105, receiving the position information outputted from the defective area for further analyzing the characteristics and area of the defects in the defective area, and repairing the defects of the steel structure weld through the analysis.
[0011] Preferably, the weight calculation formula is:
[0012]
[0013] Among them, i,j are the coordinates of a pixel in the neighborhood, k i ,k j are the coordinates of the center pixel and σ is the standard deviation of the Gaussian function.
[0014] Preferably, the local threshold is:
[0015]
[0016] Among them, the gray value (i, j) is the gray value of the pixel in the neighborhood.
[0017] Preferably, the method for locating the defective area comprises:
[0018] S201, constructing a two-dimensional image coordinate, wherein the two-dimensional image coordinate takes the upper left corner of the image as the coordinate origin, wherein the X-axis extends horizontally to the right, representing the change in image width, i.e., from the leftmost end to the rightmost end of the image; and the Y-axis extends vertically downward, representing the change in image height, i.e., from the topmost end to the bottommost end of the image;
[0019] S202, selecting a marking shape so that the marking shape can surround the defect area, a rectangular frame is selected as the marking shape for defects with regular shapes and clear boundaries, and an ellipse or polygon is selected as the marking shape for defects with irregular shapes and fuzzy boundaries;
[0020] S203, drawing a marked shape, drawing a marked shape on the image;
[0021] S204, marking the coordinate range of the marked shape, and after the marking is completed, verifying the marking result.
[0022] Preferably, the image drawing includes drawing a rectangular frame and an ellipse. For a rectangular frame, the coordinate points of its upper left corner and lower right corner, i.e., x1, y1 and x2, y2, are specified, and a rectangle connecting the two points is drawn; for an ellipse and a polygon, the coordinates of each vertex are specified in turn, and a corresponding shape is drawn according to each vertex;
[0023] Preferably, the steps of identifying the type of defect in the defect area are as follows:
[0024] S301, extracting features in the defect area, wherein the features include texture features, shape features, and color features;
[0025] S302, training a classification model, using a sample data set containing various defect types, and using the data set to train the model;
[0026] S303, input the extracted defect features into the convolutional neural network, and the convolutional neural network outputs a prediction result;
[0027] S304, setting a determination threshold, which is used to classify the prediction results of the model. If the prediction probabilities of all types do not exceed the threshold, the defect area is marked as "uncertain".
[0028] Preferably, the determination threshold is obtained by collecting historical data, processing and analyzing the historical data.
[0029] Preferably, in step S302, the prediction result is a probability distribution, indicating the possibility that the input defect region belongs to each defect type.
[0030] Preferably, the texture features include a gray level co-occurrence matrix and a local binary pattern, the gray level co-occurrence matrix being the gray level dependency between pixels in an image and pixels in its neighborhood;
[0031] The local binary pattern compares the grayscale values of the central pixel and its surrounding neighborhood pixels to generate a binary number, and then converts the binary number into a decimal number.
[0032] Preferably, based on step S304, when the defective area cannot be confirmed, return to step S301 and re-extract the defect features.
[0033] One or more technical solutions provided in this application have at least the following technical effects or advantages:
[0034] The local threshold calculation method dynamically adjusts the threshold to cope with uneven lighting and texture changes in the weld area by considering the spatial position relationship of the pixel neighborhood, thereby more accurately reflecting the local characteristics of the image. This method not only realizes real-time detection of weld defects and provides immediate feedback for quality control, but also significantly improves efficiency through automated detection, reduces manual errors and costs. The local threshold method calculates the threshold based on the local characteristics of each pixel, enhances the accuracy of defect identification, and is applicable to a variety of weld types and lighting conditions. Fast and accurate determination of defect types further shortens problem solving time, improves repair efficiency, reduces defects by optimizing management processes, and ultimately improves the overall quality of the product. BRIEF DESCRIPTION OF THE DRAWINGS
[0035] Figure 1It is a schematic diagram of a flow chart of a steel structure weld quality detection method of the present invention;
[0036] Figure 2 A schematic diagram of a flow chart of a method for locating a defective area according to an embodiment of the present invention;
[0037] Figure 3 The figure is a schematic diagram of a process of confirming a defect type in a defect area according to an embodiment of the present invention. DETAILED DESCRIPTION
[0038] To facilitate the understanding of the present invention, the present application will be described more comprehensively below with reference to the relevant drawings; the drawings show preferred embodiments of the present invention, but the present invention can be implemented in many different forms and is not limited to the embodiments described herein; on the contrary, the purpose of providing these embodiments is to enable a more thorough and comprehensive understanding of the disclosed content of the present invention.
[0039] It should be noted that the terms “vertical”, “horizontal”, “up”, “down”, “left”, “right” and similar expressions used in this document are only for illustrative purposes and do not represent the only implementation method.
[0040] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by technicians in the technical field to which the present invention belongs; the terms used in the specification of the present invention are only for the purpose of describing specific embodiments and are not intended to limit the present invention; the term "and / or" used herein includes any and all combinations of one or more related listed items.
[0041] Embodiment 1: Figure 1 The present invention is a flow chart of a method for detecting the quality of a steel structure weld according to an embodiment of the present invention, comprising the following steps:
[0042] S101, collect color images of the weld area of the steel structure, perform preprocessing operations such as filtering and denoising on the color images to reduce the impact of noise on subsequent processing, grayscale the acquired color images, and perform weighted averaging according to the weights of the red, green and blue color components to obtain the grayscale value of each pixel.
[0043] By graying out the image using the weighted average method, sufficient brightness information is retained to optimize the contrast between the weld area and the surrounding background, which is convenient for subsequent analysis. Weighted averaging is performed based on the different weights of the three color components: red, green, and blue. The weights can be adjusted according to actual conditions to better adapt to the processing requirements of different lighting conditions or weld types. The graying process has good adaptability and can process weld images under different colors, textures, and lighting conditions.
[0044] Specifically, the color value of a pixel in the original color image is R=200, G=150, B=100. Here, the R (red) value is relatively high, which may indicate the weld area, while the G (green) and B (blue) values are relatively low. The weight of the red component is set higher, followed by green, and blue is the lowest. The weights are R:0.5, G:0.3, B:0.2. The grayscale value is calculated by weighted average based on the weights:
[0045] Gray value = R × 0.5 + G × 0.3 + B × 0.2
[0046] Gray value = 200 × 0.5 + 150 × 0.3 + 100 × 0.2
[0047] Gray value = 100 + 45 + 20 = 165
[0048] Therefore, the grayscale value of this pixel in the grayscale image is 165. In this way, the weld area (stronger in the red component) will appear brighter in the grayscale image, and the contrast with the surrounding environment is optimized, which is conducive to the subsequent feature extraction to accurately identify the weld area.
[0049] Filtering and denoising color images can effectively remove noise from the image, making the weld area clearer and the edges sharper, reducing noise interference, making the features of the weld area (such as shape, texture, color changes, etc.) more prominent, reducing the impact of noise on the image processing algorithm, and improving the accuracy and reliability of the overall processing.
[0050] S102, select a neighborhood, that is, the pixel range surrounding each pixel point. For each pixel point in the image, assign different weights to the pixel values in each neighborhood according to their distance from the central pixel (usually using a Gaussian function to calculate the weights), and then calculate the weighted average as the local threshold. This method can better take into account the spatial position relationship of the pixels in the neighborhood and is very effective for processing images with spatial changes.
[0051] Commonly used local threshold calculation methods include local mean, local median, local Gaussian weighted average, etc. These methods can dynamically adjust the threshold according to the distribution of pixel values in the neighborhood, so as to more accurately identify defects in the weld area. The neighborhood range can be a square or rectangle. The square has the same extension in all directions, which is conducive to maintaining the isotropy of image processing. However, in some special cases, such as processing images with specific directional textures, a rectangular or other shaped neighborhood may also be selected.
[0052] Specifically, first, we select a square neighborhood as the processing range of each pixel, such as a 3x3 or 5x5 neighborhood. In this example, we select a 5x5 neighborhood that surrounds each pixel, including the pixel itself and the surrounding 24 pixels.
[0053] Next, we use the Gaussian function to calculate the weight based on the distance (in pixels) from each pixel in the neighborhood to the central pixel. The form of the Gaussian function is:
[0054]
[0055] Among them, (i,j) is the coordinate of a pixel in the neighborhood, (k i ,k j ) is the coordinate of the center pixel, and σ is the standard deviation of the Gaussian function, which determines the distribution range of the weight.
[0056] Then, we multiply the grayscale value of each pixel in the neighborhood by its corresponding Gaussian weight, calculate the sum of these products, and finally divide it by the sum of the weights to get the weighted average as the local threshold of the central pixel.
[0057]
[0058] Among them, the gray value (i, j) is the gray value of the pixel in the neighborhood.
[0059] S103, receiving a pixel point in the image, and comparing the pixel value of the point itself with the local threshold calculated in its neighborhood. If the pixel value is higher than the local threshold, it indicates that the point is a normal area; if it is lower than the local threshold, it indicates that there is a defect at the point.
[0060] S104, locating the position of the detected weld defect, locating the position of the weld defect by introducing image coordinates and outputting corresponding position information;
[0061] S105, receiving the position information outputted from the defective area for further analyzing the characteristics and area of the defects in the defective area, and repairing the defects of the steel structure weld through the analysis.
[0062] The technical solutions in the above embodiments of the present application have at least the following technical effects or advantages:
[0063] The local threshold calculation method can better take into account the spatial position relationship of pixels in the neighborhood, thereby more accurately reflecting the local characteristics of the image. At the same time, it can dynamically adjust the threshold according to the distribution of pixel values in the neighborhood. It is suitable for processing images with spatial changes, such as uneven illumination or texture changes in the weld area.
[0064] By comparing the pixel value with the local threshold, it is possible to determine in real time whether there are defects in the weld area, providing timely information for quality control. Automated defect detection can significantly improve detection efficiency, reduce manual intervention and errors, and reduce production costs.
[0065] The local threshold method can more accurately identify defects in the weld area because the threshold is calculated based on the local characteristics around each pixel and can better adapt to different weld types and lighting conditions.
[0066] Example 2: Weld quality inspection is to accurately identify and locate defects in welds. These defects often exist in welds in tiny forms and are difficult to accurately capture with the naked eye or traditional inspection methods. By introducing an image coordinate system, each defect area can be assigned an accurate coordinate value on the image, which greatly improves the precision and accuracy of defect location. Inspectors or automated equipment can quickly find and confirm the defect location based on these coordinate values, avoiding missed detection or false detection due to subjective judgment or error.
[0067] like Figure 2 As shown, the steps to introduce image coordinates are as follows:
[0068] S201, construct a two-dimensional image coordinate system, which uses the upper left corner of the image as the origin (0,0), where the X-axis extends horizontally to the right, representing the change in image width; and the Y-axis extends vertically downward, representing the change in image height. This setting ensures that each pixel in the image can be assigned a unique coordinate value (x, y).
[0069] S202, selecting a marking shape so that the marking shape can closely surround the defect area. For defects with regular shapes and clear boundaries, a rectangular frame is selected as the marking shape, and for defects with irregular shapes and fuzzy boundaries, an ellipse or a polygon is selected as the marking shape.
[0070] S203, draw the annotation shape, use the weld detection software to draw the corresponding shape on the image. For a rectangular frame, the user needs to specify the coordinate points of its upper left corner and lower right corner (i.e. (x1, y1) and (x2, y2)), and the software will automatically draw a rectangle connecting these two points; for ellipses and polygons, the user needs to specify the coordinates of each vertex in turn, and the software will draw the corresponding shape based on these vertices.
[0071] S204, marking the coordinate range of the marked shape, and after the marking is completed, verifying the marking result to check whether the marked shape closely surrounds the defect area and whether the coordinate range is accurate.
[0072] The technical solutions in the above embodiments of the present application have at least the following technical effects or advantages:
[0073] The image coordinates can accurately locate the position of the defect area, and at the same time, the shape of the defect area can be clearly identified. According to the shape and boundary clarity of the defect, the appropriate annotation shape (rectangle, ellipse, polygon, etc.) is selected, which reflects the flexibility of the method. Different annotation shapes can adapt to different types of defects to ensure the accuracy and effectiveness of the annotation.
[0074] Embodiment 3: In the field of steel structure weld quality inspection, if only defective areas of the steel structure are detected during inspection, the defective steel structure cannot be repaired in time, which easily leads to waste of resources.
[0075] like Figure 3 As shown, the steps to identify the type of defect in the determined defect area are:
[0076] S301, extracting features in the determined defect area, the features including texture features (such as gray-level co-occurrence matrix, local binary pattern, etc.), shape features (such as perimeter, area, aspect ratio, circularity, etc.), color features (in color images), etc.
[0077] S302, training a classification model, using a sample data set containing various defect types, and using the data set to train the model.
[0078] Common classification models include convolutional neural networks (CNN), support vector machines (SVM), and random forests. In this embodiment, a deep learning-based model, convolutional neural networks (CNN), is usually selected because they perform well in processing image data.
[0079] S303, input the extracted defect features into a convolutional neural network (CNN), and the convolutional neural network (CNN) outputs a prediction result.
[0080] S304, setting a judgment threshold. The judgment threshold is used to make classification decisions on the prediction results of the model. If the prediction probability of a certain defect type exceeds the set threshold, the defect area is considered to belong to this type; otherwise, if the prediction probability of all types does not exceed the threshold, the defect area can be marked as "uncertain" or "needs further inspection".
[0081] Specifically, the prediction result is a probability distribution. A classification threshold of 0.7 is set, and the prediction results output by the convolutional neural network (CNN) are 0.85 for cracks, 0.1 for pores, and 0.05 for slag inclusions. Since the predicted probability of cracks, 0.85, exceeds the classification threshold of 0.7, and the predicted probabilities of pores and slag inclusions do not exceed the threshold, the defect in the defect area is a crack.
[0082] The technical solutions in the above embodiments of the present application have at least the following technical effects or advantages:
[0083] Accurately determining the defect type can shorten the time for problem location and resolution and improve repair efficiency. Targeted repair measures can reduce unnecessary waste of resources and lower repair costs. By continuously optimizing the quality management process and reducing the occurrence of defects, the overall quality of the product can be improved.
[0084] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.
Claims
1. A method for detecting the quality of steel structure welds, characterized in that: include: S101, collecting a color image of the weld area of the steel structure, imaging the weld area using an industrial camera, and performing filtering and denoising preprocessing operations on the color image; Grayscale the acquired color image to obtain the grayscale value of each pixel; S102, selecting a neighborhood, that is, a pixel range surrounding each pixel point, for each pixel point in the image, assigning different weights to the pixel values in each neighborhood according to their distance from the central pixel, and then calculating the weighted average value as the local threshold; S103, receiving a pixel point in the image, and comparing the pixel value of the pixel point itself with the local threshold calculated in its neighborhood. If the pixel value is higher than the local threshold, it means that the pixel point is in a normal area, that is, the weld or the part around the weld without obvious defects; If it is lower than the local threshold, it means that the pixel is defective; S104, locating the position of the detected weld defect by using the image coordinates, locating the position of the weld defect and outputting corresponding position information; S105, receiving the position information outputted from the defective area for further analyzing the characteristics and area of the defects in the defective area, and repairing the defects of the steel structure weld through the analysis.
2. A steel structure weld quality detection method as claimed in claim 1, characterized in that: The calculation formula of the weight is: Among them, i,j are the coordinates of a pixel in the neighborhood, k i ,k j are the coordinates of the center pixel and σ is the standard deviation of the Gaussian function.
3. A steel structure weld quality detection method as claimed in claim 1, characterized in that: The local threshold is: Among them, the gray value (i, j) is the gray value of the pixel in the neighborhood.
4. A steel structure weld quality inspection method as claimed in claim 1, characterized in that: The method for locating a defective area comprises: S201, constructing a two-dimensional image coordinate, wherein the two-dimensional image coordinate takes the upper left corner of the image as the coordinate origin, wherein the X-axis extends horizontally to the right, representing the change in image width, i.e., from the leftmost end to the rightmost end of the image; and the Y-axis extends vertically downward, representing the change in image height, i.e., from the topmost end to the bottommost end of the image; S202, selecting a marking shape so that the marking shape can surround the defect area, a rectangular frame is selected as the marking shape for defects with regular shapes and clear boundaries, and an ellipse or polygon is selected as the marking shape for defects with irregular shapes and fuzzy boundaries; S203, drawing a marked shape, drawing a marked shape on the image; S204, marking the coordinate range of the marked shape, and after the marking is completed, verifying the marking result.
5. A steel structure weld quality inspection method as claimed in claim 4, characterized in that: The image drawing includes drawing a rectangular frame and an ellipse. For the rectangular frame, the coordinate points of the upper left corner and the lower right corner thereof are specified, namely x1, y1 and x2, y2, and a rectangle connecting the two points is drawn; For ellipses and polygons, specify the coordinates of each vertex in turn and draw the corresponding shape based on each vertex.
6. A steel structure weld quality inspection method as claimed in claim 1, characterized in that: To identify the type of defect in the Defects area, follow these steps: S301, extracting features in the defect area, wherein the features include texture features, shape features, and color features; S302, training a classification model, using a sample data set containing various defect types, and using the data set to train the model; S303, input the extracted defect features into the convolutional neural network, and the convolutional neural network outputs a prediction result; S304, setting a determination threshold, which is used to classify the prediction results of the model. If the prediction probabilities of all types do not exceed the threshold, the defect area is marked as "uncertain".
7. A steel structure weld quality inspection method as claimed in claim 6, characterized in that: The determination threshold is obtained by collecting historical data, processing and analyzing the historical data.
8. A steel structure weld quality inspection method as claimed in claim 6, characterized in that: In step S302, the prediction result is a probability distribution, indicating the possibility that the input defect region belongs to each defect type.
9. A steel structure weld quality inspection method as claimed in claim 6, characterized in that: The texture features include gray-level co-occurrence matrix and local binary pattern, the gray-level co-occurrence matrix is the gray-level dependency between pixels in an image and pixels in its neighborhood; The local binary pattern compares the grayscale values of the central pixel and its surrounding neighborhood pixels to generate a binary number, and then converts the binary number into a decimal number.
10. A steel structure weld quality inspection method as claimed in claim 6, characterized in that: Based on step S304, when the defect area cannot be confirmed, return to step S301 and re-extract the defect features.
Citation Information
Cited By
Weld defect detection system and method based on target recognition
CN119672017A
Elevator car weld defect detection method based on image processing
CN119941732A
Weld defect intelligent identification and distribution visualization method and system
CN120912617A
Laser welding robot for wind power blade production
CN121104341A
Steel structure welding seam quality detection method and system based on computer vision
CN122066687A