A pipeline weld identification method and system based on image processing and magnetic flux leakage detection

By combining image processing and magnetic leakage detection technology, texture features are extracted and image segmentation is performed, the problem of the impact of the surface morphology of the traditional magnetic leakage detection method is solved, and more accurate and reliable weld detection is achieved.

CN119131025BActive Publication Date: 2025-02-25广东省特种设备检测研究院茂名检测院
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202411605329.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-11-12
Publication Date
2025-02-25
Estimated Expiration
2044-11-12

AI Technical Summary

Technical Problem

When traditional magnetic leakage detection methods detect pipe welds, due to the influence of the morphology of the weld surface, the detection results are inaccurate, and there is a risk of false alarms or missed inspections.

Method used

Combining image processing technology and magnetic leakage detection technology, by calculating the grayscale symbiosis matrix and spectrum map of the captured image, texture features are extracted, and image segmentation is used by region growth method to obtain the weld area, and then magnetic leakage detection is performed to identify the weld state.

Benefits of technology

Effectively eliminate false signals caused by surface morphology, improve the accuracy and reliability of detection results, enhance the robustness of detection, and accurately identify defect types and locations.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119131025B_ABST
    Figure CN119131025B_ABST
Patent Text Reader

Abstract

The present invention discloses a pipeline weld identification method and system based on image processing and magnetic flux leakage detection, including: calculating the grayscale co-occurrence matrix of the captured image and extracting a plurality of first texture features; calculating the frequency spectrum of the captured image and extracting a plurality of second texture features; each of the first texture features corresponds to a second texture feature; determining a plurality of texture features based on all of the first texture features and all of the second texture features; determining a plurality of seed points based on the plurality of texture features, using the regional growing method to perform image segmentation to obtain a plurality of weld regions; performing magnetic flux leakage detection on the plurality of weld regions of the weld to identify the pipeline weld status. The present invention effectively solves the influence of the weld surface morphology on the detection results in the traditional magnetic flux leakage detection method by combining image processing technology and magnetic flux leakage detection technology, improves the accuracy and reliability of the detection, and also improves the efficiency of the detection.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of pipeline weld detection, and in particular to a pipeline weld identification method and system based on image processing and magnetic flux leakage detection. Background Art

[0002] Traditional magnetic flux leakage detection methods mainly rely on changes in the magnetic field to identify weld defects. However, the morphology of the weld surface (such as unevenness, scratches, coatings, etc.) will affect the distribution of the magnetic field, resulting in inaccurate detection results. Specifically, it manifests as:

[0003] The first is surface unevenness: the unevenness of the weld surface will cause local changes in the magnetic field, causing the detection signal to be distorted. This distortion may be misjudged as a defect signal, resulting in false alarms or missed detections. The second is coating or dirt: the coating or dirt on the weld surface will affect the penetration depth of the magnetic field, causing the detection signal to be weakened or distorted. This will mask the real defect signal and reduce the sensitivity of the detection. The third is the edge effect: the magnetic field change at the edge of the weld may be misjudged as a defect signal, especially when the real defect signal near the edge is weak, the possibility of such misjudgment is higher. Summary of the invention

[0004] The embodiment of the present invention provides a pipeline weld identification method and system based on image processing and magnetic flux leakage detection. By combining image processing technology and magnetic flux leakage detection technology, the above scheme effectively solves the influence of weld surface morphology on the detection results in traditional magnetic flux leakage detection methods, and improves the accuracy and reliability of identification.

[0005] A first aspect of an embodiment of the present application provides a pipeline weld identification method based on image processing and magnetic flux leakage detection, comprising:

[0006] Select the light source type according to the pipe material and pipe surface characteristics;

[0007] Turn on the light source and move the camera above the pipeline to be tested until the image of the area to be tested is completely acquired;

[0008] Calculating a gray level co-occurrence matrix of the captured image and extracting a plurality of first texture features;

[0009] Calculating a frequency spectrum of the captured image and extracting a plurality of second texture features; each of the first texture features corresponds to one of the second texture features;

[0010] Determining a plurality of texture features according to all of the first texture features and all of the second texture features;

[0011] According to the texture features, a plurality of seed points are determined, and a region growing method is used to perform image segmentation to obtain a plurality of weld regions;

[0012] Conduct magnetic flux leakage detection on several weld areas of the weld to identify the status of the pipeline weld.

[0013] In a possible implementation manner of the first aspect, selecting the light source type and adjusting the light source position according to the pipeline material and pipeline surface characteristics specifically includes:

[0014] If the pipe is made of metal and the friction factor of the pipe is less than or equal to a preset friction threshold, three strip lights are selected, and the three strip lights are respectively placed in front of, to the left, and to the right of the camera moving route;

[0015] If the pipe material is metal and the friction factor of the pipe is greater than a preset friction threshold, two directional light sources are selected, and the two directional light sources are respectively placed on the left side and the right side of the camera movement route;

[0016] If the pipe is made of plastic, choose a soft light box or diffuse reflector;

