A method for identifying surface defects of steel structures

By calculating the degree of difference in variable distance grayscale and the separation degree of closed connected areas, the bilateral filtering algorithm that dynamically adjusts the window size, solves the problem of uneven noise distribution caused by fixed window size, and improves the accuracy of surface defect recognition of steel structures and welding Seam information is retained.

CN118628483BActive Publication Date: 2024-11-08南通久鼎特种钢管有限公司
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411095144.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-08-12
Publication Date
2024-11-08
Estimated Expiration
2044-08-12

AI Technical Summary

Technical Problem

The existing bilateral filtering algorithm uses a fixed window size in the recognition of surface defects of steel structures, resulting in a greater impact on the local structure of the image of uneven noise distribution, reducing the accuracy of defect recognition.

Method used

By acquiring the grayscale image and binary image of the steel structure surface, the degree of varying distance grayscale difference of pixel points and the separation of adjacent areas of closed connected areas are calculated, the window size is dynamically adjusted for denoising, and bilateral filtering is used for adaptive window size algorithm.

Benefits of technology

It improves the accuracy of surface defect identification of steel structures, retains more weld information, reduces the impact of light and shadow and irregular protrusions, and enhances the accuracy of defect identification.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118628483B_ABST
    Figure CN118628483B_ABST
Patent Text Reader

Abstract

The present application relates to the field of image recognition technology, and specifically to a method for identifying defects on the surface of a steel structure, the method comprising: obtaining all closed connected areas based on a grayscale image of the steel structure surface and a binary image of the steel structure surface; analyzing the distribution characteristics of the pixels in the grayscale image of the steel structure surface to construct the degree of grayscale difference with variable distance; constructing the separation degree of adjacent areas in combination with the distribution characteristics of the closed connected areas; constructing the window coefficient in combination with the position of the pixel points to obtain the advantage of the long-run high window coefficient value of the pixel points, and further correcting the original window size; denoising the grayscale image of the steel structure surface; thereby completing defect identification. The present application aims to use windows of different sizes for bilateral filtering to filter out the influence of noise on the steel structure surface, thereby making the defect identification on the steel structure surface more accurate.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of image recognition, and in particular to a method for identifying surface defects of steel structures. Background Art

[0002] Steel structure image recognition is of great significance in the fields of engineering and manufacturing. Steel structure image recognition can be used to detect surface defects, cracks, deformations and other problems, help with quality control and timely repairs, and ensure the safety and reliability of steel structures. Through image recognition technology, automatic detection and identification of steel structure parts can be achieved, improving production efficiency and product quality. It can also be used for positioning and identification in the automated assembly process, real-time monitoring of steel structures, and timely discovery and identification of potential problems, so as to carry out maintenance and repair in advance, extend equipment life and reduce maintenance costs. Through big data analysis and machine learning technology, steel structure image data can be mined and analyzed to achieve prediction of the health status of steel structures and maintenance planning, thereby improving equipment utilization and safety.

[0003] There may be various forms of defects on the surface of steel structures, such as scratches, welds, rust, etc. These defects will bring noise and interference to the image. When identifying defects on the surface of steel structures, bilateral filtering algorithms are usually used to denoise the image. The bilateral filtering algorithm performs well in edge-preserving denoising, but its window size is usually fixed, which may cause the local structure of the image to be affected when the same size window is applied to denoise in different image areas. This is particularly evident when processing images with uneven noise distribution, because the noise level in different areas may be different. Using fixed window denoising will affect the defect recognition of the image, resulting in a decrease in the accuracy of defect extraction and recognition. Summary of the invention

[0004] In order to solve the above technical problems, the present application provides a method for identifying surface defects of steel structures to solve the existing problems.

[0005] A method for identifying surface defects of steel structures in this application adopts the following technical solution:

[0006] An embodiment of the present application provides a method for identifying surface defects of a steel structure, the method comprising the following steps:

[0007] Obtaining a grayscale image and a binary image of the steel structure surface; obtaining all closed connected areas based on the binary image of the steel structure surface;

[0008] The grayscale image of the steel structure surface is denoised, and the denoising process includes:

[0009] (1) According to the grayscale distribution and distance characteristics of the pixel point and the neighboring pixel points in the grayscale image of the steel structure surface, the variable distance grayscale difference degree of each pixel point is obtained;

