Image-based steel pipe inner and outer wall defect detection method and system

By screening image data of the inner and outer walls of steel pipes, determining lighting conditions and feature parameters, and generating high-precision defect detection results, the problems of unstable lighting and incomplete feature extraction in existing technologies are solved, achieving efficient and accurate defect detection.

CN121010579APending Publication Date: 2025-11-25HEBEI JINAO PRECISION MFG CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202511126201.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-08-12
Publication Date
2025-11-25

AI Technical Summary

Technical Problem

Existing image-based steel pipe defect detection methods suffer from unstable lighting conditions, incomplete defect feature extraction, lack of adaptability to complex scenes, and insufficient analysis of defect location information, resulting in low detection accuracy, low efficiency, and susceptibility to misjudgment.

Method used

By acquiring image data of the inner and outer walls of steel pipes, screening candidate defect areas, determining lighting conditions, obtaining feature parameters, analyzing image coordinates, and combining basic judgment thresholds to generate detection results, a closed-loop detection system is formed.

Benefits of technology

It improves the accuracy and efficiency of defect detection, reduces misjudgments, adapts to the inspection needs of steel pipes of different materials and specifications, and meets the high precision requirements of industrial production.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121010579A_ABST
    Figure CN121010579A_ABST
Patent Text Reader

Abstract

The invention provides an image-based steel pipe inner and outer wall defect detection method and system, and belongs to the technical field of industrial nondestructive testing. The method comprises the following steps: firstly, acquiring steel pipe inner and outer wall image data comprising a plurality of defect candidate areas, detecting whether a suspected defect exists according to the areas, and if so, acquiring a first characteristic parameter; judging whether a preset illumination condition is received when the image data is acquired, and if so, taking the corresponding defect candidate area as a defect detection interest point; determining defect feature vectors and image coordinates according to the interest points, judging whether the coordinates meet a preset region range or not, and if not, obtaining corresponding second feature parameters; and finally, generating a steel pipe defect detection result in combination with the basic judgment threshold for completing defect detection, the first characteristic parameter and the second characteristic parameter. According to the method, through multi-dimensional characteristic parameter analysis and illumination condition adaptation, the accuracy of defect detection of the inner wall and the outer wall of the steel pipe is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application belongs to the field of industrial nondestructive testing technology, and more specifically, relates to an image-based method and system for detecting defects in the inner and outer walls of steel pipes. Background Technology

[0002] Steel pipes, as an indispensable basic component in industrial production, are widely used in many fields such as oil and gas transportation, building structures, and machinery manufacturing. The integrity of their inner and outer walls directly affects the product's service life and operational safety. Defects such as cracks, corrosion, and dents can lead to serious accidents such as leaks and fractures, causing huge economic losses and safety hazards. Therefore, accurate detection of defects in the inner and outer walls of steel pipes is an indispensable part of industrial production. Traditional steel pipe defect detection methods primarily rely on manual inspection, where inspectors visually examine the pipe surface and judge the presence of defects based on experience. This method is not only resource-intensive but also extremely inefficient, making it unsuitable for the high-speed inspection demands of modern production lines. Furthermore, manual inspection results are susceptible to subjective factors such as fatigue and experience differences, leading to frequent missed or false positives and compromising the consistency and reliability of the inspection process. With the development of computer vision technology, image-based detection methods are increasingly being applied to the field of steel pipe defect detection. These methods acquire images of the steel pipe surface using image acquisition equipment, and then analyze the images using image processing algorithms to identify defects. However, existing image-based detection methods still have many limitations. During the image acquisition stage, the reflections, shadows, and unstable lighting conditions on the steel pipe surface can easily lead to blurred image features in defect areas, making it difficult to accurately extract candidate defect regions. For example, under strong light, fine cracks on the inner wall of the steel pipe may be obscured; while in low-light environments, the contrast of defect edges decreases, making it difficult to distinguish defects from normal areas. Furthermore, existing methods often rely on a single feature parameter or a fixed judgment threshold during defect feature extraction and judgment, lacking adaptability to complex scenarios. Different types of defects exhibit significantly different features in images; for example, cracks often show linear features, while corrosion presents regional features. A single feature parameter cannot comprehensively describe the attributes of various types of defects. At the same time, fixed judgment thresholds are insufficient to meet the inspection needs of steel pipes of different specifications and materials. When there are interfering factors such as stains and scratches on the steel pipe surface, it is easy to misjudge non-defect areas as defects or ignore minor defects as normal areas.

[0003] Furthermore, existing technologies have shortcomings in processing the spatial location information of defect areas. Steel pipe structures exhibit certain regularities, and defects at different locations have varying impacts on the overall performance of the pipe. However, existing methods often fail to effectively analyze the image coordinates of defects, making it impossible to filter key defects based on a pre-defined area range. This results in detection results containing a large amount of irrelevant information, increasing the difficulty of subsequent processing. These problems make existing image-based steel pipe defect detection methods insufficient to meet the high-precision and high-efficiency inspection requirements of industrial production, necessitating a new technological solution. Summary of the Invention

[0004] The purpose of this application is to provide an image-based method and system for detecting defects in the inner and outer walls of steel pipes, so as to solve the problems mentioned in the background art.

[0005] To achieve the above objectives, the present invention provides an image-based method for detecting defects on the inner and outer walls of steel pipes, the method comprising: Image data of the inner and outer walls of the steel pipe are acquired, wherein the image data includes multiple defect candidate regions; The presence of suspected defects is detected based on multiple candidate defect regions. If a suspected defect exists, obtain the first feature parameter; When performing the step of acquiring image data of the inner and outer walls of the steel pipe, determine whether the preset lighting conditions are received; If a preset lighting condition is received, multiple defect candidate regions corresponding to the received preset lighting condition are obtained, and the defect candidate regions are used as defect detection interest points. Determine the defect feature vector based on multiple defect detection interest points, and obtain the image coordinates at the time the defect feature vector is determined; Determine whether the image coordinates meet the preset area range; If the image coordinates do not meet the preset region range, obtain the second feature parameter corresponding to the image coordinates; Obtain the basic judgment threshold for completing defect detection, and generate the steel pipe defect detection result based on the basic judgment threshold, the first feature parameter, and the second feature parameter.

