Building welded steel structure quality detection method based on image processing

By adjusting the threshold according to the edge roughness and pixel gray value variance in the welded steel structure image, adaptive threshold segmentation is achieved, which solves the problem of low accuracy in welded steel structure detection in the existing technology and improves the accuracy and reliability of detection.

CN120655640AActive Publication Date: 2025-09-16BEIJING YUEZHI FUTURE TECH CO LTD

Patent Information

Application Number
CN202511134230.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-08-14
Publication Date
2025-09-16
Estimated Expiration
2045-08-14

AI Technical Summary

Technical Problem

In existing methods, due to the influence of multiple factors such as lighting and surface texture of welding cracks, a single threshold cannot segment all welding cracks in welded steel structure images, resulting in low accuracy of quality detection.

Method used

By acquiring the welded steel structure image and performing threshold segmentation, the threshold adjustment requirement of each connected domain is determined according to the edge roughness and pixel gray value variance. The threshold is adaptively adjusted for the connected domain that needs adjustment, thus realizing adaptive threshold segmentation of different connected domains in the welded steel structure image.

Benefits of technology

The accuracy of quality inspection of welded steel structures is improved, the welding crack parts can be better retained, and false detection and missed detection can be reduced.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120655640A_ABST
    Figure CN120655640A_ABST
Patent Text Reader

Abstract

The invention discloses a building welded steel structure quality detection method based on image processing, and relates to the technical field of image processing. The building welded steel structure quality detection method based on image processing comprises the following steps: acquiring a welded steel structure image of a target welded steel structure; performing threshold segmentation on the welded steel structure image to obtain an initial binary image corresponding to the welded steel structure image; according to the edge roughness and the pixel gray value variance of the welded steel structure image, determining the threshold adjustment demand degree of each connected domain in the welded steel structure image; performing threshold adjustment on each connected domain of which the threshold adjustment demand degree is greater than a preset demand degree threshold to obtain a final binary image corresponding to the welded steel structure image; and obtaining a quality detection result of the target welding steel structure according to the final binary image. According to the building welded steel structure quality detection method based on image processing provided by the embodiment of the invention, the quality detection accuracy of the welded steel structure can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of image processing, and in particular to a quality detection method for building welded steel structures based on image processing. Background Art

[0002] As a crucial component of modern construction, the quality of welded steel structures is directly linked to the structural safety and reliability of the entire building. Therefore, rigorous and comprehensive quality testing of welded steel structures is not only a key step in ensuring construction quality standards, but also a necessary measure to prevent potential safety hazards and safeguard people's lives and property.

[0003] In the existing method, machine vision is used for image analysis, and edge detection and threshold segmentation are performed on the welded steel structure image, thereby realizing the quality inspection of the welded steel structure.

[0004] However, due to the influence of multiple factors such as lighting and surface texture of welding cracks, the single threshold in the existing method cannot segment all welding cracks in the welded steel structure image, resulting in low accuracy of quality detection. Summary of the Invention

[0005] The embodiment of the present invention provides a method for quality inspection of building welded steel structures based on image processing, which can improve the accuracy of quality inspection of welded steel structures.

[0006] A first aspect of an embodiment of the present invention provides a method for inspecting the quality of welded steel structures of buildings based on image processing, comprising: Acquire a welded steel structure image of a target welded steel structure; Perform threshold segmentation on the welded steel structure image to obtain an initial binary image corresponding to the welded steel structure image; According to the edge roughness and pixel gray value variance of the welded steel structure image, the threshold adjustment requirement of each connected domain in the welded steel structure image is determined; Performing threshold adjustment on each connected domain whose threshold adjustment requirement is greater than a preset requirement threshold, to obtain a final binary image corresponding to the welded steel structure image; According to the final binarized image, the quality inspection results of the target welded steel structure are obtained.

[0007] In the image processing-based quality inspection method for building welded steel structures provided by an embodiment of the present invention, the welded steel structure image of the target welded steel structure is first threshold segmented to obtain an initial binary image corresponding to the welded steel structure image. Then, based on the edge roughness of the welded steel structure image and the pixel grayscale value variance, the threshold adjustment requirement of each connected domain in the welded steel structure image is determined. Finally, based on the threshold adjustment requirement, the connected domain that needs threshold adjustment is threshold adjusted to obtain the final binary image corresponding to the welded steel structure image. In this way, the present invention determines the connected domain that needs threshold adjustment based on the edge changes in different connected domains. Thereby, adaptive threshold segmentation of different connected domains in the welded steel structure image is realized, and the welding crack part can be retained as much as possible, thereby improving the quality inspection accuracy of the welded steel structure. BRIEF DESCRIPTION OF THE DRAWINGS