[0010] (2) According to the spatial distribution characteristics of each closed connected region and the degree of grayscale difference of all pixels in the closed region, the separation degree of the adjacent regions of each closed connected region is obtained;

[0011] (3) Based on the separation degree of the neighboring regions of each closed connected region and the position distribution of each pixel, the corrected window size of each pixel is obtained;

[0012] (4) De-noising the grayscale image of the steel structure surface according to the correction window size of each pixel point;

[0013] Defect recognition is completed on the denoised grayscale image of the steel structure surface.

[0014] Preferably, the step of obtaining the variable distance grayscale difference degree of each pixel point according to the grayscale distribution and distance characteristics of the pixel point and the neighboring pixel points in the grayscale image of the steel structure surface includes:

[0015] The Euclidean distance between each pixel point and the remaining pixel points in the corresponding neighborhood is recorded as the first Euclidean distance, and the absolute value of the difference between the grayscale values ​​of each pixel point and the remaining pixel points in the corresponding neighborhood is obtained; the ratio of the absolute value of the difference and the first Euclidean distance is calculated; and the average of all the ratios of each pixel point is taken as the variable distance grayscale difference degree of each pixel point.

[0016] Preferably, the obtaining of the adjacent region separation degree of each closed connected region is specifically as follows:

[0017] Get the centroid and minimum enclosing rectangle of all closed connected areas;

[0018] For each closed connected region, a preset number of closed connected regions closest to the centroid of each closed connected region are used as all reference regions of each closed connected region;

[0019] Recording the Euclidean distance between the centroid of each closed connected area and the center of the minimum enclosing rectangle as a second Euclidean distance, and recording the Euclidean distance between each closed connected area and the center of any reference area as a third Euclidean distance; calculating the sum of the second Euclidean distance and the third Euclidean distance;

[0020] Calculate the absolute value of the variance difference of the variable distance grayscale difference between each closed connected area and all pixels of any reference area respectively; take the product of the sum and the absolute value of the variance difference as the first product; calculate the mean of the first product of each closed area and all reference areas;

[0021] Calculate the difference between the length and width of the minimum enclosing rectangle of each closed connected area;

[0022] The product of the difference and the mean is used as the neighboring region separation degree of each closed connected region.

[0023] Preferably, the step of obtaining the corrected window size of each pixel based on the separation degree of the neighboring regions of each closed connected region in combination with the position distribution of each pixel includes:

[0024] Based on the separation degree of the neighboring regions of the closed connected region where each pixel is located and the position distribution, the window coefficient of each pixel is obtained;

[0025] According to the numerical distribution of the window coefficients of all pixels, the advantages of long run and high window coefficient values ​​of each pixel are obtained;

[0026] The product of the normalized value of the long-run high window coefficient value advantage of each pixel point and the preset control coefficient is recorded as the second product; the addition result of the second product and 1 is calculated; and the product of the addition result and the initial window size is used as the modified window coefficient;

[0027] If the correction window coefficient is not an integer, the odd number closest to the correction window coefficient is used as the correction window size of each pixel;

[0028] If the correction window coefficient is an even number, the sum of the correction window coefficient and the preset value is used as the correction window size of each pixel;

[0029] Otherwise, the correction window coefficient is used as the correction window size of each pixel point.

[0030] Preferably, the window coefficient of each pixel is obtained based on the separation degree of the neighboring region of the closed connected region where each pixel is located in combination with the position distribution. The specific expression is:

[0031]

[0032] In the formula, represents the window coefficient of pixel k, Indicates the separation degree of the neighboring area of ​​the closed connected area where the pixel k is located, Represents the Euclidean distance between pixel point k and the centroid of the closed connected region where it is located. Indicates the separation degree of the neighboring area of ​​the closed connected area closest to pixel k, represents the minimum distance between pixel k and the center of all closed connected regions; k represents the sequence number of the pixel; D represents the set of pixels of all closed connected regions; Indicates that it does not belong to a symbol.

[0033] Preferably, the advantage of a long run and high window coefficient value of each pixel is obtained according to the numerical distribution of the window coefficients of all pixels, specifically:

[0034] Divide the window coefficients of all pixels into levels;

[0035] According to the level distribution of each pixel point, the run matrix of each pixel point in different directions is constructed;