[0006] Preferably, the step of acquiring image data of the inner and outer walls of the steel pipe includes: Image data is input into the preprocessing module to obtain multiple standardized images; Edge contour information is obtained from the standardized image, and multiple contour gradient values ​​are obtained based on the edge contour information; The system sequentially traverses and filters out multiple valid contour regions whose contour gradient values ​​satisfy a preset gradient threshold. The multiple standardized images are segmented according to the multiple effective contour regions until the segmentation of the multiple standardized images is completed, thereby obtaining multiple defect candidate regions; Multiple defect candidate regions are used as multiple defect detection sub-regions, and the image information formed by the multiple defect detection sub-regions is used as image data.

[0007] Preferably, the step of detecting whether there is a suspected defect based on multiple defect candidate regions, and obtaining a first feature parameter if a suspected defect exists, includes: Obtain a standard defect sample library, and obtain multiple standard defect features corresponding to the standard defect sample library according to multiple preset defect types; Multiple candidate defect regions and multiple standard defect features are sequentially compared and analyzed to obtain multiple feature similarity values; Multiple feature differences are calculated sequentially based on the multiple feature similarity values ​​and a preset similarity threshold; Sequentially determine whether the differences in multiple features are within a preset difference range; If the feature difference degree is not within the preset difference range, it is determined that the detection area corresponding to the feature difference degree has a suspected defect in the image data, and the first feature parameter is obtained.

[0008] Preferably, the step of obtaining multiple candidate defect regions corresponding to the received preset illumination conditions includes: The ambient lighting data acquired in real time during the image acquisition process is obtained, and the interference signals outside the preset lighting range in the ambient lighting data are eliminated based on the lighting compensation algorithm to obtain effective lighting data. Based on image enhancement technology, the contrast of effective illumination data is adjusted to obtain optimized image data; Determine the relationship between the optimized image data and the preset sharpness threshold; If the optimized image data falls within the sharpness threshold range and the number of consecutive frames exceeds the preset stable frame number, then the lighting conditions corresponding to the optimized image data are determined as valid received preset lighting conditions. Based on the received preset lighting conditions, an image acquisition time window is obtained, and multiple first defect candidate regions within the corresponding time window are obtained based on the image acquisition time window. Obtain the center point of the steel pipe and the preset radius calculated from the diameter of the steel pipe, and extend the preset radius from the center point toward the preset pipe wall to obtain the target detection ring, and obtain the corresponding inner and outer wall areas based on the target detection ring; Based on the inner and outer wall regions, multiple first defect candidate regions are screened for region affiliation to obtain multiple second defect candidate regions located in the inner and outer wall regions of the preset detection ring, and these multiple second defect candidate regions are used as multiple defect candidate regions.

[0009] Preferably, the step of obtaining the image coordinates when determining the defect feature vector includes: Based on the defect feature vector, obtain the corresponding feature point coordinate information, and based on the feature point coordinate information, obtain the region start coordinates and region end coordinates; The boundary of the defect region is obtained by integrating the starting coordinates and ending coordinates of the region. The coordinates of the center of the defect region are obtained based on the boundary of the defect region, and these coordinates are used as the image coordinates when determining the defect feature vector.

[0010] Preferably, the step of obtaining the basic judgment threshold for completing defect detection and generating the steel pipe defect detection result based on the basic judgment threshold, the first feature parameter, and the second feature parameter includes: Obtain the standard wall thickness parameters for the current steel pipe inspection; Obtain the actual wall thickness parameters of the current steel pipe inspection; The wall thickness correction coefficient is obtained based on the standard wall thickness parameters and the actual wall thickness parameters; The first feature score of the suspected defect is obtained based on historical defect data, and the corresponding first feature weight is obtained based on the first feature score. The feature parameter corresponding to the first feature weight is used as the first feature parameter; The second feature score of the regional location deviation is obtained based on historical defect data, and the corresponding second feature weight is obtained based on the second feature score; Use the feature parameters corresponding to the second feature weights as the second feature parameters; The comprehensive defect assessment value is obtained based on the basic judgment threshold, the first feature score, the first feature weight, the second feature score, the second feature weight, and the wall thickness correction coefficient.

[0011] Preferably, the step of obtaining edge contour information based on the standardized image includes: The Sobel operator is used to perform edge detection on the standardized image, and the gradient values ​​in the horizontal and vertical directions are calculated respectively. The horizontal and vertical gradient values ​​are combined using a square root operation to obtain a composite gradient value, which is then used as the contour gradient value in the edge contour information.

[0012] Preferably, the step of calculating multiple feature differences based on the multiple feature similarity values ​​and a preset similarity threshold sequentially includes: Obtain the average feature vector of the standard defect features, and calculate the cosine similarity between the feature vector of the defect candidate region and the average feature vector; The feature difference is obtained by subtracting the cosine similarity from the preset similarity threshold.

[0013] Preferably, the present invention further includes an image-based steel pipe inner and outer wall defect detection system for implementing the image-based steel pipe inner and outer wall defect detection method described above, the system comprising: An image acquisition module is used to acquire image data of the inner and outer walls of the steel pipe, wherein the image data includes multiple defect candidate regions; The defect identification module is used to detect whether there are suspected defects based on multiple defect candidate regions; If a suspected defect exists, obtain the first feature parameter; The illumination judgment module is used to determine whether a preset illumination condition is received when performing the step of acquiring image data of the inner and outer walls of the steel pipe; If a preset lighting condition is received, multiple defect candidate regions corresponding to the received preset lighting condition are obtained, and the defect candidate regions are used as defect detection interest points. The feature extraction module is used to determine the defect feature vector based on multiple defect detection interest points, and to obtain the image coordinates when the defect feature vector is determined; The region determination module is used to determine whether the image coordinates meet the preset region range; If the image coordinates do not meet the preset region range, obtain the second feature parameter corresponding to the image coordinates; The result generation module is used to obtain the basic judgment threshold for completing defect detection, and generate the steel pipe defect detection result based on the basic judgment threshold, the first feature parameter, and the second feature parameter.