[0017] If the pipe material is ceramic, select ring light.

[0018] In a possible implementation manner of the first aspect, selecting the light source type and adjusting the light source position according to the pipeline material and pipeline surface characteristics specifically includes:

[0019] For pipelines with dark surfaces or surface reflectivity higher than a preset reflection threshold, select a light source lower than a preset brightness threshold;

[0020] For pipes with light-colored surfaces or with a surface reflectivity lower than or equal to a preset reflection threshold, a light source higher than or equal to a preset brightness threshold is selected.

[0021] In a possible implementation manner of the first aspect, before selecting the light source type and adjusting the light source position according to the pipeline material and pipeline surface characteristics, the method further includes:

[0022] Acquire an overall image of the pipeline, and convert the overall image of the pipeline into a grayscale image;

[0023] If the grayscale value of the grayscale image is greater than the preset color depth threshold, the pipeline surface is dark; if the grayscale value of the grayscale image is greater than or equal to the preset color depth threshold, the pipeline surface is light.

[0024] In a possible implementation manner of the first aspect, before calculating the gray level co-occurrence matrix of the captured image and extracting the plurality of first texture features, the method further includes:

[0025] After setting the Sobel threshold and the Canny threshold, the Sobel operator and the Canny operator are used to perform edge extraction on the captured image.

[0026] In a possible implementation of the first aspect, in a pipeline weld identification method based on image processing and magnetic flux leakage detection, setting a Sobel threshold and a Canny threshold specifically includes:

[0027] Calculating the gradient of the captured image in the x direction and the y direction;

[0028] According to the gradient, a histogram of gradient magnitude is plotted;

[0029] Select the peak value in the histogram as the Canny low threshold, and select the valley value in the histogram as the Canny high threshold;

[0030] The difference between adjacent amplitudes in the histogram is determined, the largest difference and the most frequently occurring difference are selected from all the differences, and the sum of the largest difference and the most frequently occurring difference is used as the Sobel threshold.

[0031] In a possible implementation manner of the first aspect, calculating a gray level co-occurrence matrix of the captured image and extracting a plurality of first texture features specifically includes:

[0032] Normalizing the grayscale value of the captured image to a preset grayscale level and filling the grayscale matrix;

[0033] Traversing each pixel in the captured image, counting the number of times the first grayscale value and the second grayscale value appear simultaneously when the length is the radius and the direction is the moving direction of the camera above the pipeline to be tested as the total pixel pair number;

[0034] Dividing the values ​​in the grayscale matrix by the total number of pixel pairs to obtain a grayscale co-occurrence matrix;

[0035] According to the gray level co-occurrence matrix, contrast, energy value and entropy value are extracted.

[0036] In a possible implementation manner of the first aspect, determining a plurality of texture features according to all of the first texture features and all of the second texture features specifically includes:

[0037] determining a first contrast, a first energy value, and a first entropy value according to all of the first texture features;

[0038] determining a second contrast, a second energy value, and a second entropy value according to all of the second texture features;

[0039] The first contrast and the average of the first contrast, the average of the first energy value and the second energy value, and the average of the first entropy value and the second entropy value are sequentially used as a texture feature.

[0040] In a possible implementation of the first aspect, determining a plurality of seed points based on the plurality of texture features, and performing image segmentation using a region growing method to obtain a plurality of weld regions specifically includes:

[0041] Segmenting the captured image to obtain a plurality of square areas of equal size; the side length of each of the square areas is less than the order of the gray-level co-occurrence matrix;

[0042] For all the square areas, a plurality of regional texture features of each of the square areas are calculated in sequence, and the difference between the plurality of regional texture features and the corresponding one of the texture features is calculated respectively, and the square area corresponding to the minimum difference is taken as the characteristic square area of ​​the texture feature;

[0043] The center point of each characteristic square area is taken as a seed point, and the image is segmented using the region growing method to obtain a plurality of weld areas.

[0044] A second aspect of an embodiment of the present application provides a pipeline weld identification system based on image processing and magnetic flux leakage detection, comprising:

[0045] Selection module, used to select the light source type according to the pipe material and pipe surface characteristics;

[0046] The shooting module is used to turn on the light source and move the camera above the pipeline to be tested until the shooting image of the area to be tested is completely obtained;

[0047] A first calculation module, used to calculate the gray level co-occurrence matrix of the captured image and extract a plurality of first texture features;

[0048] A second calculation module, used to calculate the frequency spectrum of the captured image and extract a plurality of second texture features; each of the first texture features corresponds to one of the second texture features;

[0049] A texture module, configured to determine a plurality of texture features according to all of the first texture features and all of the second texture features;

[0050] A segmentation module, used to determine a number of seed points according to a number of the texture features, and perform image segmentation using a region growing method to obtain a number of weld regions;

[0051] The identification module is used to perform magnetic leakage detection on several weld areas of the weld to identify the status of the pipeline weld.