[0036] Based on the run length matrix of each pixel in different directions, the expression of the long run length and high window coefficient advantage of each pixel is confirmed as:

[0037]

[0038] Where: Indicates the advantage of long run and high window coefficient of pixel k, Indicates that pixel k is along the direction The run matrix, Represents the window coefficient series of the pixel point k neighborhood, Indicates along the direction The maximum run length, Indicates along the direction All elements and values ​​of the run matrix on , i represents the window coefficient level, and j represents the run length.

[0039] Preferably, the window coefficients of all pixels are divided into levels, specifically:

[0040] Cluster the pixels according to the window coefficients of all pixels to obtain a set number of clusters; calculate the average value of the window coefficients of all pixels in each cluster, arrange the average values ​​in ascending order, and use the difference between the arrangement number and 1 as the window coefficient level of all pixels in each cluster.

[0041] Preferably, constructing the run matrices of each pixel in different directions according to the level distribution of each pixel includes:

[0042] The grayscale run-length matrix is ​​used according to the window coefficient levels of all pixels in the neighborhood of each pixel to obtain the run-length matrix of each pixel in a preset direction.

[0043] Preferably, the denoising of the grayscale image of the steel structure surface according to the correction window size of each pixel point is specifically as follows:

[0044] The grayscale image of the steel structure surface is used as the input of the bilateral filtering algorithm, the corrected window size of each pixel point is replaced by the initial window size of each pixel point in the original bilateral filtering algorithm, and the denoised grayscale image of the steel structure surface is output.

[0045] Preferably, the defect recognition is performed on the denoised steel structure surface grayscale image, specifically:

[0046] The threshold segmentation algorithm is used to obtain the segmentation threshold of the denoised steel structure surface image, and the area greater than the segmentation threshold is regarded as the defect area of ​​the steel structure surface image.

[0047] This application has at least the following beneficial effects:

[0048] The present application mainly analyzes the grayscale image of the steel structure, constructs the degree of grayscale difference with variable distance, determines the flatness of the position of the pixel point through the grayscale distribution of the neighborhood pixels, and makes a preliminary judgment on whether the pixel point is a normal pixel point; at the same time, the distribution rules between adjacent areas are analyzed, and the impurity areas far away from the weld are subjected to separation analysis, which is conducive to determining the distance between the closed connected area where each pixel point is located and the weld, so that the constructed window coefficient is more in line with the actual situation of the steel structure surface; the grayscale run matrix algorithm is used to analyze the distribution of the window coefficient, and the window size is accurately determined in combination with local information; the adaptive window size is used for bilateral filtering to obtain the denoised grayscale image of the steel structure surface, which retains more weld information on the steel structure surface, and filters out the influence of light and shadow and irregular protrusions on the steel structure surface, so that the defect identification on the steel structure surface is more accurate. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0050] Figure 1 A flow chart of a method for identifying surface defects of a steel structure provided in this application;

[0051] Figure 2 A flowchart for obtaining the denoised steel structure surface image provided in this application. DETAILED DESCRIPTION

[0052] In order to further explain the technical means and effects adopted by the present application to achieve the predetermined invention purpose, the following is a detailed description of the steel structure surface defect identification method proposed in the present application, its specific implementation method, structure, characteristics and effects, in combination with the accompanying drawings and preferred embodiments. In the following description, different "one embodiment" or "another embodiment" does not necessarily refer to the same embodiment. In addition, specific features, structures or characteristics in one or more embodiments may be combined in any suitable form.

[0053] 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 application belongs.

[0054] The specific scheme of the steel structure surface defect identification method provided by the present application is described in detail below with reference to the accompanying drawings.

[0055] An embodiment of the present application provides a method for identifying surface defects of a steel structure.

[0056] Specifically, the following steel structure surface defect identification method is provided, please refer to Figure 1 , the method comprises the following steps:

[0057] S1: Obtain a grayscale image and a binary image of the steel structure surface; obtain all closed connected areas based on the binary image of the steel structure surface.

[0058] This embodiment analyzes the weld characteristics in the steel structure image by improving the window size of each pixel in the bilateral filtering algorithm, thereby affecting the selection of the window size in the filtering process, completing the denoising effect of the noise in the image, and further improving the accuracy of steel structure surface defect recognition.