[0014] Preferably, the image acquisition module includes: The preprocessing unit is used to input image data into the preprocessing module to obtain multiple standardized images; The contour extraction unit is used to obtain edge contour information based on the standardized image, and to obtain multiple contour gradient values ​​based on the edge contour information; The region filtering unit is used to sequentially traverse and filter out multiple valid contour regions whose contour gradient values ​​satisfy a preset gradient threshold. An image segmentation unit is used to segment multiple standardized images according to multiple effective contour regions until the segmentation of multiple standardized images is completed, thereby obtaining multiple defect candidate regions. The data integration unit is used to treat multiple defect candidate regions as multiple defect detection sub-regions and to treat the image information formed by the multiple defect detection sub-regions as image data.

[0015] The beneficial effects of the image-based method and system for detecting defects in the inner and outer walls of steel pipes provided by this invention are as follows: An image-based method for detecting defects on the inner and outer walls of steel pipes effectively improves the accuracy of defect detection through multi-step feature extraction and conditional judgment during image data processing. After acquiring image data, multiple candidate defect regions are first screened out, and then suspected defects are detected from these regions to obtain the first feature parameters. This process can initially identify areas where defects may exist and reduce interference from irrelevant information. Compared with traditional methods that directly analyze the entire image, this approach is more targeted and avoids including a large number of non-defect areas in the detection range, thereby saving computational resources and accelerating the detection speed. This method fully considers the impact of lighting conditions on image quality. By determining whether a preset lighting condition is received, the corresponding candidate defect region is used as a defect detection interest point when the condition is met. The stability of lighting conditions is crucial to ensuring clear image features. Images acquired under preset lighting conditions can more realistically reflect the actual features of defects and reduce the distortion of defect features caused by changes in lighting. Determining the defect feature vector and its corresponding image coordinates based on these interest points makes the extracted defect features more representative and provides a more reliable basis for subsequent judgments. In determining the spatial location of defect areas, this method further optimizes the accuracy of defect detection by analyzing whether the image coordinates meet the preset area range. When the image coordinates do not meet the preset area range, the corresponding second feature parameters are obtained, making the description of the defect more comprehensive. Defects at different locations have different effects on the performance of steel pipes. The preset area range is usually a key area set according to the structural characteristics and usage requirements of the steel pipe. Collecting additional feature parameters for defects outside these areas can avoid misjudgments of defects due to location factors and ensure that the detection results are more in line with actual application needs. Furthermore, this method combines a basic judgment threshold with a first feature parameter and a second feature parameter to generate detection results, overcoming the limitations of traditional fixed thresholds. The basic judgment threshold is a benchmark formed based on a large amount of historical detection data, while the first and second feature parameters reflect the specific characteristics of the current detection object. The combination of these three can comprehensively consider the defect attributes under different scenarios. Whether it is a minor scratch or a severe crack, whether it is a defect on the inner or outer wall of the steel pipe, this dynamic judgment method can make reasonable judgments based on the actual situation, reducing the probability of missed detections and false positives. Meanwhile, the overall process of this method forms a closed-loop detection system, with each step interconnected and mutually verifying each other. From the screening of candidate defect regions to the detection of suspected defects, from the judgment of lighting conditions to the acquisition of feature parameters, and finally to the generation of the final detection results, each step is based on the results of the previous step, continuously refining and optimizing the detection process. This systematic design makes the detection process more rigorous, capable of handling various complex steel pipe surface conditions, and adapting to the detection needs of steel pipes of different materials and specifications, thus possessing strong practical value in industrial production. Attached Figure Description

[0016] To more clearly illustrate the technical solutions in the embodiments of this application, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0017] Figure 1 This is a schematic diagram illustrating the working principle of the image-based steel pipe inner and outer wall defect detection method described in this invention. Figure 2 A flowchart outlining the steps for obtaining image data of the inner and outer walls of a steel pipe; Figure 3 This is a flowchart for suspected defect detection and feature parameter acquisition. Figure 4 Flowchart for determining the image coordinates of the defect feature vector; Figure 5 A flowchart of the steps to generate steel pipe defect detection results. Detailed Implementation

[0018] In the following description, specific details such as particular system architectures and techniques are set forth for illustrative purposes and not for limitation, in order to provide a thorough understanding of the embodiments of this application. However, those skilled in the art will understand that this application may also be implemented in other embodiments without these specific details. In other instances, detailed descriptions of well-known systems, apparatuses, circuits, and methods have been omitted so as not to obscure the description of this application with unnecessary detail.

[0019] To make the objectives, technical solutions, and advantages of this application clearer, the following description will be provided in conjunction with the accompanying drawings and specific embodiments.

[0020] Please see Figure 1 This invention provides an image-based method for detecting defects on the inner and outer walls of steel pipes, the method comprising: Image data of the inner and outer walls of the steel pipe is acquired, wherein the image data includes multiple defect candidate regions. An initial image is obtained by capturing images of the inner and outer walls of the steel pipe from all angles using an image acquisition device. After preprocessing and region segmentation, multiple regions that may contain defects are extracted from the initial image; these are the defect candidate regions. These regions together constitute the image data used for subsequent detection.

[0021] The system detects the presence of potential defects based on multiple candidate defect regions. The extracted candidate defect regions are compared with known standard defect features, and the differences between the features are calculated to determine whether each candidate region contains a potential defect that does not meet the standards.

[0022] If a suspected defect is found, the first feature parameter is obtained. When a suspected defect is detected in a candidate defect region, the feature parameters related to the defect in that region are extracted as one of the important bases for subsequent defect judgment.

[0023] When performing the step of acquiring image data of the inner and outer walls of the steel pipe, it is determined whether preset lighting conditions are received. During the image data acquisition process, the lighting conditions are monitored in real time to determine whether the current lighting meets the preset standard lighting conditions, as lighting conditions affect image quality and the accuracy of defect detection.

[0024] If a preset lighting condition is received, multiple candidate defect regions corresponding to the received lighting condition are acquired, and these candidate regions are used as points of interest for defect detection. When the lighting condition meets the preset requirements, the quality of the acquired image is higher, and the corresponding candidate defect regions are more valuable for reference. These regions are identified as the key focus of defect detection, i.e., points of interest for defect detection.