[0008] In order to more clearly illustrate the technical solutions and advantages of the embodiments of the present invention or the prior art, the following briefly introduces the drawings required for use in the embodiments or the prior art descriptions. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0009] Figure 1 A schematic flow chart of a method for inspecting quality of welded steel structures based on image processing according to an embodiment of the present invention; Figure 2 A schematic diagram of a welded steel structure image provided by one embodiment of the present invention; Figure 3 A schematic diagram of a final binary image corresponding to a welded steel structure image provided by one embodiment of the present invention; Figure 4 A schematic flow chart of a second method for inspecting quality of welded steel structures based on image processing provided by one embodiment of the present invention; Figure 5 A schematic flow chart of a third method for quality inspection of welded steel structures in buildings based on image processing provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0010] To further illustrate the technical means and effectiveness of the present invention in achieving its intended objectives, the following, in conjunction with the accompanying drawings and preferred embodiments, details the specific implementation, structure, features, and effectiveness of the image processing-based quality inspection method for welded steel structures proposed by the present invention. In the following description, references to different "one embodiment" or "another embodiment" do not necessarily refer to the same embodiment. Furthermore, specific features, structures, or characteristics of one or more embodiments may be combined in any suitable manner.

[0011] Unless defined otherwise, 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 belongs.

[0012] It should be noted that the acquisition, storage, use, and processing of data in the technical solution of the present invention comply with the relevant provisions of laws and regulations.

[0013] It should be noted that in the embodiments of the present invention, certain software, components, models and other existing solutions in the industry may be mentioned. They should be regarded as exemplary and their purpose is only to illustrate the feasibility of implementing the technical solution of the present invention, but it does not mean that the applicant has or will necessarily use the solution.

[0014] Existing methods use machine vision for image analysis, performing edge detection and threshold segmentation on welded steel structure images to achieve quality inspection of welded steel structures. However, due to the influence of multiple factors such as lighting and the surface texture of weld cracks, a single threshold in existing methods cannot segment all weld cracks in welded steel structure images, resulting in low quality inspection accuracy.

[0015] The purpose of the present invention is to provide a quality detection method for building welded steel structures based on image processing. In the quality detection method for building welded steel structures based on image processing provided by an embodiment of the present invention, the welded steel structure image of the target welded steel structure is first threshold segmented to obtain an initial binary image corresponding to the welded steel structure image. Then, based on the edge roughness and pixel grayscale value variance of the welded steel structure image, the threshold adjustment requirement of each connected domain in the welded steel structure image is determined. Finally, based on the threshold adjustment requirement, the connected domain that needs to be threshold adjusted is threshold adjusted, thereby obtaining a final binary image corresponding to the welded steel structure image. In this way, the present invention determines the connected domain that needs to be threshold adjusted based on the edge changes in different connected domains. Thereby, adaptive threshold segmentation of different connected domains in the welded steel structure image is realized, and the welding crack part can be retained as much as possible, thereby improving the quality detection accuracy of the welded steel structure.

[0016] The following describes a specific embodiment of the image processing-based quality inspection method for welded steel structures provided by the present invention.

[0017] Figure 1 A flow chart of a method for detecting the quality of welded steel structures in buildings based on image processing is provided. The method for detecting the quality of welded steel structures in buildings based on image processing can be applied to a server. The method for detecting the quality of welded steel structures in buildings based on image processing can include the following S101 to S105.

[0018] S101, acquiring a welded steel structure image of a target welded steel structure.

[0019] In this embodiment, the image of the welded steel structure is acquired by an image acquisition device, which may be, for example, a high-resolution camera or a webcam.

[0020] As an example, a high-resolution camera is installed above the welded steel structure. The server uses the high-resolution camera to shoot the welded steel structure to obtain a captured image. The captured image is then grayscaled to obtain a welded steel structure image of the target welded steel structure. Figure 2 As shown, a schematic diagram of a welded steel structure image is provided.

[0021] S102 , performing threshold segmentation on the welded steel structure image to obtain an initial binary image corresponding to the welded steel structure image.

[0022] In this embodiment, threshold segmentation is used to represent a method of dividing an image into multiple regions according to the grayscale amplitude of pixels in the image.

[0023] As an example, the server uses a threshold segmentation algorithm (such as the OTSU threshold segmentation algorithm) to obtain an appropriate global threshold. Based on the global threshold, the image of the welded steel structure is converted into a binary image consisting only of black and white. The white areas of the binary image represent the welds, and the black areas represent the background.

