Defect extraction method for penetration detection image of welded spherical tank connecting shell
By constructing preliminary saliency value optimization coefficients of color and texture features in penetration testing images, the problem of difficulty in distinguishing welds from real cracks is solved, and defect extraction with high accuracy and reliability is achieved.
Patent Information
- Application Number
- CN202511196149.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-26
- Publication Date
- 2025-10-03
- Estimated Expiration
- 2045-08-26
AI Technical Summary
In the existing technology, the algorithm based on saliency detection cannot effectively distinguish between welds and real cracks, resulting in inaccurate defect detection results in the penetration inspection image of the welded spherical tank connection shell.
By calculating the color and texture features of the penetration test image, a preliminary saliency value optimization coefficient is constructed. Combined with the saliency detection algorithm, welds and real cracks are distinguished, thereby improving the accuracy of defect extraction.
The accuracy and reliability of defect extraction are significantly improved, the risk of missed detection and false detection is reduced, the significance of real cracks is enhanced, and artifact interference in the weld area is suppressed.
Smart Images

Figure CN120747485A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of image processing technology, and in particular to a method for extracting defects from penetration testing images of welded spherical tank connection shells. Background Art
[0002] The connecting shell is the weak link in the spherical tank structure, and its welding quality will directly affect the service life and safety performance of the equipment. During long-term use, due to factors such as material fatigue or manufacturing defects, tiny cracks are very likely to appear at the weld joints. If not discovered in time, they may expand and cause equipment failure or even cause catastrophic accidents. Penetrant testing is a non-destructive testing technology widely used to detect open defects on the surface of metal materials. This technology applies a highly permeable liquid to the surface of the component, allowing it to penetrate into the surface cracks. After removing excess penetrant, the capillary action of the developer is used to adsorb the penetrant in the cracks to the surface, thereby forming an amplified defect indication that contrasts sharply with the background color, making tiny cracks visible.
[0003] Currently, existing technologies generally use computer vision technology to analyze images generated after penetrant testing. Among these, saliency detection algorithms, such as the Frequency-Tuned Saliency Detection (FT) algorithm, are used in defect identification because they can quickly locate the most noticeable areas in an image. The core concept of the FT algorithm is to quantify the saliency of each pixel in an image by calculating the Euclidean distance between the color value of each pixel in the Lab color space and the average color value of the entire image. Regions with higher saliency values are more likely to be identified as target defects.
[0004] However, due to the high temperatures experienced during welding, the weld surface has a different metallographic structure and roughness than the base material. This can also cause the weld to absorb and retain some penetrant and developer, resulting in high-contrast stripes in the image. In this case, the pixel saliency values of the weld area can be very close to those of actual crack defects, making it difficult for traditional algorithms to effectively distinguish between the two. This results in a large number of false defects, meaning that intact weld areas can be misidentified as cracks. Summary of the Invention
[0005] In order to solve the technical problem in the existing technology that the algorithm based on saliency detection cannot effectively distinguish between welds and real cracks, resulting in inaccurate defect detection results, the present application provides a defect extraction method for the penetration inspection image of the welded spherical tank connection shell, which can significantly improve the accuracy and reliability of defect extraction.
[0006] The present application provides a defect extraction method for a penetration test image of a welded spherical tank connection shell, the method comprising: acquiring a penetration test image of a welded spherical tank connection shell, and preprocessing the penetration test image; calculating a preliminary significance value optimization coefficient for each pixel point in the penetration test image based on the color features and texture features of the penetration test image; calculating a final significance value for each pixel point based on the preliminary significance value optimization coefficient and the preliminary significance value of each pixel point obtained by a significance detection algorithm; determining a crack defect area in the penetration test image based on the final significance value, so as to realize defect extraction of the penetration test image of the welded spherical tank connection shell.
[0007] The present application can correct the traditional significance detection results by calculating the preliminary significance value optimization coefficient, effectively distinguishing between real crack areas and weld areas with similar color features but different texture features, thereby suppressing the significance of the weld area and enhancing the significance of the crack area, significantly improving the accuracy and reliability of defect extraction.
[0008] In one embodiment, the calculation of the preliminary saliency value optimization coefficient of each pixel point in the penetration detection image includes: calculating the color prominence factor of each pixel point based on the difference between the RGB channel value of each pixel point and the average RGB channel value of all pixels in the image, and the sum of the RGB three-channel values of each pixel point; calculating the preliminary saliency value optimization coefficient of each pixel point based on the texture features of each pixel point in the grayscale image and the color prominence factor.
[0009] By calculating color features and texture features step by step, we first use the color prominence factor to preliminarily screen out pixels that may be defects in color, and then further confirm them through texture features, so that we can more accurately assess the possibility that each pixel is a real defect.
[0010] In one embodiment, the color prominence factor satisfies the relationship: Where represents the color prominence factor of the i-th pixel, 、 、 Respectively represent the absolute value of the difference between the R channel value, G channel value, and B channel value of the i-th pixel and the mean R channel value, G channel value, and B channel value of all pixels in the image, Represents the sum of the R, G, and B channel values of the i-th pixel. is a hyperparameter used to prevent The value is 0. is the normalization function.
[0011] By comprehensively considering the difference between the pixel color and the background color as well as the brightness of the pixel itself, the bright colors formed by the developer can be effectively highlighted, while the interference of dark noise points can be suppressed, thereby improving the sensitivity to the color characteristics of potential defects.
[0012] In one embodiment, the method of calculating the preliminary saliency value optimization coefficient of each pixel point based on the texture features of each pixel point in the grayscale image and the color prominence factor includes: grayscale processing the penetration detection image and obtaining edge pixel points using an edge detection operator; constructing a reference area with each pixel point as the center, and obtaining the chain code value of the edge pixel points in each reference area using chain code technology; and calculating the preliminary saliency value optimization coefficient of each pixel point based on the change in the chain code value of the edge pixel points in each reference area, the extreme difference in gradient amplitude, and the color prominence factor.
[0013] By analyzing the chain code value changes and gradient amplitude extremes of edge pixel points, the morphological characteristics of defects can be accurately described from the texture level, providing a quantitative basis for distinguishing linear cracks from strip welds.
[0014] In one embodiment, the preliminary saliency value optimization coefficient satisfies the relationship: Where represents the initial saliency optimization coefficient of the i-th pixel, represents the color prominence factor of the i-th pixel, Indicates the number of edge pixels within a pixel reference area. It represents the average value of the absolute value of the difference between the u-th edge pixel and its two adjacent edge pixels in the reference area of the i-th pixel with respect to the chain code value. Represents the extreme difference of the gradient amplitude of all edge pixels in the reference area of the i-th pixel. The value range adjustment coefficient of the preliminary saliency value optimization coefficient of a pixel point.
[0015] By fusing the two information dimensions of color and texture, the enhancement effect of crack pixels can be greatly improved while suppressing weld pixels.
[0016] In one embodiment, the final saliency value satisfies the relationship: Where represents the final saliency value of the i-th pixel, represents the initial saliency optimization coefficient of the i-th pixel, Represents the preliminary saliency value of the i-th pixel.
[0017] By multiplying the preliminary saliency value with the optimization coefficient, the saliency of the real defect area is enhanced, while the saliency of the non-defect area is suppressed, which directly improves the signal-to-noise ratio of the final defect image.
[0018] In one embodiment, the process of determining the crack defect area in the penetration detection image based on the final significance value is to traverse each pixel point in the penetration detection image. If the final significance value of the pixel point is greater than a preset judgment threshold, the pixel point is determined to be a defective pixel point belonging to the crack defect area.
[0019] In one embodiment, the method of preprocessing the penetration detection image is to convert the penetration detection image from RGB color space to Lab color space, and grayscale the penetration detection image to obtain a grayscale image.
[0020] The technical solution of this application has the following beneficial technical effects: This application constructs a color prominence factor to initially identify areas of color anomalies. It then analyzes the chain code and gradient characteristics of local edges to construct a preliminary saliency optimization coefficient, enabling precise distinction between elongated cracks and wide welds. Finally, by applying this optimization coefficient to the original preliminary saliency value to generate a final saliency map, it effectively differentiates between true cracks and interfering areas such as welds.
[0021] Furthermore, it can effectively suppress artifact interference in the weld area in the penetration inspection image, while enhancing the significance of real crack defects, thereby significantly improving the accuracy and robustness of defect extraction and reducing the risk of missed detection and false detection. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] Figure 1 This is a flowchart of a defect extraction method for a penetration inspection image of a welded spherical tank connection shell according to an embodiment of the present application.
[0023] Figure 2 It is a grayscale image corresponding to the original penetration detection image according to an embodiment of the present application.
[0024] Figure 3 It is a visualization diagram of the color prominence factor calculated according to the embodiment of the present application.
[0025] Figure 4 It is a visualization diagram of the preliminary significance value optimization coefficient calculated according to the embodiment of the present application.
[0026] Figure 5 3 is a visualization diagram of the preliminary significance value obtained according to the embodiment of the present application.
[0027] Figure 6 3 is a visualization diagram of the final saliency value calculated according to the embodiment of the present application. DETAILED DESCRIPTION
[0028] The technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments.
[0029] Figure 1 This is a flow chart of a defect extraction method for a welded spherical tank shell penetration test image according to an embodiment of the present application. Figure 1 As shown, the defect extraction method of the penetration inspection image of the welded spherical tank connection shell includes steps S101 to S104, which are described in detail below.
[0030] S101: Collect penetration test images of welded spherical tank connection shells and pre-process the penetration test images.
[0031] In one embodiment, an industrial camera or a high-definition camera is first used to photograph the surface of the welded spherical tank shell connection after the penetration testing process (i.e., after coating with a penetrant, cleaning, and coating with a developer) to obtain an original RGB color image. The captured image includes the background, welds, and possible crack defects displayed by the developer.
[0032] In this optional embodiment, the collected original image may be preprocessed. The preprocessing includes two parallel operations, including: Convert the original RGB image to Lab color space. Lab color space is more consistent with human visual perception than RGB color space. Its L component represents brightness, and a and b components represent color. This step is mainly to prepare for the subsequent use of saliency detection FT algorithm to calculate the preliminary saliency value of each pixel; and grayscale the original RGB image to obtain a grayscale image, such as Figure 2 The grayscale image retains the brightness and texture information of the image, which is used for subsequent analysis of the texture features within the reference area of each pixel.
[0033] In this way, by preprocessing the original image, image data in different color spaces required for subsequent color analysis and texture analysis are obtained, providing data support for subsequent calculations.
[0034] S102, calculating a preliminary saliency value optimization coefficient of each pixel point in the penetration detection image based on the color features and texture features of the penetration detection image.
[0035] In one embodiment, the color prominence factor of each pixel can be obtained by analyzing the RGB numerical characteristics of each pixel. Specifically, in penetrant testing, crack defects are usually marked by bright colors, such as red or yellow-green developers, while most areas on the surface of a spherical tank shell are relatively single in color. Therefore, if a pixel is a crack, its color should be significantly different from the overall background color of the image and its own brightness should be high to distinguish it from dark noise. The color prominence factor satisfies the relationship:
[0036] In the formula represents the color prominence factor of the i-th pixel, 、 、 Respectively represent the absolute value of the difference between the R channel value, G channel value, and B channel value of the i-th pixel and the mean R channel value, G channel value, and B channel value of all pixels in the image, Represents the sum of the R, G, and B channel values of the i-th pixel. is a hyperparameter, for example, , which exists to prevent The value is 0. is the normalization function.
[0037] Furthermore, in the formula The larger the value is, the more likely it is that the color of the i-th pixel belongs to the bright red or bright yellow-green under the action of the developer, and the larger the corresponding color highlight factor is. The larger the value is, the less likely the color of the i-th pixel is black, and the more likely the color of the i-th pixel is bright red or bright yellow-green under the action of the developer. The greater the credibility, the larger the corresponding color highlighting factor.
[0038] In this optional embodiment, if Figure 3 , which is a visualization diagram of the color prominence factor calculated according to an embodiment of the present application, wherein both the crack and weld areas are illuminated, but the crack area is brighter.
[0039] In an optional embodiment, the texture features of each pixel in the grayscale image can be analyzed and combined with the color prominence factor to calculate a preliminary saliency value optimization coefficient. Specifically, while the color prominence factor can highlight areas of color anomalies, it still cannot distinguish between cracks and welds. The typical texture of a crack is a thin line with sharp edges and a nearly straight trajectory; the texture of a weld is a wide band with relatively blurred edges and a smooth curve.
[0040] Furthermore, the Canny operator can be used to perform edge detection on the grayscale image to extract all edge pixels in the image. Then, for each pixel in the image, a 9×9 neighborhood is defined with the pixel as the center as its reference area.
[0041] Next, for each reference region, the texture features of the edge pixels within it are analyzed. First, the straightness of the edge is analyzed. Within the reference region, if an edge exists, each individual edge segment is encoded using an 8-neighborhood chain code technique. The chain code uses the numbers 0-7 to represent the eight possible directions from the current pixel to the next adjacent edge pixel. The chain code value sequence for a straight line segment varies slightly, for example, 0, 0, 0, 1, 0..., while the chain code value sequence for a curved line varies significantly, for example, 0, 1, 2, 2, 3.... By calculating the difference between the chain codes of all edge pixels within the reference region and their adjacent edge pixels, the straightness of the edge can be assessed.
[0042] Edge sharpness also needs to be analyzed. The intermediate steps of the Canny operator yield the gradient amplitude for each pixel. Real crack edges exhibit dramatic grayscale variations, resulting in large gradient amplitudes and a wide range of variation. In contrast, weld edges exhibit relatively flat gradients, with small gradient amplitudes and a narrow range of variation. Therefore, calculating the range of the gradient amplitudes (maximum minus minimum) for all edge pixels within a reference region can be used to assess edge sharpness.
[0043] In this optional embodiment, the preliminary saliency value optimization coefficient satisfies the relationship:
[0044] In the formula represents the initial saliency optimization coefficient of the i-th pixel, represents the color prominence factor of the i-th pixel, Indicates the number of edge pixels within a pixel reference area. It represents the average of the absolute values of the differences between the u-th edge pixel and its two adjacent edge pixels in the reference area of the i-th pixel with respect to the chain code value (if an edge pixel is located at the two endpoints of the chain code, there will only be one adjacent edge pixel. In this case, represents the absolute value of the difference between the u-th edge pixel and its adjacent edge pixel in the i-th pixel reference area with respect to the chain code value); Represents the extreme difference of the gradient amplitude of all edge pixels in the reference area of the i-th pixel. The value range adjustment coefficient of the preliminary saliency value optimization coefficient of a pixel point is, for example, , and finally adjust the value range of the initial saliency optimization coefficient of a pixel point to the interval .
[0045] Furthermore, in the formula The larger the value, the greater the possibility that the i-th pixel belongs to the potential crack defect area based on the RGB numerical feature analysis. In order to more accurately classify the pixel into the potential crack defect area on the surface of the welded spherical tank connection shell, the final significance value of the i-th pixel needs to be larger, so the optimization coefficient of the initial significance value of the i-th pixel is larger. The smaller it is, the greater the possibility that the edge pixel point in the reference area of the i-th pixel point belongs to the potential crack defect area. In order to more accurately classify the pixel point into the potential crack defect area on the surface of the welded spherical tank connection shell, the final significance value of the i-th pixel point needs to be larger, so the optimization coefficient of the initial significance value of the i-th pixel point is larger. The larger the value is, the greater the possibility that all edge pixels in the reference area of the i-th pixel belong to the potential crack defect area, and the greater the credibility is. Therefore, in order to more accurately classify the pixel into the potential crack defect area on the surface of the welded spherical tank connection shell, the initial significance value optimization coefficient of the i-th pixel should also be larger.
[0046] In this optional embodiment, if Figure 4 As shown, a visualization diagram of the preliminary significant value optimization coefficient calculated according to an embodiment of the present application shows that only the crack area is displayed, while the weld area is effectively suppressed.
[0047] In this way, by calculating the color prominence factor, the potential defect area can be preliminarily enhanced from the color dimension, and by combining color and texture information to calculate the preliminary saliency value optimization coefficient, a spatial weight map can be generated that can accurately reflect the possibility that the pixel point belongs to a real crack.
[0048] S103, calculating the final saliency value of each pixel based on the preliminary saliency value optimization coefficient and the preliminary saliency value of each pixel obtained by the saliency detection algorithm: In an optional embodiment, the larger the optimization coefficient of the preliminary saliency value of each pixel point, the greater the possibility that the pixel point belongs to the potential crack defect area on the surface of the welded spherical tank shell. Therefore, in order to more accurately classify the pixel point as the potential crack defect area on the surface of the welded spherical tank shell, the final saliency value of the pixel point needs to be larger. Therefore, the final saliency value of the pixel point after optimization should be larger. Based on this, the final saliency value of the pixel point satisfies the relationship:
[0049] In the formula represents the final saliency value of the i-th pixel, represents the initial saliency optimization coefficient of the i-th pixel, Represents the preliminary saliency value of the i-th pixel, which can be calculated according to the existing steps of the saliency detection FT algorithm. Figure 5 As shown in Figure 2, it is a visualization diagram of the preliminary significance values obtained, where both cracks and welds have high significance.
[0050] In this optional embodiment, if Figure 6 As shown in the figure, it is a visualization diagram of the final significant value calculated, which is consistent with Figure 5 In comparison, the brightness of the weld area is greatly reduced, while the brightness of the crack area is maintained.
[0051] In this way, by multiplying the optimization coefficient with the preliminary significance value, the discrimination between the target crack and the interference weld is effectively improved.
[0052] S104, determining the crack defect area in the penetration test image according to the final saliency value, so as to realize defect extraction of the penetration test image of the welded spherical tank connection shell.
[0053] In one embodiment, after obtaining a visualization diagram of the final saliency value, defect extraction will be simpler. At this time, each pixel point in the penetration detection image can be traversed. If the final saliency value of the pixel point is greater than the preset judgment threshold, the pixel point is determined to be a defective pixel point belonging to the crack defect area.
[0054] Furthermore, the preset judgment threshold can be exemplarily 0.9, and the threshold can also be set by an adaptive threshold method such as Otsu. Finally, all the pixels marked as defects together constitute the final extracted crack defect area.
[0055] In this way, the crack defect area can be extracted efficiently and accurately by performing simple threshold segmentation on the optimized final saliency value map.
[0056] It should be noted that a person skilled in the art may make a number of modifications and improvements without departing from the concept of the present application, and these modifications and improvements are all within the scope of protection of the present application. Therefore, the scope of protection of the patent application shall be based on the appended claims.
Claims
1. A defect extraction method for welded spherical tank shell penetration inspection images, characterized in that: include: Collecting penetration test images of welded spherical tank connection shells and preprocessing the penetration test images; Calculating a preliminary saliency value optimization coefficient of each pixel in the penetration detection image based on the color characteristics and texture characteristics of the penetration detection image; Calculating a final saliency value for each pixel based on the preliminary saliency value optimization coefficient and the preliminary saliency value of each pixel obtained by the saliency detection algorithm; The crack defect area in the penetration test image is determined according to the final significance value, so as to realize defect extraction of the penetration test image of the welded spherical tank connection shell.
2. The defect extraction method of the welded spherical tank shell penetration inspection image according to claim 1 is characterized in that: The calculating of the preliminary saliency value optimization coefficient of each pixel in the penetration detection image includes: The color prominence factor of each pixel is calculated based on the difference between the RGB channel value of each pixel and the average RGB channel value of all pixels in the image, as well as the sum of the RGB three channel values of each pixel; According to the texture features of each pixel in the grayscale image and the color prominence factor, a preliminary saliency value optimization coefficient of each pixel is calculated.
3. The defect extraction method of the welded spherical tank shell penetration test image according to claim 2 is characterized in that: The color prominence factor satisfies the relationship: In the formula represents the color prominence factor of the i-th pixel, 、 、 Respectively represent the absolute value of the difference between the R channel value, G channel value, and B channel value of the i-th pixel and the mean R channel value, G channel value, and B channel value of all pixels in the image, Represents the sum of the R, G, and B channel values of the i-th pixel. is a hyperparameter used to prevent The value is 0. is the normalization function.
4. The defect extraction method for the penetration test image of the welded spherical tank connection shell according to claim 2 is characterized in that: The calculation of the preliminary saliency value optimization coefficient of each pixel point based on the texture feature of each pixel point in the grayscale image and the color prominence factor includes: Grayscale processing is performed on the penetration detection image, and edge detection operators are used to obtain edge pixel points; A reference area is constructed with each pixel as the center, and the chain code technology is used to obtain the chain code value of the edge pixel points in each reference area; The preliminary saliency value optimization coefficient of each pixel point is calculated based on the chain code value change, gradient amplitude extreme difference and the color prominence factor of the edge pixel points in each reference area.
5. The defect extraction method of the welded spherical tank shell penetration test image according to claim 4 is characterized in that: The preliminary significant value optimization coefficient satisfies the relationship: In the formula represents the initial saliency optimization coefficient of the i-th pixel, represents the color prominence factor of the i-th pixel, Indicates the number of edge pixels within a pixel reference area. It represents the average value of the absolute value of the difference between the u-th edge pixel and its two adjacent edge pixels in the reference area of the i-th pixel with respect to the chain code value. Represents the extreme difference of the gradient amplitude of all edge pixels in the reference area of the i-th pixel. The value range adjustment coefficient of the preliminary saliency value optimization coefficient of a pixel point.
6. The defect extraction method of the welded spherical tank shell penetration test image according to claim 1 is characterized in that: The final significance value satisfies the relationship: In the formula represents the final saliency value of the i-th pixel, represents the initial saliency optimization coefficient of the i-th pixel, Represents the preliminary saliency value of the i-th pixel.
7. The defect extraction method for a welded spherical tank shell penetration test image according to claim 1 is characterized in that: The process of determining the crack defect area in the penetration detection image based on the final saliency value is to traverse each pixel point in the penetration detection image. If the final saliency value of the pixel point is greater than the preset judgment threshold, the pixel point is determined to be a defective pixel point belonging to the crack defect area.
8. The defect extraction method for a welded spherical tank shell penetration test image according to claim 1 is characterized in that: The method of preprocessing the penetration detection image is to convert the penetration detection image from RGB color space to Lab color space, and to grayscale the penetration detection image to obtain a grayscale image.
Citation Information
Patent Citations
Saliency detection-based surface crack identification method
CN107256547A
Metal washbasin defect rapid detection method based on computer vision
CN116758083A
Lithium-battery weld seam defect detection method and system, and storage medium
WO2024239719A1
Cited By
Road surface disease high-precision inspection device and method based on unmanned aerial vehicle
CN121599958A