[0059] The surface of the steel structure is scanned and imaged at high speed by a surface scanning camera to obtain an RGB spatial image of the steel structure surface. The acquired image is preprocessed to convert the RGB image of the steel structure surface into a grayscale image of the steel structure surface, wherein the image conversion is a well-known technology in the art and will not be described in detail here.

[0060] The edge detection algorithm is used on the grayscale image of the steel structure surface to obtain the binary image of the steel structure surface. The connected domain analysis is used to obtain all closed areas in the binary image of the steel structure surface.

[0061] In some embodiments of the present application, the edge detection algorithm uses Canny edge detection;

[0062] It should be understood that the implementer may select other edge detection algorithms for the selection of edge detection algorithms, and this application does not impose any limitation on this.

[0063] S2: Denoise the grayscale image of the steel structure surface.

[0064] After obtaining the grayscale image of the steel structure surface, there will be a lot of noise in the image that affects the identification of weld defects. Bilateral filtering is a filter that can preserve edges and remove noise. It is a compromise between the spatial proximity of the image and the similarity of pixel values. The embodiment of the present application aims to use windows of different sizes for bilateral filtering in different image areas.

[0065] (1) According to the grayscale distribution and distance characteristics of the pixel point and the neighboring pixel points in the grayscale image of the steel structure surface, the variable distance grayscale difference degree of each pixel point is obtained.

[0066] In one embodiment of the present application, the method for obtaining the variable distance grayscale difference degree of each pixel point is:

[0067] Taking each pixel as the central pixel, traverse the grayscale value of each pixel in the neighborhood of the central pixel, calculate the absolute value of the grayscale difference between the central pixel and each pixel in the neighborhood, and then obtain the variable distance grayscale difference degree according to the influence of the position of each pixel from the central pixel on the difference degree. The expression is:

[0068]

[0069] In the formula, is the grayscale difference of pixel k, is the number of pixels in the neighborhood of pixel k, represents the gray value of pixel k, Represents the gray value of the i-th pixel in the neighborhood of pixel k, represents the i-th pixel in the neighborhood of pixel k, k represents pixel k, represents the Euclidean distance function. It is recorded as the first Euclidean distance.

[0070] In one embodiment of the present application, the neighborhood of a pixel point is , implementers can make adjustments based on actual conditions, and this application does not impose any restrictions on this.

[0071] When the difference between the pixels in the neighborhood and the central pixel is greater and the distance is smaller, it means that the influence of the pixels in the neighborhood on the central pixel is greater, and the degree of grayscale difference of the variable distance of the central pixel is greater; when the difference between the pixels in the neighborhood and the central pixel is greater, but the distance is greater, it means that the influence of the point on the central pixel is smaller, and the degree of grayscale difference of the variable distance of the central pixel is smaller.

[0072] The variable distance grayscale difference degree measures the difference between the central pixel and the pixels in its neighborhood. The larger the variable distance grayscale difference degree, the larger the grayscale value difference of the pixels around the pixel, indicating that the area around the pixel is not very flat; if the variable distance grayscale difference degree is smaller, the smaller the grayscale value difference of the pixels around the pixel, indicating that the area around the pixel is relatively flat.

[0073] (2) According to the spatial distribution characteristics of each closed connected region and the degree of grayscale difference of all pixels in the closed region, the separation degree of the adjacent regions of each closed connected region is obtained.

[0074] Specifically, for the nth closed connected area, if there are fewer closed connected areas around the closed connected area, and the distribution positions of these fewer closed connected areas are relatively concentrated, it means that the closed connected area may be in the non-weld area in the steel structure surface image, that is, the closed connected area may be some irregular protrusions, which are the noise of the grayscale image of the steel structure surface. For these noises, the window should be enlarged in time to denoise the closed connected area and eliminate the influence of noise on weld defect recognition.

[0075] Based on this, obtain the M closed connected regions closest to the center of gravity of the nth closed connected region as the reference region of the closed connected region. Obtain the minimum enclosing rectangle of the closed connected region and all its reference regions. According to the spatial distribution of the minimum enclosing rectangles of all reference regions of the nth closed connected region, construct the separation degree of the neighboring regions of the nth closed connected region, expressed as:

[0076]