[0052] Compared with the prior art, the embodiments of the present invention provide a pipeline weld identification method and system based on image processing and magnetic flux leakage detection. By combining image processing technology and magnetic flux leakage detection technology, the texture features extracted by image processing are matched with the magnetic flux leakage detection results, false signals caused by surface morphology are eliminated, and the reliability of the detection results is improved. According to the texture features and magnetic flux leakage detection results, the weld status is comprehensively evaluated, the defect type and location are identified, and the robustness of the detection is enhanced.

[0053] In summary, the present invention effectively solves the influence of weld surface morphology on the detection results in the traditional magnetic flux leakage detection method, and improves the accuracy, efficiency, robustness and reliability of the detection. At the same time, the method is suitable for pipelines of various materials and surface characteristics, and realizes the accurate segmentation of the weld area and the comprehensive evaluation of defects. BRIEF DESCRIPTION OF THE DRAWINGS

[0054] Figure 1 It is a schematic diagram of a process of a pipeline weld identification method based on image processing and magnetic flux leakage detection provided by an embodiment of the present invention;

[0055] Figure 2 The present invention is a schematic structural diagram of a pipeline weld identification system based on image processing and magnetic flux leakage detection provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0056] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0057] Please refer to Figure 1 The embodiment of the present invention provides a pipeline weld identification method based on image processing and magnetic flux leakage detection, comprising:

[0058] S10. Select the light source type according to the pipe material and pipe surface characteristics.

[0059] S11, turning on the light source, and moving the camera above the pipeline to be tested until a complete image of the area to be tested is obtained.

[0060] S12: Calculate the gray level co-occurrence matrix of the captured image and extract a plurality of first texture features.

[0061] S13, calculating a frequency spectrum of the captured image and extracting a plurality of second texture features; each first texture feature corresponds to one second texture feature.

[0062] S14. Determine a plurality of texture features according to all of the first texture features and all of the second texture features.

[0063] S15. Determine a number of seed points based on the plurality of texture features, and use a region growing method to perform image segmentation to obtain a number of weld regions.

[0064] S16. Perform magnetic leakage detection on several weld areas of the weld to identify the status of the pipeline weld.

[0065] S10 can be summarized as the choice of light source. In order to obtain clear, high-quality images of the pipe surface, it is necessary to select the appropriate light source type according to the pipe material and surface characteristics. For example, for metal pipes, you may need to consider using diffuse light to reduce reflections, while for plastic or ceramic pipes, it may be more appropriate to use direct light to increase contrast.

[0066] S11 obtains high-quality images of the area to be inspected, providing a basis for subsequent processing. By moving the camera along the path above the pipe, ensure that the entire inspection area is fully illuminated and photographed. This step requires the interaction between the camera and the light source to capture the ideal image.

[0067] S12 Extract texture features through the grayscale co-occurrence matrix to extract information that can reflect the surface features of the pipeline from the captured image. The grayscale co-occurrence matrix can be constructed by graying the image, and texture features such as contrast, homogeneity, and angular second-order moment can be extracted from it. S13 Extract texture features through the spectrum map to further extract image features from different angles, especially those that are not easy to directly observe in the spatial domain. The image can be converted from the spatial domain to the frequency domain using Fourier transform, and then specific features can be extracted from the spectrum map, which can form a complementary relationship with the features previously extracted from the grayscale co-occurrence matrix. Feature fusion is then performed in S14 to combine features from different sources to form a more comprehensive and accurate representation. The features extracted from the grayscale co-occurrence matrix and the spectrum map are integrated, which may include simple averaging or more complex mathematical operations, in order to construct a set of features that can better distinguish welds from other areas.

[0068] In S15, the region growing method is used for image segmentation to accurately locate and segment the weld area. First, some potential "seed" points are determined based on the previously extracted features, and then starting from these points, they are gradually expanded according to certain rules (such as similarity measurement) until the entire weld area is covered. Finally, in S16, physical methods are used to conduct in-depth inspection of the weld to find possible defects. Magnetic leakage detection is performed on the weld area that has been identified by image processing technology. This method can detect defects such as cracks and holes inside or on the surface of the material, thereby providing important information about the health of the weld.

[0069] In summary, this series of steps constitutes an efficient and accurate pipeline weld identification system, which not only relies on image processing technology to preliminarily locate and identify welds, but also combines magnetic flux leakage detection technology to deeply evaluate the quality of welds and ensure the safe and reliable operation of pipelines.

[0070] Exemplarily, the selecting the light source type and adjusting the light source position according to the pipeline material and pipeline surface characteristics specifically includes:

[0071] If the pipe is made of metal and the friction factor of the pipe is less than or equal to a preset friction threshold, three strip lights are selected, and the three strip lights are respectively placed in front of, to the left, and to the right of the camera moving route;

[0072] If the pipe material is metal and the friction factor of the pipe is greater than a preset friction threshold, two directional light sources are selected, and the two directional light sources are respectively placed on the left side and the right side of the camera movement route;

[0073] If the pipe is made of plastic, choose a soft light box or diffuse reflector;