[0025] A defect feature vector is determined based on multiple defect detection interest points, and the image coordinates at the time of determination are obtained. Feature analysis is performed on each defect detection interest point, and its feature information is integrated into a defect feature vector. Simultaneously, the specific coordinate position of the corresponding feature vector in the image is recorded.

[0026] It is determined whether the image coordinates meet a preset area range. The preset area range is defined based on the structure of the steel pipe and the possible locations of defects. By determining whether the image coordinates corresponding to the feature vector are within this range, valuable defect information is further filtered out.

[0027] If the image coordinates do not meet the preset region range, the second feature parameter corresponding to the image coordinates is obtained. When the image coordinates are not within the preset region range, the feature parameter related to the region position corresponding to the coordinate position is extracted as a supplementary judgment basis.

[0028] The basic judgment threshold for completing defect detection is obtained, and the defect detection results of the steel pipe are generated based on the basic judgment threshold, the first feature parameter, and the second feature parameter. The basic judgment threshold is set based on a large amount of historical detection data and standards. Combined with the first feature parameter and the second feature parameter obtained above, through comprehensive calculation and analysis, the detection results such as whether there are defects on the inner and outer walls of the steel pipe and the specific details of the defects are finally obtained.

[0029] Example 1: Please refer to Figure 2 The process of acquiring image data of the inner and outer walls of steel pipes begins with inputting the image data into a preprocessing module to obtain multiple standardized images. The preprocessing module performs various processing steps on the initially acquired images, such as adjusting the image size to a uniform specification to avoid size differences caused by varying shooting distances or angles; converting the images to grayscale to reduce data volume while retaining crucial brightness information; and normalizing the grayscale values ​​to map the grayscale values ​​of pixels in the image to a specific range, eliminating the impact of grayscale value fluctuations under different lighting conditions. After these processing steps, the initially inconsistent images are transformed into standardized images with a uniform format and stable features, providing a consistent foundation for subsequent edge detection and region analysis.

[0030] Edge contour information is obtained from a standardized image, and multiple contour gradient values ​​are derived based on this information. The Sobel operator is used for edge detection on the standardized image. The Sobel operator calculates the gradient changes of pixels by sliding a specific convolution kernel across the image. Horizontal and vertical gradient values ​​are calculated separately. The horizontal convolution kernel primarily detects horizontal edge changes, while the vertical convolution kernel detects vertical edge changes. During the calculation, the horizontal gradient value of each pixel is derived from the gray-level difference between that pixel and its neighboring pixels in the horizontal direction, while the vertical gradient value is based on the gray-level difference in the vertical direction. The horizontal and vertical gradient values ​​are then combined using a square root operation to obtain a composite gradient value. This composite gradient value integrates gradient information from both directions, providing a more comprehensive reflection of the edge strength at the pixel. This composite gradient value is used as the contour gradient value in the edge contour information, and its magnitude directly reflects the sharpness and magnitude of edge changes.

[0031] Multiple valid contour regions whose contour gradient values ​​satisfy a preset gradient threshold are sequentially traversed and filtered. The preset gradient threshold is set based on the edge characteristics of normal edges and potentially defective edges on the inner and outer walls of the steel pipe, and its value is determined based on statistical analysis of a large number of sample images. The contour gradient values ​​corresponding to each pixel in the standardized image are traversed, and regions corresponding to gradient values ​​greater than or equal to the preset gradient threshold are marked. These regions have more obvious edge variations and may contain contour information related to defects. For the marked regions, connectivity analysis is further performed to merge adjacent pixels with similar gradient characteristics into a continuous region, forming multiple independent contour regions. After filtering, regions with gradient values ​​lower than the preset threshold are removed, and the remaining regions are the valid contour regions, which are the focus of subsequent segmentation and analysis.

[0032] Multiple standardized images are segmented according to multiple valid contour regions until segmentation of all standardized images is complete, resulting in multiple defect candidate regions. For each standardized image, based on the boundary information of the determined valid contour regions, a region segmentation algorithm is used to divide the image into multiple sub-regions, each sub-region corresponding to a valid contour region. During segmentation, the boundaries of the valid contour regions are strictly followed to ensure that each sub-region completely contains the corresponding contour information, while avoiding overlap or omission between sub-regions. For standardized images containing multiple valid contour regions, the segmentation operation is repeated until all valid contour regions are segmented into independent sub-regions. After segmentation, these sub-regions are the defect candidate regions, and each region may contain potential defect features.

[0033] Multiple candidate defect regions are treated as multiple defect detection sub-regions, and the image information formed by these sub-regions is used as image data. Each candidate defect region is treated as a separate defect detection sub-region, concentrating information on areas in the image where defects may exist. The image information from all defect detection sub-regions is aggregated, including pixel data, contour features, and position coordinates for each sub-region, to form the image data used for subsequent defect detection. Compared to the original image, this image data removes a large amount of irrelevant background information, focusing on areas where defects may exist, thus improving the efficiency and accuracy of the subsequent detection process.

[0034] Example 2: Please refer to Figure 3The process involves detecting potential defects based on multiple candidate defect regions. If a potential defect is found, the first step in obtaining the first feature parameter is to acquire a standard defect sample library and then extract corresponding standard defect features from the library according to multiple preset defect types. The standard defect sample library contains a large number of known images and related data of defects on the inner and outer walls of steel pipes. These samples cover various common defect types, such as cracks, dents, corrosion, and scratches. For each defect type, representative features are extracted from the sample library. These features include shape features (such as length, width, area, and contour), texture features (such as surface roughness and grayscale distribution patterns), and location features (such as distance from the end of the steel pipe and circumferential distribution). By extracting and analyzing features from multiple defect samples of the same type, common features of this type of defect are summarized, forming corresponding standard defect features. Each defect type has its unique standard defect features, and these features together constitute the basic data for comparison.

[0035] Multiple candidate defect regions and standard defect features are sequentially compared and analyzed to obtain multiple feature similarity values. For each candidate defect region, it is compared one by one with each standard defect feature in the standard defect sample library. During the comparison process, various features corresponding to the standard defect features are extracted from the candidate defect region, such as the shape parameters, texture distribution, and grayscale changes of the region. These features are then compared with their corresponding items in the standard defect features. By calculating the degree of matching between each feature, the overall similarity between the candidate defect region and a certain standard defect feature is obtained, i.e., the feature similarity value. After traversing and comparing all candidate defect regions and all standard defect features, a series of corresponding feature similarity values ​​are obtained. These values ​​reflect the degree of similarity between each candidate defect region and different standard defect features.