[0077] In the formula, represents the separation degree of the neighboring regions of the nth closed connected region, , They represent the length and width of the smallest enclosing rectangle of the nth closed connected region, represents the number of reference regions of the nth closed connected region, It represents the Euclidean distance between the center of gravity of the nth closed connected region and the center of its smallest enclosing rectangle, recorded as the second Euclidean distance. It represents the Euclidean distance between the center of the nth closed connected region and its xth reference region, denoted as the third Euclidean distance, Represents the absolute value of the difference between the variance of the variable distance grayscale difference between the nth closed connected region and its xth reference region. Recorded as the first product.

[0078] In some embodiments of the present application, the value of M is 5, and the implementer can adjust it according to the actual situation, and the present application does not impose any restrictions on this.

[0079] By using the difference between the variances of the grayscale difference degree of variable distance to correct the distance between the closed connected region and its reference region, the greater the difference between the variances of the grayscale difference degree of variable distance, the less similar the chaotic distribution degree in the two regions is. At the same time, the distance is weighted so that the difference between the two regions is magnified on the basis of the original actual distance, making the separation degree of the adjacent regions greater. By combining the distance between the regions with the distance between the centers of the minimum enclosing rectangles where the distance of the closed connected region is located, not only the distance between the regions is considered, but also whether the distribution of the closed connected region is located at the center of the minimum enclosing rectangle, so as to determine the dense distribution of other regions around the closed connected region, and indirectly evaluate the separation degree of the adjacent regions of the closed connected region. The greater the separation degree of the adjacent regions, the greater the difference of the closed connected region relative to the surrounding regions.

[0080] (3) Based on the separation degree of the neighboring regions of each closed connected region and the position distribution of each pixel, the corrected window size of each pixel is obtained.

[0081] For any pixel in the grayscale image, obtain the closed connected area where the centroid closest to the current pixel is located. If the pixel is inside the closed connected area, the closer the Euclidean distance from the centroid is, the closer the point is to the centroid of the closed connected area, and the less details it has relative to the edge position. In this case, the filter window can be appropriately enlarged to focus on the overall filtering effect; otherwise, the window needs to be reduced to perform targeted denoising on the details of the closed connected area. At the same time, the window coefficient of the pixel is constructed based on the difference between the closed connected area where the pixel is located and the closed connected area around it. The expression is:

[0082]

[0083] In the formula, represents the window coefficient of pixel k, Indicates the separation degree of the neighboring area of ​​the closed connected area where the pixel k is located, Represents the Euclidean distance between pixel point k and the centroid of the closed connected region where it is located. Indicates the separation degree of the neighboring area of ​​the closed connected area closest to pixel k, represents the minimum distance between pixel k and the center of all closed connected regions; k represents the sequence number of the pixel; D represents the set of pixels of all closed connected regions; Indicates that it does not belong to a symbol.

[0084] When pixel k belongs to the inside of a closed connected area, the smaller the Euclidean distance between pixel k and the centroid of the nearest closed connected area, the closer the pixel is to the center of the closed connected area, and the less detailed information is on the edge of the closed connected area, so the window can be appropriately enlarged; when pixel k does not belong to the inside of a closed connected area, the larger the Euclidean distance between pixel k and the centroid of the closed connected area, the farther the pixel is from the closed connected area, which means the less detailed information is needed, and only the overall filtering is required. At the same time, combined with the separation degree of the neighboring area, the window enlargement of each pixel is reflected. When the separation degree of the neighboring area of ​​the closed connected area where the pixel k is located is larger, it means that the pixel is more away from the weld area on the surface of the steel structure and closer to the impurity area on the surface of the steel structure, so the window can be appropriately enlarged, thereby achieving a filtering effect without excessive loss of image quality.

[0085] In order to obtain the distribution relationship of the window coefficient around each pixel point, the characteristics of the pixels in the weld area with high and very concentrated window coefficients are characterized. Therefore, the pixels are clustered using a clustering algorithm based on the window coefficients of all pixels to obtain 5 clusters, and the average value of the window coefficients of all pixels in each cluster is calculated. The window coefficient levels of all pixels in the cluster are divided according to the arrangement sequence number in ascending order of the average value. For example, the window coefficient level of the pixels in the cluster with the smallest mean is 0, and the window coefficient level of the pixels in the cluster with the second smallest mean is 1, and so on, to obtain a window coefficient image with window coefficient levels of 0 to 4. , the window coefficient level is 5.