[0024] S103 , determining the threshold adjustment requirement of each connected domain in the welded steel structure image according to the edge roughness and pixel gray value variance of the welded steel structure image.

[0025] In this embodiment, a connected domain refers to an image region consisting of adjacent pixels having the same pixel value in the welded steel structure image. For example, an edge detection algorithm can be used to perform edge detection on the welded steel structure image, thereby dividing the welded steel structure image into multiple connected domains.

[0026] The threshold adjustment requirement is used to represent the degree of necessity for adjusting the threshold of the connected domain. The greater the threshold adjustment requirement, the more necessary it is to adjust the threshold of the connected domain.

[0027] As an example, the server first uses a statistical function to calculate the edge roughness of each connected domain. The greater the edge roughness, the less smooth the connected domain is, which means the greater the possibility of welding cracks in the connected domain, and the greater the need for threshold adjustment of the connected domain.

[0028] The server then uses a statistical function to calculate the variance of the grayscale values ​​of pixels in each connected domain. The larger the variance, the more textures the connected domain contains, and the lower the threshold adjustment requirement of the connected domain.

[0029] Finally, the server assigns a threshold adjustment requirement value to each connected domain based on the edge roughness and the variance of the pixel grayscale value corresponding to each connected domain.

[0030] S104 , performing threshold adjustment on each connected domain whose threshold adjustment requirement is greater than a preset requirement threshold, to obtain a final binarized image corresponding to the welded steel structure image.

[0031] In this embodiment, the server first sets a preset threshold value, such as 0.7. Then, for the connected domains with a threshold adjustment threshold value greater than 0.7, a local adaptive threshold method (such as the local OTSU threshold method) is used to adjust the threshold value to more accurately segment the welding parts, thereby obtaining the final binary image corresponding to the welded steel structure image. Figure 3 As shown, a schematic diagram of the final binary image corresponding to the welded steel structure image is provided.

[0032] S105: Obtaining a quality inspection result of the target welded steel structure based on the final binarized image.

[0033] In this embodiment, the server calculates the area and shape of the weld based on the final binary image. The server then compares these characteristics with pre-set quality standards to determine the quality inspection result (e.g., acceptable or unacceptable).

[0034] In the image processing-based quality inspection method for building welded steel structures provided in this embodiment, the welded steel structure image of the target welded steel structure is first threshold segmented to obtain an initial binary image corresponding to the welded steel structure image. Then, based on the edge roughness of the welded steel structure image and the pixel grayscale value variance, the threshold adjustment requirement of each connected domain in the welded steel structure image is determined. Finally, based on the threshold adjustment requirement, the connected domain that needs to be threshold adjusted is threshold adjusted to obtain the final binary image corresponding to the welded steel structure image. In this way, the present invention determines the connected domain that needs to be threshold adjusted based on the edge changes in different connected domains. Thereby, adaptive threshold segmentation of different connected domains in the welded steel structure image is realized, and the welding crack part can be retained as much as possible, thereby improving the quality inspection accuracy of the welded steel structure.

[0035] As an optional embodiment, Figure 4 As shown, S102 may specifically include the following S401-S403: S401, obtaining a grayscale histogram of the welded steel structure image; S402, determining an image threshold of the welded steel structure image according to the grayscale histogram; S403: Marking the welded steel structure image according to the image threshold value to obtain an initial binary image corresponding to the welded steel structure image.

[0036] In this embodiment, the grayscale histogram is used to represent the number of pixels with various grayscale levels in the welded steel structure image, reflecting the occurrence frequency of various grayscales in the welded steel structure image.

[0037] As an example, the server uses an image processing library (such as OpenCV) to read and process the steel structure image, and then uses the grayscale statistical algorithm in OpenCV (such as the cv2.calcHist() function or the numpy.histogram() function) to calculate the grayscale histogram of the steel structure image.

[0038] Then, the grayscale histogram is analyzed to identify possible bimodal distributions. If the grayscale histogram exhibits a bimodal distribution, the minimum value between the two peaks is determined as the image threshold for the welded steel structure image. If the grayscale histogram does not exhibit a bimodal distribution, a threshold segmentation algorithm (such as the OTSU threshold segmentation algorithm) is used to determine the image threshold for the welded steel structure image.

[0039] Finally, the welded steel structure image is processed based on the image threshold. Pixels with grayscale values ​​greater than or equal to the image threshold are marked as white (or foreground), and pixels with grayscale values ​​less than the image threshold are marked as black (or background), thereby obtaining the initial binary image corresponding to the welded steel structure image.