[0036] Multiple feature dissimilarity scores are calculated sequentially based on multiple feature similarity values ​​and a preset similarity threshold. The average feature vector of the standard defect features is obtained; this vector is a comprehensive vector obtained by averaging the parameters of the standard defect features of the same type, representing the average feature level of that type of defect. Simultaneously, the feature vector of the defect candidate region is calculated, composed of the feature parameters extracted from the defect candidate region. The cosine similarity between these two vectors is used to measure their similarity. The cosine similarity reflects the consistency of vector direction by calculating the cosine of the angle between the two vectors; a larger value indicates greater similarity in the features represented by the two vectors. The difference between the obtained cosine similarity and the preset similarity threshold is calculated; the result is the feature dissimilarity score, which quantifies the difference between the features of the defect candidate region and the average level of the standard defect features.

[0037] The system sequentially checks whether multiple feature differences fall within a preset range. This preset range is set based on the normal fluctuation range of standard defect features and the accuracy requirements of actual testing; it defines an acceptable range of differences. For each calculated feature difference, it checks whether it falls within this preset range. If the feature difference is within the preset range, it indicates that the features of the candidate defect region differ little from the standard defect features, falling within the normal fluctuation range, and it can be preliminarily determined that there are no suspected defects in the region. If the feature difference exceeds the preset range, it indicates that the features of the candidate defect region differ significantly from the standard defect features and do not conform to the normal feature distribution.

[0038] If the feature difference is outside the preset range, the detection area corresponding to the feature difference is determined to have a suspected defect in the image data, and the first feature parameter is obtained. When the feature difference exceeds the preset range, it means that the features of the detection area deviate significantly from the known standard defect features, and the possibility of a potential defect is high. Therefore, the area is determined to be a suspected defect area. At this time, key feature parameters related to the defect are extracted from the suspected defect area. These parameters include the geometric dimensions of the defect (such as the image pixel values ​​corresponding to length, width, and depth), grayscale variation amplitude, edge continuity, etc. These parameters can specifically describe the features of the suspected defect and are used as the first feature parameter, providing important feature basis for the subsequent generation of defect detection results.

[0039] Example 3: The process of acquiring multiple candidate defect regions corresponding to the received preset lighting conditions first involves acquiring ambient lighting data collected in real time during image acquisition. An illumination compensation algorithm is then used to eliminate interference signals outside the preset lighting range in the ambient lighting data, yielding valid lighting data. When the image acquisition device is operating, a lighting sensor is simultaneously activated to record ambient lighting data such as light intensity, light angle, and spectral distribution at the acquisition site in real time. This data may contain interference signals caused by sudden light sources, equipment vibration, or instantaneous changes in ambient light, requiring processing by the illumination compensation algorithm. The illumination compensation algorithm first sets a preset lighting range, determined based on the image quality requirements for steel pipe defect detection, covering a suitable light intensity range and a stable spectral distribution range. The algorithm analyzes the acquired ambient lighting data point by point, marking data exceeding the preset lighting range as interference signals, and eliminating or correcting them through smoothing filtering, baseline correction, etc., ultimately obtaining valid lighting data that conforms to the preset lighting range. This data accurately reflects the actual valid lighting conditions during image acquisition.

[0040] Image enhancement techniques are used to adjust the contrast of effective illumination data to obtain optimized image data. Image enhancement improves the visual effect of images by processing the images corresponding to effective illumination data, highlighting potential defect features. To address issues such as insufficient image contrast and blurred details that may occur under different lighting conditions, methods such as histogram equalization and adaptive contrast enhancement are employed to adjust the grayscale distribution of pixels in the image, making details in dark areas clearer and suppressing overexposure in bright areas. After processing, the overall contrast of the image is improved, and the difference between defective and normal areas becomes more obvious, forming optimized image data that provides a more reliable basis for subsequent sharpness assessment.

[0041] The relationship between optimized image data and a preset sharpness threshold is determined. The preset sharpness threshold is determined by analyzing a large number of clear steel pipe defect images and extracting image sharpness feature parameters (such as edge sharpness and detail information). It is used to measure whether the image is sharp enough for accurate defect detection. By calculating the sharpness feature parameters of the optimized image data and comparing them with the preset sharpness threshold, it is determined whether the image data's sharpness meets the detection requirements.

[0042] If the optimized image data falls within the sharpness threshold range and the number of consecutive frames exceeds the preset stable frame count, the lighting conditions corresponding to the optimized image data are determined to be valid preset lighting conditions. During image acquisition, brief fluctuations in lighting may occur, causing a few frames to meet the sharpness standard, but this is not considered stable and valid lighting. Therefore, it is necessary to continuously monitor the optimized image data falling within the sharpness threshold range and count the number of consecutive frames that meet the standard. When the number of consecutive frames that meet the standard exceeds the preset stable frame count, it indicates that the lighting conditions are in a stable and valid state, ensuring the consistency of image quality. At this point, the corresponding lighting conditions are determined to be valid preset lighting conditions.

[0043] Based on the received preset lighting conditions, an image acquisition time window is obtained, and multiple first-stage defect candidate regions are identified within that time window. After determining the valid preset lighting conditions, the start and end times of these conditions are recorded; the interval between these two times constitutes the image acquisition time window. Images acquired within this time window, due to stable and effective lighting conditions, contain defect candidate regions that are more valuable for analysis. Defect candidate regions corresponding to all images within this time window are extracted from the image database; these regions are called first-stage defect candidate regions, and they form the basis for subsequent screening.