[0086] In some embodiments of the present application, the clustering algorithm adopts the K-means clustering algorithm;

[0087] It should be understood that, as other implementation methods only, the implementer can choose other clustering algorithms and adjust the number of clusters by himself, and this application does not impose any restrictions on this; it should be noted that the number of clusters corresponds to the window coefficient level.

[0088] For each pixel in the window coefficient image, The grayscale run matrix is ​​used within the range of the neighborhood size to calculate the run matrix of each pixel. The grayscale run matrix is ​​a well-known technology and will not be described in detail in this embodiment. The long run high window coefficient value advantage of each pixel is obtained through the run matrix, and the expression is:

[0089]

[0090] Where: Indicates the advantage of long run and high window coefficient of pixel k, Indicates that pixel k is along the direction The run matrix, Represents the window coefficient series of the pixel point k neighborhood, Indicates along the direction The maximum run length, Indicates along the direction All elements and values ​​of the run matrix on , i represents the window coefficient level, and j represents the run length.

[0091] In some embodiments of the present application, the direction Choose between horizontal and vertical.

[0092] It should be understood that the direction The implementer can choose according to the actual situation, and this application does not impose any restrictions on this.

[0093] If long runs and high window coefficient values ​​are dominant The larger the value is, the more it means that there are multiple identical and large window coefficient values ​​around the current pixel, and the pixel close to the impurity area has a larger window coefficient than the pixel in the weld area on the steel surface, indicating that the pixel is more likely to be an impurity area and the window needs to be enlarged; otherwise, it means that the pixel is in the weld area on the steel structure surface and the window needs to be reduced to retain the weld details.

[0094] The commonly used bilateral filter window size ranges from 5×5 to 25×25. If there are many noise points, a larger window can be selected; if there are fewer noise points, a smaller window can be selected. In this embodiment, 5 is used as the initial window size. By taking advantage of the long run and high window coefficient, the initial window size of each pixel is corrected, thereby improving the indiscriminateness of the bilateral filter algorithm in removing noise.

[0095] According to the advantages of long run and high window coefficient value , for the initial window size The value is corrected to obtain the corrected value.

[0096]

[0097] In the formula, represents the correction window coefficient of pixel k, represents the initial window size of pixel k, r is the control coefficient, and Norm() is the normalization function. Indicates the advantage of long-run high window coefficient value of pixel k. Recorded as the second product.

[0098] In one embodiment of the present application, the control coefficient is set to 4, so that the correction window size ranges from 5 to 25.

[0099] It is necessary to further optimize the correction window coefficient to obtain the correction window size. When the correction window coefficient of a pixel point is a decimal, the odd number closest to the decimal is used as the correction window size of the pixel point; when the correction window coefficient of the pixel point is an even number, the sum of the even number plus 1 is used as the correction window size of the pixel point; otherwise, the correction window coefficient is the correction window size.

[0100] The advantage of long-stroke high window coefficient value is used to control the degree of window enlargement. If the advantage of long-stroke high window coefficient value is larger, it means that the pixel has less detail information, that is, it is an impurity area, and the window can be enlarged for filtering; otherwise, it is necessary to reduce the window, that is, filter the pixels in the weld area. The weld area has more details, and reducing the window can retain the detail information while capturing more local pixel information.

[0101] (4) De-noising the grayscale image of the steel structure surface according to the correction window size of each pixel point;

[0102] The bilateral filtering algorithm is used to improve the traditional bilateral filtering algorithm by correcting the real-time window size of each pixel, so as to obtain the denoised grayscale image of the steel structure surface. The denoised grayscale image of the steel structure surface retains more information about the weld seams on the steel structure surface, and the influence of light and shadow and irregular protrusions on the steel structure surface is filtered out, so that the weld seam recognition on the steel structure surface is more accurate. The flowchart for obtaining the denoised steel structure surface image is shown in the figure. Figure 2 shown.

[0103] S3: Complete defect recognition on the denoised grayscale image of the steel structure surface.

[0104] The denoised grayscale image of the steel structure surface is used as the input of the threshold segmentation algorithm to obtain the segmentation threshold, and the area greater than the segmentation threshold is regarded as the defect area on the steel structure surface.

[0105] In one embodiment of the present application, the threshold segmentation algorithm adopts the Otsu threshold method;