[0074] If the pipe material is ceramic, select ring light.

[0075] To ensure high quality images, it is important to choose the right light source type and position based on the pipe material and surface characteristics. The following are the options:

[0076] If the friction factor of the metal material is ≤ the preset friction threshold, three strip lights are selected: Front strip light: provides uniform front lighting and reduces shadows; Side strip light: provides side lighting, enhances the contrast of surface texture, and helps detect subtle surface defects.

[0077] If the friction factor of the metal material is greater than the preset friction threshold, select two directional light sources. Directional light sources provide concentrated light to enhance the visibility of surface details, especially when the surface is rough. Side directional light sources help to highlight surface unevenness and texture, and improve the contrast of the image.

[0078] For plastic materials, choose softbox or diffuser. This is because softbox can provide soft diffused light, reduce surface reflection and highlight spots, and is suitable for the smooth surface of plastic materials. Diffuser also provides soft light to ensure uniform illumination of the image and avoid overexposure or dark areas.

[0079] For ceramic materials, choose ring light. Ring light can provide uniform circular lighting, reduce shadows and highlight spots, and is particularly suitable for the smooth surface of ceramic materials. Omnidirectional lighting ensures uniform lighting from all angles, improving the overall quality of the image.

[0080] By selecting the appropriate light source type and position according to the pipe material and surface characteristics, the image quality can be significantly improved, providing reliable input for subsequent image processing and magnetic flux leakage detection. This not only improves the accuracy of weld identification, but also enhances the robustness and reliability of the system.

[0081] Exemplarily, the selecting the light source type and adjusting the light source position according to the pipeline material and pipeline surface characteristics specifically includes:

[0082] For pipelines with dark surfaces or surface reflectivity higher than a preset reflection threshold, select a light source lower than a preset brightness threshold;

[0083] For pipes with light-colored surfaces or with a surface reflectivity lower than or equal to a preset reflection threshold, a light source higher than or equal to a preset brightness threshold is selected.

[0084] Exemplarily, before selecting the light source type and adjusting the light source position according to the pipeline material and pipeline surface characteristics, the method further includes:

[0085] Acquire an overall image of the pipeline, and convert the overall image of the pipeline into a grayscale image;

[0086] If the grayscale value of the grayscale image is greater than the preset color depth threshold, the pipeline surface is dark; if the grayscale value of the grayscale image is greater than or equal to the preset color depth threshold, the pipeline surface is light.

[0087] In order to ensure the selection of the appropriate light source type and position, it is necessary to first obtain an overall image of the pipeline and determine the color characteristics of the pipeline surface based on the grayscale value of the image. Therefore, the overall image needs to ensure that the image is clear and covers all parts of the area to be inspected.

[0088] Then you can use image processing software to convert the color image into a grayscale image, preserving the brightness information of the image. Then calculate the average gray value of all pixels in the grayscale image. This can be obtained by calculating the average value of all pixel values.

[0089] Set a preset color depth threshold (e.g. 128). If the average gray value is greater than the preset color depth threshold, the pipeline surface is judged to be dark. If the average gray value is less than or equal to the preset color depth threshold, the pipeline surface is judged to be light.

[0090] Through the above steps, the overall image of the pipe can be obtained and its surface color characteristics can be determined before selecting the light source type and adjusting the light source position. This helps to select the most appropriate light source type and position, ensure the acquisition of high-quality images, and provide reliable input for subsequent image processing and magnetic flux leakage detection. This not only improves the accuracy of weld identification, but also enhances the robustness and reliability of the system.

[0091] Exemplarily, before calculating the gray level co-occurrence matrix of the captured image and extracting the plurality of first texture features, the method further includes:

[0092] After setting the Sobel threshold and the Canny threshold, the Sobel operator and the Canny operator are used to perform edge extraction on the captured image.

[0093] In order to ensure the accuracy of subsequent texture feature extraction and image segmentation, it is necessary to first perform edge extraction on the captured image. The specific steps include setting the Sobel threshold and the Canny threshold, and then using the Sobel operator and the Canny operator to perform edge extraction on the captured image.

[0094] Through the above steps, the image can be edge extracted before calculating the gray level co-occurrence matrix of the captured image and extracting the texture features. This step helps to remove noise and weak edges and retain important edge information in the image, thereby improving the accuracy of subsequent texture feature extraction and image segmentation. This not only improves the accuracy of weld recognition, but also enhances the robustness and reliability of the system.

[0095] Exemplarily, a pipeline weld identification method based on image processing and magnetic flux leakage detection, wherein the setting of the Sobel threshold and the Canny threshold specifically includes:

[0096] Calculating the gradient of the captured image in the x direction and the y direction;

[0097] According to the gradient, a histogram of gradient magnitude is plotted;

[0098] Select the peak value in the histogram as the Canny low threshold, and select the valley value in the histogram as the Canny high threshold;