[0044] The center point of the steel pipe and the preset radius for calculating the pipe diameter are obtained. The preset radius is then extended from the center point towards the preset pipe wall direction to obtain a target detection ring. The corresponding inner and outer wall regions are then obtained based on this target detection ring. By performing edge detection and Hough transform on the steel pipe image, the circumferential contour of the steel pipe is identified, thereby determining the center point and diameter. Based on the steel pipe's design standards and inspection requirements, a scaling factor k is set, and the formula for calculating the preset radius r is: r = diameter of steel pipe × k Where r is the preset radius, and k is a proportional coefficient determined based on the detection accuracy and steel pipe type, with a value selected between 0 and 0.5 according to actual conditions. Starting from the center position, the preset radius r is extended a certain width towards the preset pipe wall direction (inner or outer wall direction) to form a ring-shaped area, i.e., the target detection ring. The inner and outer boundaries of this ring correspond to the approximate positions of the inner and outer walls of the steel pipe, respectively. Therefore, the area covered by the target detection ring is the inner and outer wall area of ​​the steel pipe that needs to be inspected.

[0045] Based on the inner and outer wall regions, multiple first defect candidate regions are filtered to determine their regional affiliation, resulting in multiple second defect candidate regions located within the inner and outer wall regions of a preset detection ring. These second defect candidate regions are then used as multiple defect candidate regions. For each first defect candidate region, its coordinate position in the image is used to determine whether it falls within the inner or outer wall region corresponding to the target detection ring. The distance from the center coordinates of the first defect candidate region to the center of the steel pipe is calculated. If this distance is within the radius of the target detection ring, the region is determined to belong to the inner or outer wall region. After filtering, first defect candidate regions located outside the target detection ring are removed, and the remaining regions are the second defect candidate regions. These second defect candidate regions are concentrated in the inner and outer wall regions of the steel pipe, which corresponds to the actual distribution location of defects in the steel pipe. They are used as the final defect candidate regions for subsequent defect feature analysis and judgment.

[0046] Example 4: Please refer to Figure 4The process of obtaining image coordinates when determining defect feature vectors first involves acquiring the coordinates of corresponding feature points based on the defect feature vectors, and then obtaining the starting and ending coordinates of the region based on these coordinates. The defect feature vector is a digital integration of various features of the defect region, covering aspects such as the defect's shape, texture, and grayscale variations. Each feature vector corresponds to several key feature points in the image. These feature points are the pixels in the defect region that best represent the defect's characteristics, such as the endpoints of cracks or the inflection points of depressions. Image recognition algorithms extract the coordinate information of these feature points in the image. The coordinate information is in pixels, consisting of the horizontal x-value and the vertical y-value. After acquiring all feature point coordinates, these coordinates are analyzed to identify the two points with the smallest and largest horizontal values, which are then used as the starting and ending x-coordinates of the region, respectively. Similarly, the two points with the smallest and largest vertical y-values ​​are identified as the starting and ending y-coordinates of the region. These starting and ending coordinates together delineate the approximate extent of the defect region in the image.

[0047] The defect region boundary is obtained by integrating the starting and ending coordinates of the region. The starting x-coordinate, ending x-coordinate, starting y-coordinate, and ending y-coordinate are combined to form a rectangular boundary frame. The top-left vertex of this frame is (starting x-coordinate, starting y-coordinate), and the bottom-right vertex is (ending x-coordinate, ending y-coordinate). This rectangular boundary is not simply a selection of feature point coordinates, but is adjusted through density analysis of the feature point distribution and edge continuity judgment to ensure that the boundary completely surrounds all feature points while excluding surrounding irrelevant normal areas. For example, when the defect is an irregular elongated shape, the starting and ending coordinates may not perfectly match the defect edge. In this case, the boundary needs to be stretched or contracted according to the distribution trend of the feature points to make the defect region boundary more closely match the actual defect contour and accurately delineate the image area where the defect is located.

[0048] The center coordinates of the defect region are obtained based on its boundary, and these coordinates are used as the image coordinates for determining the defect feature vector. Within the defined defect region boundary, the geometric center of the region enclosed by the boundary is calculated. The center coordinates in the horizontal direction are obtained by adding the initial x-coordinate and the final x-coordinate, and dividing by 2. Similarly, the center coordinates in the vertical direction are obtained by adding the initial y-coordinate and the final y-coordinate, and dividing by 2. The coordinates formed by these two values ​​are the center coordinates of the region, located at the geometric center of the defect region, representing the position of the entire defect region in the image. For example, if the initial x-coordinate of the defect region boundary is 100, the final x-coordinate is 200, the initial y-coordinate is 50, and the final y-coordinate is 150, then the center coordinates are (150, 100), accurately identifying the core position of the defect region in the image. Using these center coordinates as the image coordinates corresponding to the defect feature vector provides a clear locational basis for subsequent determination of whether the defect is within a preset area, making the transmission of location information more accurate and efficient throughout the defect detection process.

[0049] Example 5: Please refer to Figure 5 The process of obtaining the basic judgment threshold for completing defect detection and generating steel pipe defect detection results based on the basic judgment threshold, the first feature parameter, and the second feature parameter first involves obtaining the standard wall thickness parameter of the steel pipe being inspected. The standard wall thickness parameter is a value determined according to the steel pipe's model, material, and design standards. This value is clearly defined in the design specifications before the steel pipe is produced. For example, the standard wall thickness parameter of a certain model of steel pipe may be a specific number of millimeters. This parameter is one of the basic indicators for measuring whether the steel pipe meets the production standards and directly reflects the structural thickness that the steel pipe should have.

[0050] Obtain the actual wall thickness parameters of the steel pipe under inspection. By analyzing the acquired steel pipe images, the actual wall thickness is calculated using the pixel distance between the pipe edges and a preset pixel size conversion ratio. The edge lines of the inner and outer walls of the steel pipe are identified in the image, the pixel distance between the two edge lines is measured, and then converted into actual millimeters based on the conversion relationship between pixels and actual length, thus obtaining the actual wall thickness parameters. These parameters reflect the current actual thickness of the steel pipe.

[0051] The wall thickness correction coefficient is obtained based on the standard wall thickness parameters and the actual wall thickness parameters. By comparing the differences between the standard and actual wall thickness parameters, a specific algorithm is used to calculate the wall thickness correction coefficient. For example, when the actual wall thickness parameter is greater than the standard wall thickness parameter, the wall thickness correction coefficient may be greater than 1, used to adjust the impact of excessive wall thickness on defect assessment; when the actual wall thickness parameter is less than the standard wall thickness parameter, the wall thickness correction coefficient may be less than 1, reflecting the adjustment needs for defect assessment in cases of insufficient wall thickness. This coefficient can adaptively correct subsequent defect assessments based on the deviation between the actual and standard thickness of the steel pipe.