[0106] It should be understood that the implementer may choose other threshold segmentation algorithms or authority detection algorithms to identify defects in the denoised steel structure surface image, and this application does not impose any restrictions on this.

[0107] At this point, the defect identification on the steel structure surface is completed.

[0108] In summary, the embodiment of the present application mainly analyzes the grayscale image of the steel structure to construct the degree of grayscale difference with variable distance, determines the flatness of the position of the pixel point through the grayscale distribution of the neighborhood pixels, and makes a preliminary judgment on whether the pixel point is a normal pixel point; at the same time, the distribution rules between adjacent areas are analyzed, and the impurity areas far away from the weld are subjected to separation analysis, which is conducive to determining the distance between the closed connected area where each pixel point is located and the weld, so that the constructed window coefficient is more in line with the actual situation of the steel structure surface; the grayscale run matrix algorithm is used to analyze the distribution of the window coefficient, and the window size is accurately determined in combination with local information; an adaptive window size is used for bilateral filtering to obtain a denoised grayscale image of the steel structure surface, which retains more weld information on the steel structure surface, and filters out the influence of light and shadow and irregular protrusions on the steel structure surface, so that the defect identification of the steel structure surface is more accurate.

[0109] It should be noted that the above sequence of the embodiments of the present application is for description only and does not represent the advantages and disadvantages of the embodiments. The above is a description of a specific embodiment of this specification. In addition, the processes depicted in the accompanying drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.

[0110] The various embodiments in this specification are described in a progressive manner, and the same or similar parts between the various embodiments can be referenced to each other, and each embodiment focuses on the differences from other embodiments.

[0111] The embodiments described above are only used to illustrate the technical solutions of the present application, rather than to limit them. Modifications to the technical solutions recorded in the aforementioned embodiments, or equivalent replacement of some of the technical features therein, do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present application, and should all be included in the protection scope of the present application.

Claims

1. A method for identifying surface defects of steel structures, It is characterized in that The method comprises the following steps: Obtaining a grayscale image and a binary image of the steel structure surface; obtaining all closed connected areas based on the binary image of the steel structure surface; The grayscale image of the steel structure surface is denoised, and the denoising process includes: (1) According to the grayscale distribution and distance characteristics of the pixel point and the neighboring pixel points in the grayscale image of the steel structure surface, the variable distance grayscale difference degree of each pixel point is obtained; (2) According to the spatial distribution characteristics of each closed connected region and the degree of grayscale difference of all pixels in the closed region, the separation degree of the adjacent regions of each closed connected region is obtained; (3) Based on the separation degree of the neighboring regions of each closed connected region and the position distribution of each pixel, the corrected window size of each pixel is obtained; (4) De-noising the grayscale image of the steel structure surface according to the correction window size of each pixel point; Complete defect recognition on the denoised grayscale image of the steel structure surface; The step of obtaining the grayscale difference of each pixel point according to the grayscale distribution and distance characteristics of the pixel point and the neighboring pixel points in the grayscale image of the steel structure surface includes: The Euclidean distance between each pixel point and the remaining pixel points in the corresponding neighborhood is recorded as the first Euclidean distance, and the absolute value of the difference between the grayscale values ​​of each pixel point and the remaining pixel points in the corresponding neighborhood is obtained; the ratio of the absolute value of the difference and the first Euclidean distance is calculated; and the average of all the ratios of each pixel point is taken as the variable distance grayscale difference degree of each pixel point.

2. A method for identifying surface defects of a steel structure as claimed in claim 1, It is characterized in that The step of obtaining the separation degree of adjacent regions of each closed connected region is specifically as follows: Get the centroid and minimum enclosing rectangle of all closed connected areas; For each closed connected region, a preset number of closed connected regions closest to the centroid of each closed connected region are used as all reference regions of each closed connected region; The Euclidean distance between the centroid of each closed connected area and the center of the minimum enclosing rectangle is recorded as the second Euclidean distance, and the Euclidean distance between each closed connected area and the center of any reference area is recorded as the third Euclidean distance; Calculating the sum of the second Euclidean distance and the third Euclidean distance; Calculate the absolute value of the variance difference between the variable distance grayscale difference of each closed connected area and all pixels of any reference area respectively; Taking the product of the sum and the absolute value of the variance difference as the first product; Calculate the average of the first products of each closed area and all reference areas; Calculate the difference between the length and width of the minimum enclosing rectangle of each closed connected area; The product of the difference and the mean is used as the neighboring region separation degree of each closed connected region.