[0040] This embodiment obtains a grayscale histogram of a welded steel structure image, determines an image threshold based on the grayscale histogram, and then labels the welded steel structure image to produce an initial binary image. This provides important guarantees for subsequent accurate identification of weld locations and quality inspection of welded steel structures, thereby improving the accuracy of quality inspection of welded steel structures.

[0041] As an optional embodiment, S402 may specifically include: Normalize the grayscale histogram to obtain the pixel probability of each grayscale level in the grayscale histogram; According to the pixel probability of each gray level, the intra-class variance and inter-class variance of each possible threshold are calculated. The intra-class variance is used to measure the degree of grayscale change within the same category, and the inter-class variance is used to measure the grayscale difference between different categories. The possible threshold with the smallest intra-class variance and the largest inter-class variance is determined as the image threshold of the welded steel structure image.

[0042] In this embodiment, the possible thresholds are multiple thresholds randomly selected from a preset threshold range. For example, the preset threshold range may be 0 to 255, and the possible thresholds may be 10, 20, 30, 40, 50, and 60.

[0043] As an example, after obtaining the grayscale histogram, the server counts the number of pixels at each grayscale level according to the grayscale histogram, and then divides the number of pixels at each grayscale level by the total number of pixels to obtain the normalized pixel probability at each grayscale level.

[0044] Then, all possible thresholds are traversed, and for each threshold T, the intra-class variance of the foreground and the intra-class variance of the background are calculated first. Specifically, they can be obtained by calculating the variance of the grayscale values ​​within each category; then the inter-class variance between the foreground and background is calculated. Specifically, it can be obtained by calculating the product of the square of the difference between the grayscale means of the two categories and the corresponding category pixel probability.

[0045] Then, we traverse all possible thresholds and find the threshold that minimizes the intra-class variance and maximizes the inter-class variance, which is used as the optimal image threshold. Then, we use the determined optimal image threshold to perform binary segmentation on the original grayscale image to obtain binary images of the foreground and background.

[0046] This embodiment accurately determines the optimal image threshold for welded steel structure images based on their grayscale histogram, providing an accurate basis for subsequent image segmentation and analysis. It offers greater accuracy and robustness, and is applicable to different types of welded steel structure images.

[0047] As an optional embodiment, S403 may specifically include: Mark the pixel area in the welded steel structure image that is greater than or equal to the image threshold as the foreground area of ​​the initial binary image; Mark the pixel area smaller than the image threshold in the welded steel structure image as the background area of ​​the initial binary image; According to the foreground area and the background area, an initial binary image corresponding to the welded steel structure image is obtained.

[0048] In this embodiment, the server first marks the pixel area in the welded steel structure image that is greater than or equal to the image threshold as the foreground area of ​​the initial binary image. These pixels generally correspond to target objects or areas of interest in the welded steel structure image, such as welds, weld spots, etc.

[0049] The server then marks the pixel areas in the welded steel structure image that are smaller than the image threshold as the background area of ​​the initial binary image. These pixels usually correspond to the background parts of the welded steel structure image, such as steel plates, surrounding environment, etc.

[0050] Finally, after the initial binarization process is completed, the generated initial binarized image is output and stored in a specified location.

[0051] This embodiment can quickly generate an initial binary image of a welded steel structure image, providing an accurate basis for subsequent image analysis. Compared with traditional manual segmentation methods, it has a higher degree of automation and accuracy, thereby significantly improving image processing efficiency.

[0052] As an optional embodiment, Figure 5 As shown, S103 may specifically include the following S501-S504: S501, performing edge detection on the welded steel structure image to obtain multiple connected domains corresponding to the welded steel structure image; S502, for each edge curve in the connected domain, construct an edge chain code corresponding to the edge curve; S503, determining the edge roughness of each connected domain according to the edge chain code corresponding to each edge curve; S504 , determining the threshold adjustment requirement of each connected domain according to the edge roughness of each connected domain and the pixel grayscale value variance of the corresponding connected domain.

[0053] In this embodiment, the edge chain code is used to represent the order of boundary pixels in an image through a digital sequence.

[0054] As an example, the server first reads an image of a welded steel structure and performs edge detection on the image using an edge detection algorithm (such as the Canny operator, Sobel operator, or Prewitt operator). Edge detection identifies edge pixels in the image and divides the image into multiple connected domains based on the connectivity of these edge pixels.