[0099] The difference between adjacent amplitudes in the histogram is determined, the largest difference and the most frequently occurring difference are selected from all the differences, and the sum of the largest difference and the most frequently occurring difference is used as the Sobel threshold.

[0100] In the process of pipeline weld identification, the captured pipeline image needs to be preprocessed first to better detect the location of the weld. One of the key steps in preprocessing is edge detection, which involves two commonly used edge detection techniques: the Sobel operator and the Canny operator. In order to optimize the effects of these two operators, their thresholds need to be set reasonably.

[0101] Using mathematical methods to calculate the gradient of the image in the x-direction and y-direction, this step can reveal the direction and degree of brightness change in the image. For each pixel, a gradient value in the x-direction and a gradient value in the y-direction are obtained. Based on the calculated gradient values, a histogram can be constructed to show the distribution of gradient amplitudes. The histogram can help workers intuitively understand which gradient values ​​are most common and which are less common.

[0102] Set the Canny threshold: Find a clear peak in the histogram. This peak represents the most common gradient amplitude in the image and can be used as the low threshold of the Canny operator. The low threshold is used to capture edges that are more obvious but not the strongest. Similarly, find a relatively low valley in the histogram. This valley can be used as the high threshold of the Canny operator. The high threshold is used to filter out the strongest edges in the image. Only when the gradient amplitude exceeds this threshold will it be considered a true edge.

[0103] Setting the Sobel Threshold: Next, calculate the differences between adjacent gradient magnitudes in the histogram. These differences can help us understand how fast the gradient changes. Among all the calculated differences, find the largest difference and the difference that occurs the most (i.e., the most common difference). Add these two differences together, and the result can be used as the threshold of the Sobel operator. This method aims to balance the sensitivity and noise resistance of edge detection.

[0104] Exemplarily, the calculating the gray level co-occurrence matrix of the captured image and extracting a plurality of first texture features specifically includes:

[0105] Normalizing the grayscale value of the captured image to a preset grayscale level and filling the grayscale matrix;

[0106] Traversing each pixel in the captured image, counting the number of times the first grayscale value and the second grayscale value appear simultaneously when the length is the radius and the direction is the moving direction of the camera above the pipeline to be tested as the total pixel pair number;

[0107] Dividing the values ​​in the grayscale matrix by the total number of pixel pairs to obtain a grayscale co-occurrence matrix;

[0108] According to the gray level co-occurrence matrix, contrast, energy value and entropy value are extracted.

[0109] In order to extract useful texture features from captured images, it is necessary to calculate the Gray-Level Co-occurrence Matrix (GLCM).

[0110] First, the grayscale value of the captured image is normalized to a preset grayscale level and filled into the grayscale matrix. This is to standardize the grayscale value of the image for subsequent calculations. Convert the captured image to a grayscale image. The grayscale value can be normalized to a preset grayscale level (for example, 256 grayscale levels between 0 and 255). Create an empty grayscale matrix to store the normalized grayscale value.

[0111] Traverse each pixel in the captured image to count the frequency of occurrence of grayscale value pairs in the image. A radius value and direction can be defined (for example, the radius is 1, and the direction is the direction of camera movement). Traverse each pixel in the image and count the number of times the grayscale value of the current pixel (first grayscale value) and the grayscale value of the pixel at the specified direction and distance (second grayscale value) appear at the same time. Record these times in the grayscale matrix. Then normalize the values ​​in the grayscale matrix so that it represents probability: the total number of pixel pairs, that is, the total number of all recorded grayscale value pairs, can be calculated. Divide each value in the grayscale matrix by the total number of pixel pairs to obtain a normalized grayscale co-occurrence matrix. Finally, extract useful texture features from the normalized grayscale co-occurrence matrix.

[0112] Among them, contrast is used to measure the degree of change of grayscale values ​​in an image; energy is used to measure the uniformity of grayscale value distribution in an image; and entropy is used to measure the randomness of grayscale value distribution in an image.

[0113] Through the above steps, the gray level co-occurrence matrix can be calculated from the captured image and useful texture features can be extracted. These features can provide detailed information about the image texture, which is helpful for subsequent weld identification and defect detection. This method combines image processing technology and mathematical statistics methods to accurately identify the weld position in a complex background and improve the accuracy and reliability of detection.

[0114] Exemplarily, the determining a plurality of texture features according to all of the first texture features and all of the second texture features specifically includes:

[0115] determining a first contrast, a first energy value, and a first entropy value according to all of the first texture features;

[0116] determining a second contrast, a second energy value, and a second entropy value according to all of the second texture features;

[0117] The first contrast and the average of the first contrast, the average of the first energy value and the second energy value, and the average of the first entropy value and the second entropy value are sequentially used as a texture feature.

[0118] The purpose of this is to fuse the texture features in the spatial domain and the frequency domain to form a comprehensive texture feature.

[0119] The following are possible implementation options:

[0120] Calculate the mean of the first contrast and the second contrast. Calculate the mean of the first energy value and the second energy value. Calculate the mean of the first entropy value and the second entropy value. Combine these means into a new texture feature vector.