3. A method for identifying surface defects of a steel structure as claimed in claim 1, It is characterized in that The method of obtaining the correction window size of each pixel based on the separation degree of the neighboring regions of each closed connected region and the position distribution of each pixel point includes: Based on the separation degree of the neighboring regions of the closed connected region where each pixel is located and the position distribution, the window coefficient of each pixel is obtained; According to the numerical distribution of the window coefficients of all pixels, the advantage of long run and high window coefficient value of each pixel is obtained; The product of the normalized value of the long-run high window coefficient value advantage of each pixel point and the preset control coefficient is recorded as the second product; the addition result of the second product and 1 is calculated; and the product of the addition result and the initial window size is used as the modified window coefficient; If the correction window coefficient is not an integer, the odd number closest to the correction window coefficient is used as the correction window size of each pixel; If the correction window coefficient is an even number, the sum of the correction window coefficient and the preset value is used as the correction window size of each pixel; Otherwise, the correction window coefficient is used as the correction window size of each pixel point.

4. A method for identifying surface defects of a steel structure as claimed in claim 3, It is characterized in that The window coefficient of each pixel is obtained by combining the separation degree of the adjacent area of ​​the closed connected area where each pixel is located with the position distribution. The specific expression is: In the formula, represents the window coefficient of pixel k, Indicates the separation degree of the neighboring area of ​​the closed connected area where the pixel k is located, Represents the Euclidean distance between pixel point k and the centroid of the closed connected region where it is located. Indicates the separation degree of the neighboring area of ​​the closed connected area closest to pixel k, represents the minimum distance between pixel k and the center of all closed connected regions; k represents the sequence number of the pixel; D represents the set of pixels in all closed connected regions; Indicates that it does not belong to a symbol.

5. A method for identifying surface defects of a steel structure as claimed in claim 3, It is characterized in that According to the numerical distribution of the window coefficients of all pixels, the advantage of long run and high window coefficient value of each pixel is obtained, which is specifically: Divide the window coefficients of all pixels into levels; According to the level distribution of each pixel point, the run length matrix of each pixel point in different directions is constructed; Based on the run length matrix of each pixel in different directions, the expression of the long run length and high window coefficient advantage of each pixel is confirmed as: Where: Indicates the advantage of long run and high window coefficient of pixel k, Indicates that pixel k is along the direction The run matrix, Represents the window coefficient series of the pixel point k neighborhood, Indicates along the direction The maximum run length, Indicates along the direction All elements and values ​​of the run matrix on , i represents the window coefficient level, and j represents the run length.

6. A method for identifying surface defects of a steel structure as claimed in claim 5, It is characterized in that The window coefficients of all pixels are divided into levels, specifically: Cluster the pixels according to the window coefficients of all pixels to obtain a set number of clusters; calculate the average value of the window coefficients of all pixels in each cluster, arrange the average values ​​in ascending order, and use the difference between the arrangement number and 1 as the window coefficient level of all pixels in each cluster.

7. A method for identifying surface defects of a steel structure as claimed in claim 5, It is characterized in that The step of constructing the run length matrix of each pixel in different directions according to the level distribution of each pixel includes: The grayscale run-length matrix is ​​used according to the window coefficient levels of all pixels in the neighborhood of each pixel to obtain the run-length matrix of each pixel in a preset direction.

8. A method for identifying surface defects of a steel structure as claimed in claim 1, It is characterized in that The denoising of the grayscale image of the steel structure surface is performed according to the correction window size of each pixel point, specifically: The grayscale image of the steel structure surface is used as the input of the bilateral filtering algorithm, the corrected window size of each pixel point is replaced by the initial window size of each pixel point in the original bilateral filtering algorithm, and the denoised grayscale image of the steel structure surface is output.

9. A method for identifying surface defects of a steel structure as claimed in claim 1, It is characterized in that The defect recognition is completed on the denoised steel structure surface grayscale image, specifically: The threshold segmentation algorithm is used to obtain the segmentation threshold of the denoised steel structure surface image, and the area larger than the segmentation threshold is regarded as the defect area of ​​the steel structure surface image.