[0055] Then, for each edge curve in the connected domain, a chain code representation of the edge curve is constructed using Freeman chain code or other edge chain code representation methods. The edge chain code can accurately describe the shape and direction of the edge curve, providing a basis for subsequent edge roughness calculation.

[0056] Furthermore, the edge chain code of each connected domain is analyzed to calculate characteristic parameters such as the curvature change and length of the edge curve. Based on these characteristic parameters, the edge roughness of each connected domain is calculated using statistical or machine learning methods. Furthermore, for each connected domain, the variance of its pixel grayscale values ​​is calculated to reflect the degree of dispersion of the pixel grayscale values ​​within the connected domain.

[0057] Finally, the threshold adjustment requirement of each connected domain is calculated by combining edge roughness and pixel gray value variance using a weighted summation method.

[0058] This embodiment first constructs an edge chain code, then calculates edge roughness and pixel grayscale value variance based on the edge chain code, achieving effective processing of welded steel structure images. This allows accurate calculation of the threshold adjustment requirements for each connected domain in the welded steel structure image, facilitating subsequent adjustments to the welded steel structure image based on the threshold adjustment requirements of each connected domain. This enables adaptive threshold segmentation of different connected domains in the welded steel structure image, preserving weld cracks as much as possible and improving the accuracy of quality inspection of welded steel structures.

[0059] As an optional embodiment, S502 may specifically include: Taking any edge point in the target edge curve as the starting point, traverse each edge point in the target edge curve in turn to form an edge point sequence; Determine the direction code corresponding to each edge point according to the relative position relationship between each edge point and the corresponding adjacent edge point in the edge point sequence; According to the direction codes corresponding to each edge point, the edge chain code corresponding to the target edge curve is constructed.

[0060] In this embodiment, the server selects any edge point from the target edge curve as the starting point, traverses each edge point in the target edge curve in sequence, and constructs an edge point sequence from the traversed edge points in order. For example, the edge point sequence can be [P1, P2, P3, P4, P5].

[0061] Then, for each edge point in the edge point sequence, the relative position relationship between it and the next adjacent edge point is calculated. Based on the relative position relationship, a direction code is assigned to each edge point. The direction code can specifically use an eight-direction code or a four-direction code. When the eight-direction code is selected, 0 represents the east direction, 1 represents the northeast direction, 2 represents the north direction, 3 represents the northwest direction, 4 represents the west direction, 5 represents the southwest direction, 6 represents the south direction, and 7 represents the southeast direction.

[0062] For example, assume that the direction code from P1 to P2 is 2, the direction code from P2 to P3 is 5, the direction code from P3 to P4 is 7, and the direction code from P4 to P5 is 1.

[0063] Finally, the direction codes of each edge point in the edge point sequence are arranged in order to form an edge chain code. For example, the edge point sequence [P1, P2, P3, P4, P5] corresponds to the edge chain code [2, 5, 7, 1]. The edge chain code is represented as a string, with each element corresponding to the direction code of an edge point.

[0064] This embodiment accurately extracts edge point sequences from the target edge curve, determines directional codes based on the relative positional relationships between the edge points, and ultimately constructs an edge chain code. This facilitates the subsequent determination of the edge roughness of connected domains based on the edge chain code corresponding to the edge curve. Furthermore, based on the edge roughness of the connected domains, the threshold adjustment requirement for each connected domain in the welded steel structure image can be accurately calculated, thereby improving the accuracy of quality inspection of welded steel structures.

[0065] As an optional embodiment, S503 may specifically include: Get the edge chain code corresponding to each edge curve in the target connected domain; According to the difference between each adjacent direction code in each edge chain code, the direction code mean of each edge chain code is determined respectively; The mean of the encoding means in each direction is calculated to obtain the edge roughness of the target connected domain.

[0066] In this embodiment, the edge roughness of the connected domain can be specifically determined by the following formula 1: Formula 1 Where, represents the edge roughness of the i-th connected domain, Indicates the ath edge chain code in the i-th connected domain The direction encoding of the chain code, Indicates the ath edge chain code in the i-th connected domain +1 chain code direction code, n represents the number of chain codes in the a-th edge chain code, and m represents the number of edge chain codes in the i-th connected domain.

[0067] in, Indicates the ath edge chain code in the i-th connected domain The direction encoding of the chain code is the same as the +1 difference between the direction codes of the chain codes, Indicates the The first The average value of the directional coding difference between the front and back chain codes in the edge chain code, Indicates the The average value of the directional encoding difference between the previous and next chain codes of all edge chain codes in a connected domain.