[0121] Through the above steps, the first texture feature extracted from the gray level co-occurrence matrix and the second texture feature extracted from the spectrum can be fused to form a comprehensive texture feature. These comprehensive features can provide more comprehensive and reliable image texture information, which is helpful for subsequent weld identification and defect detection. This method combines the feature extraction technology of the spatial domain and the frequency domain, and can accurately identify the weld position under complex backgrounds, improving the accuracy and reliability of detection.

[0122] Exemplarily, the method of determining a plurality of seed points based on a plurality of texture features, and performing image segmentation using a region growing method to obtain a plurality of weld regions specifically includes:

[0123] Segmenting the captured image to obtain a plurality of square areas of equal size; the side length of each of the square areas is less than the order of the gray-level co-occurrence matrix;

[0124] For all the square areas, a plurality of regional texture features of each of the square areas are calculated in sequence, and the difference between the plurality of regional texture features and the corresponding one of the texture features is calculated respectively, and the square area corresponding to the minimum difference is taken as the characteristic square area of ​​the texture feature;

[0125] The center point of each characteristic square area is taken as a seed point, and the image is segmented using the region growing method to obtain a plurality of weld areas.

[0126] In order to accurately identify the weld area from the captured image, image segmentation can be performed through the following steps:

[0127] First, the captured image is segmented to obtain several square areas of equal size. This process divides the image into multiple small areas for local feature analysis. In practical applications, the captured image can be segmented into several square areas of equal size. The side length of each square area should be less than the order of the gray level co-occurrence matrix to ensure that the features in each area can be fully extracted.

[0128] Then, for all square areas, several regional texture features of each square area are calculated in turn. This is to extract the texture features of each square area for subsequent feature matching. Texture features such as contrast, energy value and entropy value can be calculated for each square area. These features can reflect the texture characteristics of each area.

[0129] Then, through feature matching, find the square area that is most similar to the global texture feature. For each square area, calculate the difference between its texture feature and the global texture feature. Find the square area with the smallest difference and use it as the feature square area of ​​the texture feature. Through feature matching, the algorithm can enhance its adaptability to different environments and conditions. Even in the case of poor image quality or interference, feature matching can find the most suitable seed point to improve the robustness of the algorithm.

[0130] It should be noted that for each square area, the difference between its texture feature and the global texture feature is calculated. The square area with the smallest difference is found and used as the characteristic square area of ​​the texture feature. On the one hand, by calculating the difference between the texture feature of each square area and the global texture feature, the area most similar to the global texture feature can be found. Ensure that the selected square area has highly consistent characteristics with the global texture feature, thereby improving the accuracy and reliability of the subsequent region growing method; on the other hand, by selecting the square area with the smallest difference, it can reduce misjudgment caused by noise or background interference. This ensures that the selection of seed points is more accurate and avoids growing from the wrong area, thereby improving the accuracy of weld area segmentation.

[0131] Finally, the center point of each characteristic square area is used as a seed point, and the region growing method is used to segment the image to obtain several weld areas. This process starts from the center point of the characteristic square area, gradually expands the area, and finally segments the weld area. In practical applications, the center point of each characteristic square area can be used as a seed point. Starting from each seed point, the region growing method is used to gradually expand the area until the entire weld area is covered. The basic idea of ​​the region growing method is to start from the seed point and gradually add neighboring pixels similar to it until it can no longer be expanded.

[0132] More specifically, a seed point set S is initialized. A seed point P is selected from the seed point set S, and the neighboring pixels of P are checked. If the features of the neighboring pixels are similar to those of P, the neighboring pixels are added to the current region. The above selection and addition process is repeated until it is impossible to expand further, and the current region is marked as a weld region.

[0133] Through the above steps, the weld area can be accurately identified from the captured image. These steps combine image segmentation, texture feature extraction and region growing method to accurately segment the weld area under complex backgrounds and improve the accuracy and reliability of detection. This method is not only suitable for weld identification, but can also be applied to other scenarios that require accurate image segmentation.

[0134] Compared with the prior art, the embodiment of the present invention provides a pipeline weld identification method based on image processing and magnetic flux leakage detection. By combining image processing technology and magnetic flux leakage detection technology, the texture features extracted by image processing are matched with the magnetic flux leakage detection results, false signals caused by surface morphology are eliminated, and the reliability of the detection results is improved; based on the texture features and magnetic flux leakage detection results, the weld status is comprehensively evaluated, the defect type and location are identified, and the robustness of the detection is enhanced.

[0135] In summary, the present invention effectively solves the influence of weld surface morphology on the detection results in the traditional magnetic flux leakage detection method, and improves the accuracy, efficiency, robustness and reliability of the detection. At the same time, the method is suitable for pipelines of various materials and surface characteristics, and realizes the accurate segmentation of the weld area and the comprehensive evaluation of defects.

