Hough transform defect quantitative detection method for ultrasonic C-scan image
Through the Hough transform defect quantitative detection method of ultrasonic C-scan images, using Gaussian filtering and Hough transform technology, the problem of low defect quantitative detection accuracy in ultrasonic C-scan technology is solved, and fast and accurate defect detection is achieved, which is suitable for engineering practice. application.
Patent Information
- Application Number
- CN202411300487.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-18
- Publication Date
- 2024-12-17
AI Technical Summary
The existing ultrasonic C scanning technology has poor accuracy in defect quantitative detection, and the convolutional neural network method is time-consuming and has poor universality, so it cannot be applied to actual engineering detection.
The Hough transform defect quantitative detection method using ultrasonic C-scan image is adopted. By collecting ultrasonic echo data, Gaussian filtering, grayscale histogram processing, edge extraction and Hough transformation are carried out, and the defect is fixed, Positioning and quantitative detection.
It improves the speed and accuracy of defect detection, is suitable for practical engineering applications, has a fast detection speed, high sensitivity to defect recognition, and quantitative detection error is less than 4%.
Smart Images

Figure CN119147649A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of defect quantitative detection, and in particular relates to a Hough transform defect quantitative detection method of an ultrasonic C-scan image. Background Art
[0002] In nondestructive testing, ultrasonic C-scan technology is used to detect and evaluate internal defects, damage or foreign matter in materials, components or structures. It can provide information about the internal structure without destroying or affecting the integrity of the object being tested. The application of ultrasonic C-scan in nondestructive testing is mainly based on the principle of sound wave propagation in materials. An ultrasonic probe is used to send high-frequency sound waves to the object being tested. These sound waves propagate in the material and interact with the defects or interfaces inside the material. When the sound waves encounter these defects or interfaces, part of the sound waves will be reflected back or scattered. By receiving and analyzing these reflected or scattered signals, the type, location, size and other characteristics of the defects can be determined. However, how to quantitatively detect defects faster and more accurately has always been a difficult problem that needs to be challenged in the implementation of this technology in engineering.
[0003] The current ultrasonic C-scan technology has significant effects on defect location and shaping detection, but the quantitative detection accuracy of defect size is poor. In order to improve the accuracy of quantitative detection, most scientific research uses convolutional neural network methods for defect identification and quantitative detection, and the detection results and accuracy are both good. However, training the network takes too long and requires a large number of training sets and data set samples. In addition, when encountering new detection environments or detection objects, the network needs to be retrained. Therefore, the above method is time-consuming and has poor universality, and cannot be applied to actual engineering detection. Summary of the invention
[0004] The problem to be solved by the present invention is to detect defects accurately and quickly, and a Hough transform defect quantitative detection method of ultrasonic C-scan images is proposed.
[0005] To achieve the above object, the present invention is implemented through the following technical solutions:
[0006] A method for quantitatively detecting defects using Hough transform of ultrasonic C-scan images comprises the following steps:
[0007] S1. Collect ultrasonic echo data at each scanning point of the test piece to obtain an ultrasonic C-scan image for standby use;
[0008] S2. The scanning plane of the test piece is evenly divided into N×M scanning positions, where N is the number of equal parts of the width of the scanning plane, and M is the number of equal parts of the length of the scanning plane. Then, the ultrasonic time domain signals at all scanning positions are obtained by using the method of step S1, and placed in an N×M×L three-dimensional data array, where L is the data length of the signal; then, the same time gate position is set for each ultrasonic time domain signal obtained, the defect echo is framed, and the maximum amplitude value within the time gate position is used as the pixel value of the pixel point to form an N×M two-dimensional image for standby use;
[0009] S3. The two-dimensional image obtained in step S2 is subjected to image filtering processing on the pixel values of the area around the pixel point through a Gaussian kernel function, and then the peak signal-to-noise ratio of the two-dimensional image before and after the image filtering processing is calculated to verify the improvement of the image quality;
[0010] S4. Processing the filtered two-dimensional image obtained in step S3 through a grayscale histogram to obtain the grayscale value of each pixel and the total number of pixels, and then calculating the overall average grayscale value of the image; then, traversing the grayscale levels, using the current grayscale level as a threshold, and converting the two-dimensional image into a binary image;
[0011] S5. The binary image obtained in step S4 is subjected to the canny edge algorithm to extract the edge contour of the defect;
[0012] S6. The edge contour image of the defect obtained in step S5 is subjected to Hough transform to fit the defect and output the size of the defect;
[0013] S7. Performing shaping, positioning and quantitative detection on the defects obtained in step S6.
[0014] Furthermore, in step S1, an ultrasonic excitation and acquisition system is used to excite the ultrasonic transducer to generate ultrasonic waves. The ultrasonic waves contact the test piece to generate reflected echoes, which are received by the ultrasonic transducer again. The received analog electrical signals are converted into digital signals through a data acquisition card and input into a host computer to obtain ultrasonic echo data at the scanning point.
[0015] Furthermore, the time gate position set in step S2 is (please give the technical parameter range).
[0016] Furthermore, in step S3, a Gaussian kernel with a convolution kernel size of 3 is used for image filtering. The Gaussian kernel gaus_kernel with a convolution kernel size of 3 is shown in the following formula:
[0017]
[0018] Each element in the Gaussian kernel is calculated by the two-dimensional Gaussian kernel function f(x,y), and the calculation formula is:
[0019]
[0020] Among them, x and y represent the horizontal and vertical coordinates of the Gaussian kernel, and δ is the variance;
[0021] The two-dimensional Gaussian function is a monotonically decreasing function related to distance, so the Gaussian filter tends to favor the weight of the central pixel, that is, the pixel with a shorter distance to the central pixel has a higher weight; δ is the variance, which describes the degree of dispersion of a set of data. For the Gaussian function, the smaller δ is, the clearer the image is, and the larger δ is, the blurrier the image is.
[0022] Furthermore, the calculation formula of the peak signal-to-noise ratio PSNR in step S3 is:
[0023]
[0024] Among them, g(x,y) is the filtered image.
[0025] Furthermore, in step S5, the canny edge algorithm calculates the gradient change value between pixels in the image. The pixel with the largest gradient change is the edge. The calculation method is to use the sobel operator to convolve with each pixel to calculate the gradient size and direction. The sobel operator is shown as follows: G x is the operator in the lateral direction, G y is the operator in the vertical direction;
[0026]
[0027] Further, in step S6, during the Hough transform process, the maximum size, the minimum size, and the scale of the fitting defect in the C-scan image are first determined;
[0028] The specific function of Hough transform is as follows. The function has three inputs, where img represents the C-scan image to be tested, in .jpg or .png format; Rmin represents the minimum size of the fitting defect, and Rmax represents the maximum size of the fitting defect; the function has two outputs, where centers represents the position of the fitting defect, and radii represents the size of the fitting defect, and the expression is:
[0029] [centers,radii]=imfindcircles(img,[Rmin Rmax]).
[0030] Beneficial effects of the present invention:
[0031] The Hough transform defect quantitative detection method for ultrasonic C-scan images described in the present invention introduces the Hough transform, which is widely used in the field of image processing and computer vision, into ultrasonic C-scan defect imaging detection processing. After the C-scan image is subjected to Gaussian filtering, grayscale image, binarization image, and edge contour recognition operations, the pixel points in the image are mapped to the parameter space, thereby converting the straight line detection problem in the complex image space into a peak detection problem in the parameter space. Subsequently, the defects in the image can be found by counting and searching for peaks in the parameter space. Among them, the parameter space can be defined as an arbitrary function, which enables the algorithm to perform fitting analysis on defects of any shape. This method is expected to be applied to improve the quantitative detection level of ultrasonic C-scan detection technology.
[0032] The Hough transform defect quantitative detection method of ultrasonic C-scan images described in the present invention processes the time domain signal graphically, and then uses Hough transform to convert the two-dimensional image into parameter space to calculate the number of peaks, thereby identifying and quantitatively detecting defects; this method has the characteristics of rapid detection speed and high sensitivity to defect identification, and is suitable for application in actual engineering. BRIEF DESCRIPTION OF THE DRAWINGS
[0033] Figure 1 It is a flow chart of a quantitative defect detection method of Hough transform of ultrasonic C-scan images according to the present invention;
[0034] Figure 2 This is a schematic diagram of the ultrasonic signal excitation and acquisition system of the present invention;
[0035] Figure 3 A schematic diagram of selecting a time gate for a time domain signal of the present invention;
[0036] Figure 4 It is a schematic diagram of converting a time domain signal into an N×M two-dimensional image according to the present invention;
[0037] Figure 5 It is the image comparison image before and after Gaussian filtering of the present invention;
[0038] Figure 6 Convert the grayscale image of the present invention into a binary image;
[0039] Figure 7 This is the edge profile result diagram of the present invention;
[0040] Figure 8 This is a defect fitting result diagram of the present invention;
[0041] Fig. 9 It is a bar graph of defect fitting results of the present invention. DETAILED DESCRIPTION
[0042] In order to make the purpose, technical solution and advantages of the present invention more clear, the present invention is further described in detail below in conjunction with the accompanying drawings and specific embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention, that is, the specific embodiments described are only part of the embodiments of the present invention, rather than all of the specific embodiments. The components of the specific embodiments of the present invention described and shown in the drawings herein can be arranged and designed in various different configurations, and the present invention can also have other embodiments.
[0043] Therefore, the following detailed description of the specific embodiments of the present invention provided in the accompanying drawings is not intended to limit the scope of the invention claimed for protection, but merely represents the selected specific embodiments of the present invention. Based on the specific embodiments of the present invention, all other specific embodiments obtained by those skilled in the art without making creative work are within the scope of protection of the present invention.
[0044] In order to further understand the content, features and effects of the present invention, the following specific implementation methods are given as examples, and the attached Figure 1 -Attached Fig. 9 The detailed instructions are as follows: Specific implementation method one:
[0046] A method for quantitatively detecting defects using Hough transform of ultrasonic C-scan images comprises the following steps:
[0047] S1. Collect ultrasonic echo data at each scanning point of the test piece to obtain an ultrasonic C-scan image for standby use;
[0048] Furthermore, in step S1, an ultrasonic excitation acquisition system is used to excite the ultrasonic transducer to generate ultrasonic waves, and the ultrasonic waves contact the test piece to generate reflected echoes, which are received by the ultrasonic transducer again. The received analog electrical signals are converted into digital signals through a data acquisition card and input into a host computer to obtain ultrasonic echo data at the scanning point.
[0049] S2. The scanning plane of the test piece is evenly divided into N×M scanning positions, where N is the number of equal parts of the width of the scanning plane, and M is the number of equal parts of the length of the scanning plane. Then, the ultrasonic time domain signals at all scanning positions are obtained by using the method of step S1, and placed in an N×M×L three-dimensional data array, where L is the data length of the signal; then, the same time gate position is set for each ultrasonic time domain signal obtained, the defect echo is framed, and the maximum amplitude value within the time gate position is used as the pixel value of the pixel point to form an N×M two-dimensional image for standby use;
[0050] Furthermore, the time gate position set in step S2 is centered at the time corresponding to the maximum amplitude of the defect echo, and the left and right boundaries are the time corresponding to the -6dB position of the maximum amplitude of the echo.
[0051] S3. The two-dimensional image obtained in step S2 is subjected to image filtering processing on the pixel values of the area around the pixel point through a Gaussian kernel function, and then the peak signal-to-noise ratio of the two-dimensional image before and after the image filtering processing is calculated to verify the improvement of the image quality;
[0052] Furthermore, in step S3, a Gaussian kernel with a convolution kernel size of 3 is used for image filtering. The Gaussian kernel gaus_kernel with a convolution kernel size of 3 is shown in the following formula:
[0053]
[0054] Each element in the Gaussian kernel is calculated by the two-dimensional Gaussian kernel function f(x,y), and the calculation formula is:
[0055]
[0056] Among them, x and y represent the horizontal and vertical coordinates of the Gaussian kernel, and δ is the variance;
[0057] The two-dimensional Gaussian function is a monotonically decreasing function related to distance, so the Gaussian filter tends to favor the weight of the central pixel, that is, the pixel with a shorter distance to the central pixel has a higher weight; δ is the variance, which describes the degree of dispersion of a set of data. For the Gaussian function, the smaller δ is, the clearer the image is, and the larger δ is, the blurrier the image is.
[0058] Furthermore, the calculation formula of the peak signal-to-noise ratio PSNR in step S3 is:
[0059]
[0060] Among them, g(x,y) is the filtered image.
[0061] S4. Processing the filtered two-dimensional image obtained in step S3 through a grayscale histogram to obtain the grayscale value of each pixel and the total number of pixels, and then calculating the overall average grayscale value of the image; then, traversing the grayscale levels, using the current grayscale level as a threshold, and converting the two-dimensional image into a binary image;
[0062] S5. The binary image obtained in step S4 is subjected to the canny edge algorithm to extract the edge contour of the defect;
[0063] Furthermore, in step S5, the canny edge algorithm calculates the gradient change value between pixels in the image. The pixel with the largest gradient change is the edge. The calculation method is to use the sobel operator to convolve with each pixel to calculate the gradient size and direction. The sobel operator is shown as follows: G x is the operator in the lateral direction, G y is the operator in the longitudinal direction;
[0064]
[0065]
[0066] S6. The edge contour image of the defect obtained in step S5 is subjected to Hough transform to fit the defect and output the size of the defect;
[0067] Further, in step S6, during the Hough transform process, the maximum size, the minimum size, and the scale of the fitting defect in the C-scan image are first determined;
[0068] The specific function of Hough transform is as follows. The function has three inputs, where img represents the C-scan image to be tested, in .jpg or .png format; Rmin represents the minimum size of the fitting defect, and Rmax represents the maximum size of the fitting defect; the function has two outputs, where centers represents the position of the fitting defect, and radii represents the size of the fitting defect, and the expression is:
[0069] [centers,radii]=imfindcircles(img,[Rmin Rmax]).
[0070] S7. Performing shaping, positioning and quantitative detection on the defects obtained in step S6.
[0071] Furthermore, this method is based on image processing technology, and has fast and accurate recognition speed, but its accuracy and sensitivity depend on the quality of the image.
[0072] The following is an explanation with reference to the accompanying drawings:
[0073] like Figure 2 As shown, a function generator is used to generate a signal pulse, which is then amplified by a power amplifier to excite the ultrasonic transducer to excite the ultrasonic signal. At the same time, after the transducer receives the reflected echo signal, it passes through an acquisition card and converts the analog electrical signal into a digital signal and uploads it to the host computer for data storage.
[0074] like Figure 3As shown in the figure, for a one-dimensional ultrasonic reflection echo signal with 5000 data points, after comparing the echo signals with and without defects, the defect echo is selected for time gate selection. In the process of selecting the gate, it is necessary to ensure that the positions of all time domain signal selections are consistent. Finally, the maximum amplitude value is selected in the gate as the pixel value at the scanning position.
[0075] like Figure 4 As shown, the time domain signals received at all scanning points are placed in a three-dimensional data array of N×M×L, and the pixel values are uniformly selected using the time gates with the same position, where N is 1024, M is 512, and L is 5000, forming a 1024×512 two-dimensional image.
[0076] like Figure 5 As shown in FIG. 1 , the M×N image obtained in step S2 is filtered by a Gaussian kernel function. There is no difference in the image performance between the result images before and after filtering. Therefore, the PSNR of the two images is calculated using the pixel values of the images. The results show that the PSNR is significantly improved after filtering, so the imaging quality is improved.
[0077] like Figure 6 As shown in the figure, the filtered C-scan image is converted into a two-dimensional grayscale image, and the threshold is further set to 100, that is, the points with pixel values higher than 100 are uniformly turned into white, and the points with pixel values lower than the threshold are uniformly turned into black, forming Figure 6 The binarized image shown.
[0078] like Figure 7 As shown, the canny algorithm is used to extract the outline of the white part of the binary image, and the Figure 7 The edge contour image shown in Figure 1 is a graph of the edge contours in Figure 1. The principle of this algorithm is to calculate the gradient amplitude and angle. The Sobel operator is used to use convolution to measure the strength and direction of the edge and extract the edge in the image.
[0079] like Figure 8 and Fig. 9 As shown, the edge contour image is subjected to Hough transform. According to the image, it can be seen that the morphological characteristics of the defect are close to a circle, so the parameter space function selected here is a typical circular formula, that is, (xa) 2 +(yb) 2 =r 2 Then, the sensitivity of defect fitting was set to 0.95. The larger the sensitivity setting, the more stringent the algorithm's requirements for defect morphology, and the maximum value was 1. The distance between horizontal pixels was set to 0.13 mm, and the distance between vertical pixels was set to 0.13 mm. The calculation method for these two parameters was to divide the length and width of the actual scanning plane by the rows and columns of the two-dimensional image pixels respectively. Finally, we get Fig. 9 Defect fitting results.
[0080] The algorithm of this embodiment takes 45 seconds from imaging to defect fitting, and can effectively fit the defect morphology, that is, the position, and the quantitative detection error is less than 4%.
[0081] It should be noted that relational terms such as "first" and "second" are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.
[0082] Although the present application has been described above with reference to specific embodiments, various modifications may be made thereto and parts thereof may be replaced with equivalents without departing from the scope of the present application. In particular, as long as there is no structural conflict, the various features in the specific embodiments disclosed in the present application may be used in combination with each other in any manner, and the fact that these combinations are not exhaustively described in this specification is only for the sake of omitting space and saving resources. Therefore, the present application is not limited to the specific embodiments disclosed herein, but includes all technical solutions falling within the scope of the claims.
Claims
1. A quantitative defect detection method of ultrasonic C-scan images using Hough transform, characterized in that: The steps include: S1. Collect ultrasonic echo data at each scanning point of the test piece to obtain an ultrasonic C-scan image for standby use; S2. The scanning plane of the test piece is evenly divided into N×M scanning positions, where N is the number of equal parts of the width of the scanning plane, and M is the number of equal parts of the length of the scanning plane. Then, the ultrasonic time domain signals at all scanning positions are obtained by using the method of step S1, and placed in an N×M×L three-dimensional data array, where L is the data length of the signal; then, the same time gate position is set for each ultrasonic time domain signal obtained, the defect echo is framed, and the maximum amplitude value within the time gate position is used as the pixel value of the pixel point to form an N×M two-dimensional image for standby use; S3. The two-dimensional image obtained in step S2 is subjected to image filtering processing on the pixel values of the area around the pixel point through a Gaussian kernel function, and then the peak signal-to-noise ratio of the two-dimensional image before and after the image filtering processing is calculated to verify the improvement of the image quality; S4. Processing the filtered two-dimensional image obtained in step S3 through a grayscale histogram to obtain the grayscale value of each pixel and the total number of pixels, and then calculating the overall average grayscale value of the image; then, traversing the grayscale levels, using the current grayscale level as a threshold, and converting the two-dimensional image into a binary image; S5. The binary image obtained in step S4 is subjected to the canny edge algorithm to extract the edge contour of the defect; S6. The edge contour image of the defect obtained in step S5 is subjected to Hough transform to fit the defect and output the size of the defect; S7. Performing shaping, positioning and quantitative detection on the defects obtained in step S6.
2. The method for quantitatively detecting defects using Hough transform of ultrasonic C-scan images according to claim 1, characterized in that: In step S1, the ultrasonic excitation acquisition system is used to excite the ultrasonic transducer to generate ultrasonic waves. The ultrasonic waves contact the test piece to generate reflected echoes, which are received by the ultrasonic transducer again. The received analog electrical signals are converted into digital signals through the data acquisition card and input into the host computer to obtain the ultrasonic echo data at the scanning point.
3. The method for quantitatively detecting defects using Hough transform of ultrasonic C-scan images according to claim 1, characterized in that: The time gate position set in step S2 is centered at the time corresponding to the maximum amplitude of the defect echo, and the left and right boundaries are the time corresponding to the -6dB position of the maximum amplitude of the echo.
4. The method for quantitatively detecting defects using Hough transform of ultrasonic C-scan images according to claim 1, characterized in that: In step S3, a Gaussian kernel with a convolution kernel size of 3 is used for image filtering. The Gaussian kernel gaus_kernel with a convolution kernel size of 3 is shown in the following formula: Each element in the Gaussian kernel is calculated by the two-dimensional Gaussian kernel function f(x,y), and the calculation formula is: Among them, x and y represent the horizontal and vertical coordinates of the Gaussian kernel, and δ is the variance; The two-dimensional Gaussian function is a monotonically decreasing function related to distance, so the Gaussian filter tends to favor the weight of the central pixel, that is, the pixel with a shorter distance to the central pixel has a higher weight; δ is the variance, which describes the degree of dispersion of a set of data. For the Gaussian function, the smaller δ is, the clearer the image is, and the larger δ is, the blurrier the image is.
5. The method for quantitatively detecting defects using Hough transform of ultrasonic C-scan images according to claim 4, characterized in that: The calculation formula of the peak signal-to-noise ratio PSNR in step S3 is: Among them, g(x,y) is the filtered image.
6. The method for quantitatively detecting defects using Hough transform of ultrasonic C-scan images according to claim 5, characterized in that: In step S5, the Canny edge algorithm calculates the gradient change value between pixels in the image. The pixel with the largest gradient change is the edge. The calculation method is to use the Sobel operator to convolve with each pixel to calculate the gradient size and direction. The Sobel operator is shown below: G x is the operator in the lateral direction, G y is the operator in the longitudinal direction; 7. The method for quantitatively detecting defects using Hough transform of ultrasonic C-scan images according to claim 6, characterized in that: In step S6, during the Hough transform process, firstly, the maximum size, the minimum size, and the scale of the fitting defect in the C-scan image are determined; The specific function of Hough transform is as follows. The function has three inputs, where img represents the C-scan image to be tested, in .jpg or .png format; Rmin represents the minimum size of the fitting defect, and Rmax represents the maximum size of the fitting defect; the function has two outputs, where centers represents the position of the fitting defect, and radii represents the size of the fitting defect, and the expression is: [centers,radii]=imfindcircles(img,[Rmin Rmax]).