[0068] Among them, the greater the difference in the direction of the edge chain code between the previous and next chain codes in the connected domain, the less smooth its edge is, and the greater the edge roughness of the corresponding connected domain is.

[0069] This embodiment accurately calculates the edge roughness of a target connected domain based on the difference between adjacent direction codes within each edge chain code. This allows the threshold adjustment requirement for each connected domain in a welded steel structure image to be accurately calculated based on the edge roughness of the connected domain, improving the accuracy of quality inspections for welded steel structures.

[0070] As an optional embodiment, S504 may specifically include: Perform an exponential function operation on the opposite number of the pixel gray value variance of the target connected domain to obtain the exponential operation result; The result of the exponential operation is multiplied by the edge roughness of the target connected domain to obtain the threshold adjustment requirement of the target connected domain.

[0071] In this embodiment, the threshold adjustment requirement of the connected domain can be specifically determined by the following formula 2: Formula 2 Where, represents the threshold adjustment requirement of the i-th connected domain, exp represents the exponential function operation, represents the pixel gray value variance of the i-th connected domain, represents the edge roughness of the i-th connected domain.

[0072] in, The larger it is, the less smooth the i-th connected domain is, that is, the greater the possibility of welding cracks in the i-th connected domain, and the greater the threshold adjustment requirement of the connected domain; The larger it is, the more textures are contained in the i-th connected domain, and the lower the threshold adjustment requirement of the connected domain.

[0073] This embodiment accurately determines the threshold adjustment requirement for connected domains based on the edge roughness of the connected domains and the corresponding pixel grayscale value variance of the connected domains. This enables adaptive threshold segmentation of different connected domains in welded steel structure images, preserving weld cracks as much as possible and improving the accuracy of quality inspection of welded steel structures.

[0074] As an optional embodiment, S104 may specifically include: Performing threshold adjustment on the connected domain to be adjusted whose threshold adjustment demand is greater than the preset demand threshold to obtain a revised threshold of the connected domain to be adjusted; According to the modified threshold, the foreground area and background area of ​​the connected domain to be adjusted are re-marked to obtain the area marking result; Determine the relationship between the grayscale value of the welding crack in the connected domain to be adjusted and the correction threshold, and obtain a grayscale value determination result; When the grayscale value judgment result indicates that the grayscale value of the welding crack is greater than or equal to the correction threshold, the region marking result is determined as the binarization result of the connected domain to be adjusted; When the grayscale value judgment result indicates that the grayscale value of the welding crack is less than the correction threshold, the foreground area and the background area of ​​the area marking result are reversed to obtain a binarization result of the connected domain to be adjusted; According to the binarization results corresponding to each connected domain to be adjusted, the initial binarized image is updated to obtain a final binarized image corresponding to the welded steel structure image.

[0075] In this embodiment, the weld crack grayscale value is used to represent the grayscale value of the weld crack location within the connected domain to be adjusted. The weld crack grayscale value is significantly different from the grayscale values ​​of other locations within the connected domain to be adjusted. Therefore, a grayscale threshold can be pre-set. The grayscale values ​​of each location within the connected domain to be adjusted are then obtained and compared. If the grayscale value difference between a location and surrounding locations exceeds the pre-set grayscale threshold, that location is determined to be the weld crack location, and the grayscale value of that location is the weld crack grayscale value.

[0076] As an example, after calculating the threshold adjustment requirements for each connected domain in a welded steel structure image, the server compares the threshold adjustment requirements with a preset threshold. Connected domains with thresholds greater than the preset threshold are identified as domains to be adjusted. The server then performs threshold adjustment on these connected domains, using a local adaptive thresholding method (e.g., the local OTSU thresholding method) to determine their corresponding correction thresholds.

[0077] Then, the server re-labels the foreground and background areas of the connected domain to be adjusted based on the correction threshold to obtain the region labeling result, and determines the relationship between the grayscale value of the welding crack in the connected domain to be adjusted and the correction threshold.

[0078] According to the grayscale value judgment result, two cases are processed: if the grayscale value of the welding crack is greater than or equal to the correction threshold, the region marking result is determined as the binarization result of the connected domain to be adjusted; if the grayscale value of the welding crack is less than the correction threshold, the foreground area and the background area of ​​the region marking result are reversed to obtain the binarization result of the connected domain to be adjusted.

[0079] Finally, the initial binary image is updated according to the binarization results corresponding to each connected domain to be adjusted, thereby obtaining a final binarized image corresponding to the welded steel structure image.