[0136] An embodiment of the present application provides a pipeline weld identification system based on image processing and magnetic flux leakage detection, including: a selection module 201, a shooting module 202, a first calculation module 203, a second calculation module 204, a texture module 205, a segmentation module 206 and a recognition module 207.

[0137] The selection module 201 is used to select the light source type according to the pipe material and the pipe surface characteristics.

[0138] The shooting module 202 is used to turn on the light source and move the camera above the pipeline to be tested until the shooting image of the area to be tested is completely obtained.

[0139] The first calculation module 203 is used to calculate the gray level co-occurrence matrix of the captured image and extract a plurality of first texture features.

[0140] The second calculation module 204 is used to calculate the frequency spectrum of the captured image and extract a plurality of second texture features; each of the first texture features corresponds to one of the second texture features.

[0141] The texture module 205 is configured to determine a plurality of texture features according to all of the first texture features and all of the second texture features.

[0142] The segmentation module 206 is used to determine a number of seed points according to a number of the texture features, and perform image segmentation using a region growing method to obtain a number of weld regions.

[0143] The identification module 207 is used to perform magnetic leakage detection on a plurality of weld areas of the weld to identify the status of the pipeline weld.

[0144] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working process of the identification system described above can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here.

[0145] Compared with the prior art, the embodiment of the present invention provides a pipeline weld identification system based on image processing and magnetic flux leakage detection. By combining image processing technology and magnetic flux leakage detection technology, the texture features extracted by image processing are matched with the magnetic flux leakage detection results, false signals caused by surface morphology are eliminated, and the reliability of the detection results is improved; based on the texture features and magnetic flux leakage detection results, the weld status is comprehensively evaluated, the defect type and location are identified, and the robustness of the detection is enhanced.

[0146] In summary, the present invention effectively solves the influence of weld surface morphology on the detection results in the traditional magnetic flux leakage detection method, and improves the accuracy, efficiency, robustness and reliability of the detection. At the same time, the method is suitable for pipelines of various materials and surface characteristics, and realizes the accurate segmentation of the weld area and the comprehensive evaluation of defects.

[0147] The above is a preferred embodiment of the present invention. It should be pointed out that a person skilled in the art can make several improvements and modifications without departing from the principle of the present invention. These improvements and modifications are also considered to be within the scope of protection of the present invention.

Claims

1. A pipeline weld identification method based on image processing and magnetic flux leakage detection, characterized in that: include: Select the light source type according to the pipe material and pipe surface characteristics; Turn on the light source and move the camera above the pipeline to be tested until the image of the area to be tested is completely acquired; Calculating a gray level co-occurrence matrix of the captured image and extracting a plurality of first texture features; Calculating a frequency spectrum of the captured image and extracting a plurality of second texture features; each of the first texture features corresponds to one of the second texture features; Determining a plurality of texture features according to all of the first texture features and all of the second texture features; According to the texture features, a plurality of seed points are determined, and a region growing method is used to perform image segmentation to obtain a plurality of weld regions; Performing magnetic leakage detection on several weld areas of the weld to identify the weld status of the pipeline; According to the pipe material and pipe surface characteristics, select the light source type and adjust the light source position, including: If the pipe is made of metal and the friction factor of the pipe is less than or equal to a preset friction threshold, three strip lights are selected, and the three strip lights are respectively placed in front, on the left side, and on the right side of the camera moving route; If the pipe material is metal and the friction factor of the pipe is greater than a preset friction threshold, two directional light sources are selected, and the two directional light sources are respectively placed on the left and right sides of the camera movement route; If the pipe is made of plastic, choose a soft light box or diffuse reflector; If the pipe material is ceramic, choose ring light; Or, according to the pipe material and pipe surface characteristics, select the light source type, including: For pipelines with dark surfaces or surface reflectivity higher than a preset reflection threshold, select a light source lower than a preset brightness threshold; For pipes with light-colored surfaces or surface reflectance lower than or equal to a preset reflection threshold, select a light source higher than or equal to a preset brightness threshold; Before selecting the light source type according to the pipe material and pipe surface characteristics, it also includes: Acquire an overall image of the pipeline, and convert the overall image of the pipeline into a grayscale image; If the grayscale value of the grayscale image is greater than the preset color depth threshold, the surface of the pipeline is dark; if the grayscale value of the grayscale image is less than or equal to the preset color depth threshold, the surface of the pipeline is light; The determining of a plurality of texture features according to all of the first texture features and all of the second texture features specifically includes: determining a first contrast, a first energy value, and a first entropy value according to all of the first texture features; determining a second contrast, a second energy value, and a second entropy value according to all of the second texture features; An average value of the first contrast and the second contrast, an average value of the first energy value and the second energy value, and an average value of the first entropy value and the second entropy value are sequentially used as a texture feature.

2. A pipeline weld identification method based on image processing and magnetic flux leakage detection as claimed in claim 1, characterized in that: Before calculating the gray level co-occurrence matrix of the captured image and extracting a plurality of first texture features, the method further includes: After setting the Sobel threshold and the Canny threshold, the Sobel operator and the Canny operator are used to perform edge extraction on the captured image.