[0052] The first feature score of suspected defects is obtained based on historical defect data, and the corresponding first feature weight is determined based on the first feature score. Historical defect data contains a large number of defect cases recorded in past inspections, each case labeled with defect feature information and the final judgment result. For suspected defects, defect cases with similar characteristics are selected from the historical data, and the severity and scope of the defect features in these cases are analyzed. Based on this, corresponding scores, i.e., first feature scores, are assigned to each feature of the current suspected defect. For example, for suspected crack defects, the length, width, and other features have different degrees of influence in the historical data; the first feature score is determined based on these degrees of influence. Then, the corresponding first feature weight is determined based on the magnitude of the first feature score. The higher the score, the greater the influence of the feature in defect judgment, and the greater the corresponding first feature weight. The weight value is determined based on the proportion of the score in the sum of all feature scores.

[0053] The feature parameters corresponding to the first feature weight are used as the first feature parameters. The first feature parameters are specific feature indices corresponding to the first feature weight. These indices directly describe the inherent characteristics of the suspected defects, such as the length of the crack, the depth of the depression, and the area of ​​the corrosion region. These parameters are extracted through image analysis of the suspected defect area and are an important basis for calculating the defect assessment value.

[0054] The second feature score is obtained based on the location deviation of the area according to historical defect data, and the corresponding second feature weight is obtained based on the second feature score. Referring to the impact of defects with different location deviations on the overall performance of the steel pipe in the historical defect data, the degree of deviation between the current suspected defect location and the preset normal area is scored to obtain the second feature score. For example, if the suspected defect is located near the critical stress area of ​​the steel pipe, its location deviation has a greater impact, and the corresponding second feature score is higher; if it is located in a non-critical area, the score is lower. The second feature weight is determined according to the magnitude of the second feature score. The higher the score, the greater the impact of the location deviation on the defect judgment, and the greater the second feature weight. The weight is determined in a similar way to the first feature weight, based on the relative importance of the score.

[0055] The feature parameters corresponding to the second feature weights are used as the second feature parameters. The second feature parameters are specific indicators describing the deviation of the suspected defect location, such as the distance between the defect center coordinates and the preset normal area center coordinates, the angle of the defect area deviating from the normal area, etc. These parameters are obtained by analyzing and calculating the defect location coordinates and are used to reflect the influence of the defect location on the detection results.

[0056] The comprehensive defect assessment value is obtained based on the basic judgment threshold, the first feature score, the first feature weight, the second feature score, the second feature weight, and the wall thickness correction coefficient. The basic judgment threshold is a critical value set based on a large amount of historical inspection data of qualified and unqualified steel pipes, used to determine whether the defect reaches a level requiring attention. The first feature score is multiplied by the first feature weight to obtain the weighted score of the first feature; the second feature score is multiplied by the second feature weight to obtain the weighted score of the second feature; the two weighted scores are added together and then multiplied by the wall thickness correction coefficient to obtain the corrected weighted total score; finally, this total score is compared with the basic judgment threshold to obtain the comprehensive defect assessment value. This assessment value integrates the inherent characteristics of the defect, the influence of location, and wall thickness deviation, and can comprehensively reflect the defect status of the steel pipe, thereby generating the final steel pipe defect detection result.

[0057] The above are merely specific embodiments of this application, but the scope of protection of this application is not limited thereto. Any person skilled in the art can easily conceive of various equivalent modifications or substitutions within the technical scope disclosed in this application, and these modifications or substitutions should all be covered within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.

Claims

1. A method for detecting defects on the inner and outer walls of steel pipes based on images, characterized in that, include: Image data of the inner and outer walls of the steel pipe are acquired, wherein the image data includes multiple defect candidate regions; The presence of suspected defects is detected based on multiple candidate defect regions. If a suspected defect exists, obtain the first feature parameter; When performing the step of acquiring image data of the inner and outer walls of the steel pipe, determine whether the preset lighting conditions are received; If a preset lighting condition is received, multiple defect candidate regions corresponding to the received preset lighting condition are obtained, and the defect candidate regions are used as defect detection interest points. Determine the defect feature vector based on multiple defect detection interest points, and obtain the image coordinates at the time the defect feature vector is determined; Determine whether the image coordinates meet the preset area range; If the image coordinates do not meet the preset region range, obtain the second feature parameter corresponding to the image coordinates; Obtain the basic judgment threshold for completing defect detection, and generate the steel pipe defect detection result based on the basic judgment threshold, the first feature parameter, and the second feature parameter.

2. The image-based method for detecting defects in the inner and outer walls of steel pipes according to claim 1, characterized in that, The step of acquiring image data of the inner and outer walls of the steel pipe includes: Image data is input into the preprocessing module to obtain multiple standardized images; Edge contour information is obtained from the standardized image, and multiple contour gradient values ​​are obtained based on the edge contour information; The system sequentially traverses and filters out multiple valid contour regions whose contour gradient values ​​satisfy a preset gradient threshold. The multiple standardized images are segmented according to the multiple effective contour regions until the segmentation of the multiple standardized images is completed, thereby obtaining multiple defect candidate regions; Multiple defect candidate regions are used as multiple defect detection sub-regions, and the image information formed by the multiple defect detection sub-regions is used as image data.

3. The image-based method for detecting defects in the inner and outer walls of steel pipes according to claim 1, characterized in that, The step of detecting whether there is a suspected defect based on multiple defect candidate regions, and obtaining a first feature parameter if a suspected defect exists, includes: Obtain a standard defect sample library, and obtain multiple standard defect features corresponding to the standard defect sample library according to multiple preset defect types; Multiple candidate defect regions and multiple standard defect features are sequentially compared and analyzed to obtain multiple feature similarity values; Multiple feature differences are calculated sequentially based on the multiple feature similarity values ​​and a preset similarity threshold; Sequentially determine whether the differences in multiple features are within a preset difference range; If the feature difference degree is not within the preset difference range, it is determined that the detection area corresponding to the feature difference degree has a suspected defect in the image data, and the first feature parameter is obtained.