[0080] This embodiment performs threshold adjustment on connected domains whose threshold adjustment requirements exceed a preset threshold, yielding a final binary image corresponding to the welded steel structure image. This enables adaptive threshold segmentation of different connected domains within the welded steel structure image, preserving weld cracks as much as possible and improving the accuracy of quality inspections for welded steel structures.

[0081] As an optional embodiment, S105 may specifically include: According to the final binary image, determining a first connected domain where welding cracks exist and a second connected domain where welding cracks do not exist in the final binary image; A quality inspection result of the target welded steel structure is determined according to the first connected domain and the second connected domain.

[0082] In this embodiment, the first connected domain is the connected domain with texture and crack information inside, that is, the foreground area marked after the above threshold segmentation. The second connected domain is the connected domain without texture and crack information inside, that is, the background area marked after the above threshold segmentation.

[0083] As an example, the server can determine the binary image of each connected domain based on the final binary image. For a normal connected domain, the texture and background are assigned the same value, while for a connected domain with cracks, the cracks and background are assigned two values.

[0084] Therefore, the server traverses all connected domains and marks those without texture or crack information as second connected domains, and those with texture and crack information as first connected domains. Finally, the number and size of first and second connected domains are compared to assess the severity of weld cracks. Based on the assessment results, a quality inspection report for the welded steel structure is generated, including information such as the location and size of the weld cracks.

[0085] Through this embodiment, based on the first connected domain with welding cracks and the second connected domain without welding cracks in the final binary image, welding cracks can be identified more accurately, avoiding the subjectivity of manual visual inspection, thereby improving the accuracy of quality inspection of welded steel structures.

[0086] It should be understood that the present invention is not limited to the specific configurations and processes described above and illustrated in the figures. For the sake of brevity, a detailed description of known methods is omitted. In the above embodiments, several specific steps are described and illustrated as examples. However, the method of the present invention is not limited to the specific steps described and illustrated. Those skilled in the art may make various changes, modifications, and additions, or change the order of the steps after understanding the spirit of the present invention.

[0087] It should also be noted that the exemplary embodiments described herein describe methods or systems based on a series of steps or devices. However, the present invention is not limited to the order of the steps described above. In other words, the steps may be performed in the order described in the embodiments, or in a different order, or several steps may be performed simultaneously.

[0088] The above description is only a specific embodiment of the present invention. Those skilled in the art will clearly understand that for the convenience and brevity of description, the specific working processes of the systems, modules and units described above can refer to the corresponding processes in the aforementioned method embodiments, and will not be repeated here. It should be understood that the protection scope of the present invention is not limited to this. Any person skilled in the art can easily think of various equivalent modifications or replacements within the technical scope disclosed by the present invention, and these modifications or replacements should be included in the protection scope of the present invention.

Claims

1. A quality inspection method for building welded steel structures based on image processing, characterized in that: The method comprises: Acquire a welded steel structure image of a target welded steel structure; Performing threshold segmentation on the welded steel structure image to obtain an initial binary image corresponding to the welded steel structure image; determining a threshold adjustment requirement for each connected domain in the welded steel structure image according to edge roughness and pixel grayscale value variance of the welded steel structure image; Performing threshold adjustment on each of the connected domains whose threshold adjustment requirement is greater than a preset requirement threshold, to obtain a final binarized image corresponding to the welded steel structure image; A quality inspection result of the target welded steel structure is obtained according to the final binarized image.

2. The method for detecting quality of welded steel structures based on image processing according to claim 1, characterized in that: The step of performing threshold segmentation on the welded steel structure image to obtain an initial binary image corresponding to the welded steel structure image includes: Obtaining a grayscale histogram of the welded steel structure image; determining an image threshold of the welded steel structure image according to the grayscale histogram; The welded steel structure image is marked according to the image threshold to obtain an initial binary image corresponding to the welded steel structure image.

3. The method for detecting quality of welded steel structures based on image processing according to claim 2, characterized in that: Determining the image threshold of the welded steel structure image according to the grayscale histogram includes: Normalizing the grayscale histogram to obtain pixel probabilities of each grayscale level in the grayscale histogram; According to the pixel probability of each gray level, calculating the intra-class variance and inter-class variance of each possible threshold, wherein the intra-class variance is used to measure the degree of grayscale change within the same category, and the inter-class variance is used to measure the grayscale difference between different categories; The possible threshold value with the smallest intra-class variance and the largest inter-class variance is determined as the image threshold value of the welded steel structure image.