3. A pipeline weld identification method based on image processing and magnetic flux leakage detection as claimed in claim 2, characterized in that: The setting of the Sobel threshold and the Canny threshold specifically includes: Calculating the gradient of the captured image in the x direction and the y direction; According to the gradient, a histogram of gradient magnitude is plotted; Select the peak value in the histogram as the Canny low threshold, and select the valley value in the histogram as the Canny high threshold; The difference between adjacent amplitudes in the histogram is determined, the largest difference and the most frequently occurring difference are selected from all the differences, and the sum of the largest difference and the most frequently occurring difference is used as the Sobel threshold.

4. A pipeline weld identification method based on image processing and magnetic flux leakage detection as claimed in claim 1, characterized in that: The step of calculating the gray level co-occurrence matrix of the captured image and extracting a plurality of first texture features specifically includes: Normalizing the grayscale value of the captured image to a preset grayscale level and filling the grayscale matrix; Traversing each pixel in the captured image, counting the number of times the first grayscale value and the second grayscale value appear simultaneously when the length is the radius and the direction is the moving direction of the camera above the pipeline to be tested as the total pixel pair number; Dividing the values ​​in the grayscale matrix by the total number of pixel pairs to obtain a grayscale co-occurrence matrix; Extracting contrast, energy value and entropy value according to the gray level co-occurrence matrix; The first grayscale value is the grayscale value of the current pixel; The second grayscale value is the grayscale value of the pixel at the specified direction and distance.

5. A pipeline weld identification method based on image processing and magnetic flux leakage detection as claimed in claim 1, characterized in that: The method of determining a plurality of seed points based on a plurality of texture features and performing image segmentation using a region growing method to obtain a plurality of weld regions specifically includes: Segmenting the captured image to obtain a plurality of square areas of equal size; the side length of each of the square areas is less than the order of the gray-level co-occurrence matrix; For all the square areas, a plurality of regional texture features of each of the square areas are calculated in sequence, and the difference between the plurality of regional texture features and the corresponding one of the texture features is calculated respectively, and the square area corresponding to the minimum difference is taken as the characteristic square area of ​​the texture feature; The center point of each characteristic square area is taken as a seed point, and the image is segmented using the region growing method to obtain a plurality of weld areas.

6. A pipeline weld identification system based on image processing and magnetic flux leakage detection, characterized in that: include: Selection module, used to select the light source type according to the pipe material and pipe surface characteristics; The shooting module is used to turn on the light source and move the camera above the pipeline to be tested until the shooting image of the area to be tested is completely obtained; A first calculation module, used to calculate the gray level co-occurrence matrix of the captured image and extract a plurality of first texture features; A second calculation module, used to calculate the frequency spectrum of the captured image and extract a plurality of second texture features; each of the first texture features corresponds to one of the second texture features; A texture module, configured to determine a plurality of texture features according to all of the first texture features and all of the second texture features; A segmentation module, used to determine a number of seed points according to a number of the texture features, and perform image segmentation using a region growing method to obtain a number of weld regions; An identification module, used to perform magnetic leakage detection on a plurality of weld areas of the weld to identify the weld status of the pipeline; According to the pipe material and pipe surface characteristics, select the light source type and adjust the light source position, including: If the pipe is made of metal and the friction factor of the pipe is less than or equal to a preset friction threshold, three strip lights are selected, and the three strip lights are respectively placed in front, on the left side, and on the right side of the camera moving route; If the pipe material is metal and the friction factor of the pipe is greater than a preset friction threshold, two directional light sources are selected, and the two directional light sources are respectively placed on the left and right sides of the camera movement route; If the pipe is made of plastic, choose a soft light box or diffuse reflector; If the pipe material is ceramic, choose ring light; Or, according to the pipe material and pipe surface characteristics, select the light source type, including: For pipelines with dark surfaces or surface reflectivity higher than a preset reflection threshold, select a light source lower than a preset brightness threshold; For pipes with light-colored surfaces or surface reflectance lower than or equal to a preset reflection threshold, select a light source higher than or equal to a preset brightness threshold; Before selecting the light source type according to the pipe material and pipe surface characteristics, it also includes: Acquire an overall image of the pipeline, and convert the overall image of the pipeline into a grayscale image; If the grayscale value of the grayscale image is greater than the preset color depth threshold, the surface of the pipeline is dark; if the grayscale value of the grayscale image is less than or equal to the preset color depth threshold, the surface of the pipeline is light; The determining of a plurality of texture features according to all of the first texture features and all of the second texture features specifically includes: determining a first contrast, a first energy value, and a first entropy value according to all of the first texture features; determining a second contrast, a second energy value, and a second entropy value according to all of the second texture features; An average value of the first contrast and the second contrast, an average value of the first energy value and the second energy value, and an average value of the first entropy value and the second entropy value are sequentially used as a texture feature.

Citation Information

Patent Citations

  • Image acquisition system of visual detection equipment

    CN206638165U