4. The image-based method for detecting defects in the inner and outer walls of steel pipes according to claim 1, characterized in that, The step of obtaining multiple candidate defect regions corresponding to the received preset illumination conditions includes: The ambient lighting data acquired in real time during the image acquisition process is obtained, and the interference signals outside the preset lighting range in the ambient lighting data are eliminated based on the lighting compensation algorithm to obtain effective lighting data. Based on image enhancement technology, the contrast of effective illumination data is adjusted to obtain optimized image data; Determine the relationship between the optimized image data and the preset sharpness threshold; If the optimized image data falls within the sharpness threshold range and the number of consecutive frames exceeds the preset stable frame number, then the lighting conditions corresponding to the optimized image data are determined as valid received preset lighting conditions. Based on the received preset lighting conditions, an image acquisition time window is obtained, and multiple first defect candidate regions within the corresponding time window are obtained based on the image acquisition time window. Obtain the center point of the steel pipe and the preset radius calculated from the diameter of the steel pipe, and extend the preset radius from the center point toward the preset pipe wall to obtain the target detection ring, and obtain the corresponding inner and outer wall areas based on the target detection ring; Based on the inner and outer wall regions, multiple first defect candidate regions are screened for region affiliation to obtain multiple second defect candidate regions located in the inner and outer wall regions of the preset detection ring, and these multiple second defect candidate regions are used as multiple defect candidate regions.

5. The image-based method for detecting defects in the inner and outer walls of steel pipes according to claim 1, characterized in that, The step of obtaining the image coordinates when determining the defect feature vector includes: Based on the defect feature vector, obtain the corresponding feature point coordinate information, and based on the feature point coordinate information, obtain the region start coordinates and region end coordinates; The boundary of the defect region is obtained by integrating the starting coordinates and ending coordinates of the region. The coordinates of the center of the defect region are obtained based on the boundary of the defect region, and these coordinates are used as the image coordinates when determining the defect feature vector.

6. The image-based method for detecting defects in the inner and outer walls of steel pipes according to claim 1, characterized in that, The step of obtaining the basic judgment threshold for completing defect detection and generating the steel pipe defect detection result based on the basic judgment threshold, the first feature parameter, and the second feature parameter includes: Obtain the standard wall thickness parameters for the current steel pipe inspection; Obtain the actual wall thickness parameters of the current steel pipe inspection; The wall thickness correction coefficient is obtained based on the standard wall thickness parameters and the actual wall thickness parameters; The first feature score of the suspected defect is obtained based on historical defect data, and the corresponding first feature weight is obtained based on the first feature score. The feature parameter corresponding to the first feature weight is used as the first feature parameter; The second feature score of the regional location deviation is obtained based on historical defect data, and the corresponding second feature weight is obtained based on the second feature score; Use the feature parameters corresponding to the second feature weights as the second feature parameters; The comprehensive defect assessment value is obtained based on the basic judgment threshold, the first feature score, the first feature weight, the second feature score, the second feature weight, and the wall thickness correction coefficient.

7. The image-based method for detecting defects in the inner and outer walls of steel pipes according to claim 2, characterized in that, The step of obtaining edge contour information based on the standardized image includes: The Sobel operator is used to perform edge detection on the standardized image, and the gradient values ​​in the horizontal and vertical directions are calculated respectively. The horizontal and vertical gradient values ​​are combined using a square root operation to obtain a composite gradient value, which is then used as the contour gradient value in the edge contour information.

8. The image-based method for detecting defects in the inner and outer walls of steel pipes according to claim 3, characterized in that, The step of calculating multiple feature differences based on the multiple feature similarity values ​​and a preset similarity threshold sequentially includes: Obtain the average feature vector of the standard defect features, and calculate the cosine similarity between the feature vector of the defect candidate region and the average feature vector; The feature difference is obtained by subtracting the cosine similarity from the preset similarity threshold.

9. An image-based steel pipe inner and outer wall defect detection system, used to implement the image-based steel pipe inner and outer wall defect detection method as described in any one of claims 1 to 8, characterized in that, include: An image acquisition module is used to acquire image data of the inner and outer walls of the steel pipe, wherein the image data includes multiple defect candidate regions; The defect identification module is used to detect whether there are suspected defects based on multiple defect candidate regions; If a suspected defect exists, obtain the first feature parameter; The illumination judgment module is used to determine whether a preset illumination condition is received when performing the step of acquiring image data of the inner and outer walls of the steel pipe; If a preset lighting condition is received, multiple defect candidate regions corresponding to the received preset lighting condition are obtained, and the defect candidate regions are used as defect detection interest points. The feature extraction module is used to determine the defect feature vector based on multiple defect detection interest points, and to obtain the image coordinates when the defect feature vector is determined; The region determination module is used to determine whether the image coordinates meet the preset region range; If the image coordinates do not meet the preset region range, obtain the second feature parameter corresponding to the image coordinates; The result generation module is used to obtain the basic judgment threshold for completing defect detection, and generate the steel pipe defect detection result based on the basic judgment threshold, the first feature parameter, and the second feature parameter.

10. The image-based steel pipe inner and outer wall defect detection system according to claim 9, characterized in that, The image acquisition module includes: The preprocessing unit is used to input image data into the preprocessing module to obtain multiple standardized images; The contour extraction unit is used to obtain edge contour information based on the standardized image, and to obtain multiple contour gradient values ​​based on the edge contour information; The region filtering unit is used to sequentially traverse and filter out multiple valid contour regions whose contour gradient values ​​satisfy a preset gradient threshold. An image segmentation unit is used to segment multiple standardized images according to multiple effective contour regions until the segmentation of multiple standardized images is completed, thereby obtaining multiple defect candidate regions. The data integration unit is used to treat multiple defect candidate regions as multiple defect detection sub-regions and to treat the image information formed by the multiple defect detection sub-regions as image data.

Citation Information

Patent Citations

  • Steel pipe defect intelligent detection method based on image enhancement

    CN117173180A

  • Pipeline magnetic flux leakage signal detection method and system, and electronic equipment

    CN120275490A

  • Defect determination device of steel pipe outer surface

    JP2023075014A