A method and system for segmenting punctate defects in X-ray circumferential weld images

By constructing energy functions and differential equation systems, the dot-like defective pixel points in the X-ray ring weld image are directly obtained, solving the problems of complex threshold calculations and noise interference in the prior art, and achieving fast and accurate dot-like defect segmentation.

CN116228622BActive Publication Date: 2025-07-29CHINA PETROLEUM & CHEMICAL CORP +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111458950.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-02
Publication Date
2025-07-29
Estimated Expiration
2041-12-02

AI Technical Summary

Technical Problem

In the prior art, the detection of dot-shaped defects in X-ray weld images requires the calculation of threshold values, the process is complex and difficult to accurately segment, and the dot-shaped defects are similar to noise, resulting in inaccurate segmentation results.

Method used

By constructing a unified analytical formula to represent image features of point-shaped defects, using the differential equation system solution method to directly obtain defective pixel points, constructing the energy function E=E1+E2+E3+E4, constraining the uniqueness, adjacent, grayscale values consistency and less than the average grayscale value, and using the Euler method to solve the differential equation system to determine the pixel point type.

Benefits of technology

It realizes fast and accurate point-shaped defect segmentation, can filter out noise influence, has high rationality in segmentation results, and is suitable for program implementation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116228622B_ABST
    Figure CN116228622B_ABST
Patent Text Reader

Abstract

The present invention provides a method for segmenting dot-like defects in X-ray circumferential weld images, belonging to the technical field of X-ray weld defect detection. The technical solution is as follows: A method for segmenting dot-like defects in X-ray circumferential weld images scans the X-ray circumferential weld images to obtain the gray values of pixel points. The energy function is used to determine whether a pixel point belongs to a dot-like defect. Among them, the second part of the energy function is used to achieve the minimum area constraint of the defect, which can filter out the influence brought by noise. By solving the differential equation, the set of dot-like defect pixel points in the X-ray circumferential weld image is directly obtained, and then the segmentation of the dot-like defect is completed through highlighting. The beneficial effects of the present invention are as follows: The present invention proposes a new energy function. By solving the differential equation, the energy function can be reduced to the lowest value. The solution when the energy function obtained by solving the differential equation is the lowest can ensure the rationality of the solution and also make the segmentation result accurate, facilitating fast calculation.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of X-ray weld defect detection, and particularly to a method for segmenting punctiform defects in X-ray circumferential weld images. Background Art

[0002] Currently, among the defects in X-ray weld images, more than 80% are punctiform defects. The existing automatic detection of punctiform defects needs to use the method of threshold segmentation to judge punctiform defects. However, images with different imaging qualities require different thresholds, and the determination process of the threshold is complex and difficult to be accurate. At the same time, due to the high similarity between punctiform defects and noise, the segmented results are prone to the coexistence of noise and punctiform defects. Currently, there is still a lack of a method for quickly segmenting punctiform defects without calculating the threshold. Summary of the Invention

[0003] Aiming at the above problems in the prior art, the purpose of the present invention is to provide a method for segmenting punctiform defects in X-ray circumferential weld images, which uses a unified analytical formula to represent the image features of punctiform defects and directly obtains the defective pixel points in the X-ray circumferential weld image by solving a system of differential equations.

[0004] The present invention is realized by the following technical solutions: A method for segmenting punctiform defects in X-ray circumferential weld images includes the following steps:

[0005] S1. Obtain an X-ray circumferential weld image, where the width of the X-ray circumferential weld image is M pixel points and the height is N pixel points;

[0006] S2. Scan the image row by row in the X-ray circumferential weld image, obtain the gray value of each pixel point, and number the pixel points from 1 to M×N in the scanning order; Define the gray value variable q n , representing the gray value of the nth pixel point, where 1≤n≤M×N;

[0007] S3. Define the pixel point position relationship variable c np , representing the position relationship between the nth and the pth pixel points. If they are adjacent, c np is 1, and if not adjacent, it is 0, where 1≤n≤M×N, 1≤p≤M×N, and n≠p;

[0008] S4. Calculate the average gray value ave of all pixel points in the X-ray circumferential weld image,

[0009]

[0010] S5. Define the pixel point type determination element v in , where i = 1 or 2, 1≤n≤M×N; It means that the type of the nth pixel point is jointly determined by two determination elements, specifically as follows:

[0011] Create a table to characterize whether a pixel is a point defect, as shown below:

[0012] Table 1 Pixel type table

[0013] <![CDATA[q1]]> … <![CDATA[q n > … <![CDATA[q N×M > 1 <![CDATA[v 11 > … <![CDATA[v 1n > … <![CDATA[v 1,N×M > 2 <![CDATA[v 21 > … <![CDATA[v 2n > … <![CDATA[v 2,N×M >

[0014] In Table 1, q1~q N×M is N×M pixels, v in It is the pixel type determination element, representing q n Whether it is a defect is defined as follows:

[0015]

[0016]

[0017] Only when v 1n =1, and v 2n =0, the nth pixel is a defective point;

[0018] S6. Construct an energy function E=E1+E2+E3+E4 based on the variables and parameters in S1 to S5. The energy function as a whole can represent the image characteristics of point defects in the X-ray ring weld image. The overall analytical expression of the energy function is composed of four sub-analytical expressions. The first analytical expression constrains the type of each pixel to be unique. The second analytical expression constrains the pixels constituting the point defect to be adjacent. The third analytical expression constrains the consistency of the grayscale values of the pixels constituting the defect. The fourth analytical expression constrains the grayscale value of the pixels constituting the defect to be less than the average grayscale value of the overall image.

[0019] S7. Construct differential equations: Among them, u in is an intermediate variable;

[0020] Determine the type judgment element v corresponding to each pixel by solving the differential equation group in The value of

[0021] S8, all v 1n =1 and v 2n = 0 n The corresponding pixel points constitute a pixel point set, which is the point defect of the X-ray girth weld image. The point defect of the X-ray girth weld image is segmented by highlighting it in the X-ray girth weld image.

[0022] Furthermore, the position of a pixel in the X-ray ring weld image is represented by the two-dimensional coordinate (i, j), 1≤i≤N, 1≤j≤M, and the gray value variable g is defined as ij, representing the grayscale value of the pixel point (i, j); then the two grayscale value variables q n and g ij have the following corresponding relationship:

[0023]

[0024] Among them,

[0025] int() is the integer-taking function, and mod() is the remainder-taking function.

[0026] Furthermore, the pixel point position relationship variable c np is specifically:

[0027]

[0028] Among them, abs() is the absolute value-taking function; it can be seen from Equation (2) that whether the two pixel points are adjacent in the width direction or the length direction, the pixel point position relationship variable c np is all 1.

[0029] Furthermore, the energy function E is specifically:

[0030]

[0031] Among them, E is represented by the energy function value, and the four analytical expressions included respectively correspond to E1 to E4 in sequence. e1 to e4 are coefficients greater than 0, i, n, o, p are all serial numbers, q n and q p are both pixel point position variables, respectively representing the grayscale values of the nth and pth pixel points scanned and sorted according to the row-major principle. α represents the minimum number of pixel points required to form a dot defect, β represents the maximum grayscale value difference of the pixel points forming the dot defect, and Δ is the normalization coefficient, Δ ≤ 0.001.

[0032] Furthermore, the method for solving the differential equation system is specifically:

[0033] S71. From Equation (5) and Equation (6), it can be obtained that the dynamic equation for solving Equation (5) is:

[0034]

[0035] Among them, u v is the normalization coefficient, u v ≤ 0.001;

[0036] S72. Using the Euler method to solve Equation (7), the values of the type determination element v in corresponding to each pixel point in the X-ray circumferential weld image in Table 1 can be obtained, v inSelect an element for the pixel type, representing q n Whether it is a defect is defined as follows: v 1n When v = 1, it represents q n as a defect, v 1n When v = 0, it represents q n not a defect, v 2n When v = 1, it represents q n not a defect, v 2n When v = 0, it represents q n as a defect.

[0037] Preferably, α = 5. Substituting it into the second analytical formula, it is required that the pixel points constituting the punctiform defect should be continuously adjacent, and the area of the punctiform defect is at least the area of 5 pixel points. This item can also effectively prevent mis-segmentation caused by salt-and-pepper noise.

[0038] Preferably, β = 4. Substituting it into the third analytical formula, it is required that the gray value difference between the pixel points constituting the punctiform defect does not exceed 4. Because the image statistics of X-ray circumferential welds show that the maximum gray value difference between the pixel points in the punctiform defect is 4.

[0039] The present invention constructs an energy function and uses a unified analytical formula to represent the image features of punctiform defects. Therefore, the defect pixel points in the X-ray circumferential weld image can be directly obtained by solving the differential equation system; the process of solving the differential equation system itself is a process of reducing the energy function along the gradient direction to the minimum value; by solving the differential equation, the energy function can be reduced to the lowest value, and the solution obtained at this time is the optimal or approximately optimal analytical solution.

[0040] The special feature of the energy function E constructed by the present invention is that: only when the obtained solution is reasonable and feasible, the analytical expression corresponding to the constraint term of the defect pixel points with approximately equal area and gray value of the mutually connected punctiform defect pixel points can be 0; after each pixel point is uniquely determined to belong to a defect or non-defect, the energy function can be minimized; the analytical expression can be 0 when the constraint that the gray value of the pixel points marked as defects is less than the average gray value of the image is satisfied; therefore, the solution when the energy function obtained by solving the differential equation is the lowest can ensure the rationality of the solution and the accuracy of the segmentation result, and is convenient for quick calculation; the proposed method is suitable for program implementation and has been actually verified, providing a new scientific idea for the solution of punctiform defect segmentation of X-ray circumferential welds.

[0041] A punctiform defect segmentation system for X-ray circumferential weld images includes: an image scanning and preprocessing module for scanning the X-ray circumferential weld image to obtain the gray values of each pixel point of the X-ray circumferential weld image; a processing module for constructing the energy function E and obtaining the pixel point set by solving the differential equation system; a display module for highlighting the punctiform defects corresponding to the pixel set.

[0042] Furthermore, the energy function \(E = E_1+E_2+E_3+E_4\). The overall energy function can represent the image features of the punctiform defects in the X-ray circumferential weld image. The overall analytical formula of the energy function consists of four sub-analytical formulas. The first sub-analytical formula constrains that the type of each pixel point is unique. The second sub-analytical formula constrains that the pixel points constituting the defect should be adjacent. The third sub-analytical formula constrains the consistency of the gray values of the pixel points constituting the defect. The fourth sub-analytical formula constrains that the gray value of the pixel points constituting the defect should be less than the average gray value of the overall image.

[0043] The beneficial effects of the present invention are as follows: The present invention proposes a new energy function to determine whether a pixel point belongs to a punctiform defect. Among them, the minimum area constraint of the defect is realized through the second part of the energy function, which can filter out the influence brought by noise. By solving the differential equation, the set of punctiform defect pixel points in the X-ray circumferential weld image is directly obtained. By solving the differential equation, the energy function can be reduced to the lowest value. The solution when the energy function obtained by solving the differential equation is the lowest can ensure the rationality of the solution and also make the segmentation result accurate, facilitating fast calculation. BRIEF DESCRIPTION OF THE DRAWINGS

[0044] Figure 1 is the flowchart of the method of the present invention;

[0045] Figure 2 is the original X-ray circumferential weld image of Example 2;

[0046] Figure 3 is the punctiform defect segmentation diagram of the X-ray circumferential weld image of Example 2;

[0047] Figure 4 is the original X-ray circumferential weld image of Example 3;

[0048] Figure 5 is the punctiform defect segmentation diagram of the X-ray circumferential weld image of Example 3. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0049] To clearly illustrate the technical features of the present solution, the present solution will be described below through specific embodiments.

[0050] As Figure 1 shown, in Example 1, the present invention is implemented through the following technical solution: A method for segmenting punctiform defects in an X-ray circumferential weld image includes the following steps:

[0051] S1. Obtain an X-ray circumferential weld image, where the width of the X-ray circumferential weld image is \(M\) pixel points and the height is \(N\) pixel points;

[0052] S2. Scan the X-ray circumferential weld image line by line in row-major order, obtain the gray value of each pixel point, and number the pixel points from 1 to M×N in the scanning order; define the gray value variable q n , representing the gray value of the nth pixel point, where 1 ≤ n ≤ M×N; represent the position of a pixel point in the X-ray circumferential weld image with two-dimensional coordinates (i, j), 1 ≤ i ≤ N, 1 ≤ j ≤ M, and define the gray value variable g ij , representing the gray value of the pixel point (i, j); then the corresponding relationship between the two gray value variables q n and g ij is as follows:

[0053]

[0054] Among them,

[0055] int() is the integer-taking function, and mod() is the remainder-taking function;

[0056] S3. Define the pixel point position relationship variable c np , representing the position relationship between the nth and the pth pixel points. If they are adjacent, c np is 1, and if not adjacent, it is 0, where 1 ≤ n ≤ M×N, 1 ≤ p ≤ M×N, and n ≠ p;

[0057] The pixel point position relationship variable c np is specifically:

[0058]

[0059] Among them, abs() is the absolute value-taking function; it can be seen from formula (2) that whether two pixel points are adjacent in the width direction or in the length direction, the pixel point position relationship variable c np is all 1;

[0060] S4. Calculate the average gray value ave of all pixel points in the X-ray circumferential weld image,

[0061]

[0062] S5. Define the pixel point type determination element v in , where i = 1 or 2, 1 ≤ n ≤ M×N; it means that the type of the nth pixel point is jointly determined by two determination elements, specifically as follows:

[0063] Establish a table representing whether a pixel point is a punctiform defect, as follows:

[0064] Table 1 Pixel Point Type Table

[0065] <![CDATA[q1]]> … <![CDATA[q n > … <![CDATA[q N× M]]> 1 <![CDATA[v 11 > … <![CDATA[v 1n > … <![CDATA[v 1,N×M > 2 <![CDATA[v 21 > … <![CDATA[v 2n > … <![CDATA[v 2,N×M >

[0066] In Table 1, q1 to q N×M are N×M pixel points, and v in is a pixel point type determination element, representing whether q n is a defect, and is defined as follows:

[0067]

[0068]

[0069] Among them, only when v 1n = 1 and v 2n = 0, the nth pixel point is a defective point;

[0070] S6. Construct an energy function E = E1 + E2 + E3 + E4 based on the variables and parameters in S1 to S5. The overall energy function can represent the image features of the punctiform defects in the X-ray circumferential weld image. The overall analytical formula of the energy function consists of four sub-analytical formulas. The first sub-analytical formula restricts that the type of each pixel point is unique. The second sub-analytical formula restricts that the pixel points constituting the punctiform defect should be adjacent. The third sub-analytical formula restricts the consistency of the gray values of the pixel points constituting the defect. The fourth sub-analytical formula restricts that the gray value of the pixel points constituting the defect should be less than the average gray value of the overall image; The specific energy function E is:

[0071]

[0072] Among them, E represents the energy function value, and the four analytical formulas included respectively correspond to E1 to E4 in sequence. e1 to e4 are coefficients greater than 0. i, n, o, and p are all serial numbers. q n and q p are both pixel point position variables, representing the gray values of the nth and pth pixel points scanned and sorted according to the row priority principle respectively. α represents the minimum number of pixel points required to form a punctiform defect. β represents the maximum difference in gray values of the pixel points constituting the punctiform defect. Δ is a normalization coefficient, and Δ ≤ 0.001;

[0073] S7. Construct a differential equation: Among them, u in is an intermediate variable;

[0074] Determine the value of the type determination element v in corresponding to each pixel point by solving the differential equation system; specifically:

[0075] S71. From Equation (5) and Equation (6), it can be obtained that the dynamic equation for solving Equation (5) is:

[0076]

[0077] Among them, u v is the normalization coefficient, u v ≤0.001;

[0078] S72. Solve equation (7) using the Euler method to obtain the type determination element v corresponding to each pixel point in the X-ray girth weld image in Table 1. in The value of v in Select elements for pixel type, representing q n Is it a defect? It is defined as follows: 1n =1 represents q n For defects, v 1n = 0 represents q n Not a defect; v 2n =1 represents q n Not a defect, v 2n = 0 represents q n for defects;

[0079] Preferably, α=5. Substituting into the second analytical expression, the pixels constituting the point defect should be continuous and adjacent, and the area of the point defect should be at least the area of 5 pixels. This term can also effectively prevent missegmentation caused by salt and pepper noise.

[0080] Preferably, β=4. Substituting into the third analytical expression, the grayscale value difference between the pixels constituting the point defect is constrained to not exceed 4, because the image statistics of the X-ray girth weld show that the maximum grayscale value difference between the pixels in the point defect is 4.

[0081] S8, all v 1n =1 and v 2n = 0 n The corresponding pixel points constitute a pixel point set, which is the point defect of the X-ray girth weld image. The point defect of the X-ray girth weld image is segmented by highlighting it in the X-ray girth weld image.

[0082] Example 2, as Figure 2 As shown, Figure 2 The X-ray image of a girth weld with point defects where N=120 and M=57 is used; the method of the present invention comprises the following steps:

[0083] S1. Acquire an X-ray girth weld image, where the X-ray girth weld image has a width of 57 pixels and a height of 120 pixels;

[0084] S2. Scan the X-ray girth weld image line by line, and obtain the grayscale value of each pixel. Then, sort and number the pixels from 1 to 120×57 according to the scanning order; define the grayscale value variable q n, representing the gray value of the nth pixel point, where 1 ≤ n ≤ 120 × 57;

[0085] The position of a pixel point in the X-ray circumferential weld image is represented by two-dimensional coordinates (i, j), where 1 ≤ i ≤ 120 and 1 ≤ j ≤ 57. Define the gray value variable g ij , representing the gray value of the pixel point (i, j); then the two gray value variables q n and g ij have the following corresponding relationship:

[0086]

[0087] Among them,

[0088] int() is the integer-taking function, and mod() is the remainder-taking function;

[0089] S3. Define the pixel point position relationship variable c np , representing the position relationship between the nth and pth pixel points. If they are adjacent, c np is 1; if not adjacent, it is 0, where 1 ≤ n ≤ 120 × 57, 1 ≤ p ≤ 120 × 57, and n ≠ p;

[0090] The pixel point position relationship variable c np is specifically:

[0091]

[0092] Among them, abs() is the absolute value-taking function; it can be seen from Equation (2) that whether two pixel points are adjacent in the width direction or the length direction, the pixel point position relationship variable c np is 1;

[0093] S4. Calculate the average gray value ave of all pixel points in the X-ray circumferential weld image,

[0094]

[0095] S5. Define the pixel point type determination element v in , where i = 1 or 2, and 1 ≤ n ≤ 120 × 57; it means that the type of the nth pixel point is jointly determined by two determination elements, specifically as follows:

[0096] Establish a table representing whether a pixel point is a punctiform defect, as follows:

[0097] Table 1 Pixel Point Type Table

[0098] <![CDATA[q1]]> … <![CDATA[q n > … <![CDATA[q 120×57 > 1 <![CDATA[v 11 > … <![CDATA[v 1n > … <![CDATA[v 1,120×57 > 2 <![CDATA[v 21 > … <![CDATA[v 2n > … <![CDATA[v 2,120×57 >

[0099] In Table 1, q1 to q 120×57It is 120×57 pixels, v in is a pixel type determination element, representing q n Whether it is a defect is defined as follows:

[0100]

[0101]

[0102] Among them, only when v 1n = 1 and v 2n = 0, the nth pixel is a defective pixel;

[0103] S6. Construct an energy function E = E1 + E2 + E3 + E4 based on the variables and parameters in S1 to S5. The overall energy function can represent the image characteristics of the punctiform defects in the X-ray circumferential weld image. The overall analytical formula of the energy function consists of four sub-analytical formulas. The first sub-analytical formula restricts the uniqueness of the type of each pixel. The second sub-analytical formula restricts that the pixels constituting the punctiform defect should be adjacent. The third sub-analytical formula restricts the consistency of the gray values of the pixels constituting the defect. The fourth sub-analytical formula restricts that the gray value of the pixels constituting the defect should be less than the average gray value of the overall image;

[0104] The specific form of the energy function E is as follows:

[0105]

[0106] Among them, E represents the energy function value. The four analytical formulas included correspond to E1 to E4 in sequence. e1 to e4 are coefficients greater than 0. i, n, o, and p are all sequence numbers. q n and q p are both pixel position variables, representing the gray values of the nth and pth pixels scanned and sorted according to the row priority principle respectively. α represents the minimum number of pixels required to form a punctiform defect. β represents the maximum difference in gray values of the pixels constituting the punctiform defect. Δ is a normalization coefficient, and Δ ≤ 0.001;

[0107] S7. Construct a differential equation: Among them, u in is an intermediate variable;

[0108] Determine the value of the type determination element v in corresponding to each pixel by solving the differential equation system; The method for solving the differential equation system is specifically as follows:

[0109] S71. From Equation (5) and Equation (6), it can be obtained that the dynamic equation for solving Equation (5) is:

[0110]

[0111] Among them, u v is a normalization coefficient, and u v ≤0.001;

[0112] S72. Solve Equation (7) using the Euler method, and fill in the values of the type determination element v in corresponding to each pixel point in the X-ray circumferential weld image into Table 1 to obtain Table 2 as follows:

[0113] <![CDATA[q1]]> … <![CDATA[q 2537 > <![CDATA[q 2538 > <![CDATA[q 2539 > … <![CDATA[q 6840 > 1 0 … 1 1 1 … 0 2 1 … 0 0 0 … 1

[0114] v in is the pixel point type selection element, which characterizes whether q n is a defect, and is defined as follows: when v 1n = 1, it characterizes that q n is a defect; when v 1n = 0, it characterizes that q n is not a defect. When v 2n = 1, it characterizes that q n is not a defect; when v 2n = 0, it characterizes that q n is a defect;

[0115] S8. Form a pixel point set from all the pixel points corresponding to q 1n where v 2n = 1 and v n = 0. The pixel point set is the punctiform defect in the X-ray circumferential weld image. By highlighting it in the X-ray circumferential weld image, the segmentation of the punctiform defect in the X-ray circumferential weld image is completed, as shown in Figure 3 shown.

[0116] Example 3, as shown in Figure 4 shown, Figure 4 is an X-ray circumferential weld image with a punctiform defect where N = 117 and M = 59; according to the method of Example 1, after substituting the data, finally, Figure 5 ---The segmentation diagram of the punctiform defect in the X-ray circumferential weld image can be obtained.

[0117] Through Example 2 and Example 3, it can be clearly seen that the method can achieve pixel-level accurate recognition in segmenting the punctiform defect in the X-ray circumferential weld image and has good application prospects in engineering applications.

[0118] There is little difference between the hardware and software implementations of various aspects of the system; the use of hardware or software is generally (but not always, as the choice between hardware and software may become important in certain scenarios) a design choice representing a cost - efficiency trade - off. There are various means (e.g., hardware, software, and / or firmware) by which the processes and / or systems and / or other technologies described herein can be implemented, and the preferred means will vary with the scenario in which the processes and / or systems and / or other technologies are deployed. For example, if the implementer determines that speed and accuracy are of utmost importance, then the implementer may choose means that are primarily hardware and / or firmware; if flexibility is of utmost importance, then the implementer may choose an implementation that is primarily software; or, alternatively but equally, the implementer may choose a certain combination of hardware, software, and / or firmware.

[0119] The terms "first", "second", etc. are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the quantity of the indicated technical features. Thus, features defined with "first", "second", etc. may explicitly or implicitly include one or more of such features. In the description of the present invention, unless otherwise specified, the meaning of "a plurality" is two or more.

[0120] The technical features not described in the present invention can be realized by or adopted from the prior art and will not be elaborated here. Of course, the above description is not a limitation of the present invention, and the present invention is not limited to the above examples. Changes, modifications, additions, or substitutions made by those of ordinary skill in the art within the scope of the essence of the present invention should also fall within the protection scope of the present invention.

Claims

1. A method for segmenting dot-like defects in X-ray circumferential weld images, characterized in that, Including the following steps: S1. Obtain an X-ray circumferential weld image, where the width of the X-ray circumferential weld image is M pixel points and the height is N pixel points; S2. Scan the X-ray circumferential weld image line by line in row-major order, obtain the gray value of each pixel point, and sort and number the pixel points from 1 to M×N in the scanning order; define the gray value variable q n , representing the gray value of the nth pixel point, where 1 ≤ n ≤ M×N; S3. Define the pixel position relationship variable c np , representing the position relationship between the nth and pth pixels. If they are adjacent, c np is 1; if not, it is 0, where 1 ≤ n ≤ M × N, 1 ≤ p ≤ M × N, and n ≠ p; S4. Calculate the average gray value ave of all pixel points in the X-ray circumferential weld image; S5. Define the pixel type determination element v in , where i = 1 or 2, 1 ≤ n ≤ M × N; it means that the type of the nth pixel is jointly determined by two determination elements, specifically as follows: where only when v 1n = 1 and v 2n = 0, the nth pixel is a defective pixel; S6. Construct an energy function E = E1 + E2 + E3 + E4 based on the variables and parameters in S1 - S5. The overall energy function can represent the image features of the punctiform defects in the X-ray circumferential weld image. The overall analytical formula of the energy function consists of four sub-analytical formulas. The first sub-analytical formula restricts that the type of each pixel point is unique. The second sub-analytical formula restricts that the pixel points constituting the punctiform defects should be adjacent. The third sub-analytical formula restricts the consistency of the gray values of the pixel points constituting the defects. The fourth sub-analytical formula restricts that the gray values of the pixel points constituting the defects should be less than the average gray value of the overall image; S7. Construct a differential equation: where u in is an intermediate variable; Determine the type determination element v corresponding to each pixel point by solving the differential equation system in value; S8, all v 1n =1 and v 2n = 0 n The corresponding pixel points constitute a pixel point set, which is the point defect of the X-ray girth weld image. The point defect of the X-ray girth weld image is segmented by highlighting it in the X-ray girth weld image.

2. The method for segmenting punctiform defects in X-ray circumferential weld images according to claim 1, wherein The position of a pixel in the X-ray circumferential weld image is represented by two-dimensional coordinates (i, j), where 1 ≤ i ≤ N and 1 ≤ j ≤ M, and the gray value variable g is defined. ij represents the gray value of the pixel (i, j); Then the two grayscale value variables q n and g ij have the following corresponding relationship: Among them, int() is an integer-taking function, and mod() is a remainder-taking function.

3. The method for segmenting punctate defects in X-ray circumferential weld images according to claim 2, wherein The pixel position relationship variable c np Specifically: Among them, abs() is an absolute value-taking function.

4. The method for segmenting dot-like defects in X-ray circumferential weld images according to claim 3, characterized in that, The energy function E is specifically: Among them, E is represented by the energy function value, and the four analytical expressions included respectively correspond to E1 to E4 in sequence. e1 to e4 are coefficients greater than 0. i, n, o, and p are all sequence numbers, and q n and q p are both pixel position variables, representing the gray values of the nth and pth pixel points scanned and sorted according to the row priority principle respectively. α represents the minimum number of pixel points required to form a dot-like defect, β represents the maximum gray value difference of the pixel points forming a dot-like defect, Δ is a normalization coefficient, and Δ ≤ 0.

001.

5. The method for segmenting dot-like defects in X-ray circumferential weld images according to claim 4, wherein, The method for solving the differential equation system is specifically: S71. From Equation (5) and Equation (6), it can be obtained that the dynamic equation for solving Equation (5) is: where u v is a normalization coefficient, and u v ≤ 0.001; By using the Euler method to solve equation (7), the type determination element v corresponding to each pixel point in the X-ray circumferential weld image can be obtained. in value.

6. The method for segmenting punctate defects in X-ray circumferential weld images according to claim 5, wherein ,α=5。 7. The method for segmenting dot-like defects in X-ray circumferential weld images according to claim 5, characterized in that ,β=4。 8. An X-ray circumferential weld image punctiform defect segmentation system for implementing the X-ray circumferential weld image punctiform defect segmentation method according to any one of claims 1-7, characterized in that, Including: An image scanning and preprocessing module, which is used to scan the X-ray circumferential weld image to obtain the gray values of each pixel point of the X-ray circumferential weld image; a processing module, which is used to construct the energy function E and obtain the set of pixel points by solving the differential equation system; A display module, which is used to highlight the punctiform defects corresponding to the set of pixel points.

9. The X-ray circumferential weld image dot defect segmentation system according to claim 8, characterized in that, The energy function E = E1 + E2 + E3 + E4. The overall energy function can represent the image features of the punctiform defects in the X-ray circumferential weld image. The overall analytical formula of the energy function consists of four sub-analytical formulas. The first sub-analytical formula restricts that the type of each pixel point is unique. The second sub-analytical formula restricts that the pixel points constituting the defects should be adjacent. The third sub-analytical formula restricts the consistency of the gray values of the pixel points constituting the defects. The fourth sub-analytical formula restricts that the gray values of the pixel points constituting the defects should be less than the average gray value of the overall image.

Citation Information

Patent Citations

  • Weld defect characteristic parameter extraction method

    CN105588845A

  • Method and system for optimization of welding, and welding method

    JP2010201474A