4. The method for detecting quality of welded steel structures based on image processing according to claim 2, characterized in that: The step of marking the welded steel structure image according to the image threshold to obtain an initial binary image corresponding to the welded steel structure image includes: Marking a pixel area in the welded steel structure image that is greater than or equal to the image threshold as a foreground area of ​​the initial binary image; Marking a pixel area smaller than the image threshold in the welded steel structure image as a background area of ​​the initial binary image; An initial binary image corresponding to the welded steel structure image is obtained according to the foreground area and the background area.

5. The method for detecting quality of welded steel structures based on image processing according to claim 1, characterized in that: The step of determining the threshold adjustment requirement of each connected domain in the welded steel structure image according to the edge roughness and pixel gray value variance of the welded steel structure image includes: Performing edge detection on the welded steel structure image to obtain a plurality of connected domains corresponding to the welded steel structure image; For each edge curve in the connected domain, construct an edge chain code corresponding to the edge curve; determining the edge roughness of each of the connected domains according to the edge chain code corresponding to each of the edge curves; The threshold adjustment requirement of each connected domain is determined according to the edge roughness of each connected domain and the pixel gray value variance of the corresponding connected domain.

6. The method for detecting quality of welded steel structures based on image processing according to claim 5, characterized in that: For each edge curve in the connected domain, constructing an edge chain code corresponding to the edge curve includes: Taking any edge point in the target edge curve as a starting point, traverse each edge point in the target edge curve in sequence to form an edge point sequence; determining a direction code corresponding to each edge point according to a relative position relationship between each edge point and a corresponding adjacent edge point in the edge point sequence; According to the direction codes corresponding to the edge points, an edge chain code corresponding to the target edge curve is constructed.

7. The method for inspecting the quality of welded steel structures of buildings based on image processing according to claim 5, characterized in that: Determining the edge roughness of each connected domain according to the edge chain code corresponding to each edge curve includes: Obtaining the edge chain code corresponding to each edge curve in the target connected domain; Determining the mean of the direction codes of the edge chain codes according to the difference between the adjacent direction codes in the edge chain codes; The mean of each directional encoding mean is calculated to obtain the edge roughness of the target connected domain.

8. The method for inspecting the quality of welded steel structures of buildings based on image processing according to claim 5, characterized in that: The step of determining the threshold adjustment requirement of each connected domain according to the edge roughness of each connected domain and the corresponding pixel grayscale value variance of the connected domain comprises: Perform an exponential function operation on the opposite number of the pixel gray value variance of the target connected domain to obtain the exponential operation result; The exponential operation result is multiplied by the edge roughness of the target connected domain to obtain the threshold adjustment requirement of the target connected domain.

9. The method for inspecting the quality of welded steel structures of buildings based on image processing according to claim 1, characterized in that: The step of performing threshold adjustment on each of the connected domains having a threshold adjustment requirement greater than a preset requirement threshold to obtain a final binarized image corresponding to the welded steel structure image includes: Performing threshold adjustment on the connected domain to be adjusted whose threshold adjustment demand is greater than the preset demand threshold, to obtain a revised threshold of the connected domain to be adjusted; Re-marking the foreground area and the background area of ​​the connected domain to be adjusted according to the correction threshold to obtain a region marking result; Determine the magnitude relationship between the grayscale value of the welding crack of the connected domain to be adjusted and the correction threshold, and obtain a grayscale value determination result; When the grayscale value judgment result indicates that the grayscale value of the welding crack is greater than or equal to the correction threshold, determining the region marking result as the binarization result of the connected domain to be adjusted; When the grayscale value judgment result indicates that the grayscale value of the welding crack is less than the correction threshold, the foreground area and the background area of ​​the area marking result are reversed to obtain a binarization result of the connected domain to be adjusted; The initial binarized image is updated according to the binarization results corresponding to each connected domain to be adjusted to obtain a final binarized image corresponding to the welded steel structure image.

10. The method for inspecting the quality of welded steel structures of buildings based on image processing according to claim 1, characterized in that: Obtaining a quality inspection result of the target welded steel structure according to the final binarized image includes: Determining, based on the final binary image, a first connected domain where welding cracks exist and a second connected domain where welding cracks do not exist in the final binary image; A quality inspection result of the target welded steel structure is determined according to the first connected domain and the second connected domain.

Citation Information

Patent Citations

  • Method for detecting welding seam quality of steel structure

    CN115880280A

  • Welding defect detection method

    CN117351019A

  • Laser welding quality evaluation method

    CN119313697A

  • Image processing apparatus, image processing method, and computer program product

    US20070127837A1

Cited By

  • Thermal power plant metal welding visual management method and system based on BIM

    CN121505144A