An internal thread defect detection system
By combining image acquisition and processing technology with Radon transform analysis, efficient and accurate detection of internal thread defects has been achieved, solving the problem of unstable detection results in existing technologies and enabling precise quantification of the size and location of defects.
Patent Information
- Application Number
- CN202411066290.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-05
- Publication Date
- 2026-11-17
- Estimated Expiration
- 2044-08-05
AI Technical Summary
Existing internal thread defect detection technologies are difficult to accurately quantify the size and location of defects, and are easily affected by human factors, resulting in unstable detection results and limitations in accuracy and efficiency.
The system employs an image acquisition module, a preliminary processing module, an edge detection module, a Radon transform module, and a detection and analysis module. It acquires images using a fisheye wide-angle camera, performs preprocessing, distortion correction, edge detection, and Radon transform, and analyzes the distribution of local maxima to determine internal thread defects.
It achieves efficient and accurate detection of internal thread defects, can accurately quantify the size and location of defects, reduce the influence of human factors, and provides stable detection results.
Smart Images

Figure CN118691600B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of defect detection technology, specifically to an internal thread defect detection system. Background Technology
[0002] A thread is a helical, continuous, raised portion with a specific cross-section located on the external or internal surface of a pipe or part. These raised portions are arranged along a helical path, forming a threaded structure used to mate and connect with other parts that have corresponding external threads. Regardless of the material, threads will develop defects over time, significantly reducing product lifespan and potentially causing harm to production and daily life. Therefore, it is essential to regularly inspect threads to promptly identify defects and non-conformities, and take appropriate measures for repair or replacement to avoid product failures or safety accidents caused by thread problems.
[0003] For example, patent application number 202410342626.4 discloses a highly efficient internal thread defect detection system that achieves precise capture of the entire internal thread panorama, thereby significantly improving the range and efficiency of image acquisition. By precisely controlling the stepper motor, it achieves high-definition image acquisition of the target object from multiple angles and different distances, enhancing the diversity and accuracy of imaging. Moreover, for the specific lighting needs of internal threaded pipes, it uses a ring-shaped LED light strip that goes deep along with the fisheye camera, providing optimal lighting evenly within the effective field of view of the fisheye camera. In addition, it not only coordinates the work of the camera and the stepper motor, but also processes the acquired image data and provides real-time feedback to optimize shooting parameters and image quality. Combined with the computing power of a microcomputer, it performs real-time processing and analysis of the acquired images and automatically adjusts the shooting parameters to achieve the best image quality.
[0004] However, existing testing systems similar to those mentioned above still have the following shortcomings:
[0005] While there are various techniques available for detecting defects in internal threads, and these techniques can meet basic requirements to some extent, they are all relatively traditional and difficult to accurately quantify the size and location of defects. This leads to certain errors in the detection results, and the results are easily affected by human factors, resulting in unstable detection results and limitations in accuracy and efficiency.
[0006] Therefore, there is an urgent need to improve this shortcoming. The present invention studies and improves the existing technology and its shortcomings, and provides an internal thread defect detection system. Summary of the Invention
[0007] The purpose of this invention is to provide an internal thread defect detection system to solve the problems mentioned in the background art.
[0008] To achieve the above objectives, the present invention provides the following technical solution: an internal thread defect detection system, comprising:
[0009] The image acquisition module acquires images of the internal thread to be tested by taking pictures with a fisheye wide-angle camera.
[0010] The preliminary processing module is responsible for performing preliminary processing on the original image to provide high-quality image input for subsequent advanced image processing and analysis.
[0011] An edge detection module is responsible for performing edge detection (binarization) on the obtained internal thread image.
[0012] The Radon transform module is responsible for performing Radon transform on the edge image to obtain a two-dimensional array distribution of points and lines at different angles and distances (each straight line corresponds to a two-dimensional array of angles and distances), where the brighter points are local maxima (energy accumulation points).
[0013] The detection and analysis module is responsible for detecting and analyzing the internal thread. The angle of the local maximum (energy accumulation point) of the expected two-dimensional array is a fixed value. Therefore, there is one and only one local maximum (energy accumulation point). If the local maximum (energy accumulation point) is distributed in a position greater than one angle, then other local maximums (energy accumulation points) besides the main angle distribution are considered to be places where noise or defects exist.
[0014] The result output module is responsible for outputting the judgment result of the internal thread defect detection, and the output judgment result 1 indicates a defect and 0 indicates no defect.
[0015] Furthermore, the preliminary processing module specifically includes the following sub-modules:
[0016] The preprocessing submodule utilizes image processing techniques to enhance the original image (by adjusting parameters such as brightness, contrast, and sharpness to enhance useful information in the image while suppressing or removing unnecessary noise and interference), filter noise (using filters to remove random noise from the image and reduce its impact on subsequent processing steps), and perform histogram equalization (adjusting the histogram distribution of the image to make the brightness distribution more uniform and improve the image contrast), thereby improving image quality and increasing the efficiency and accuracy of subsequent processing.
[0017] Distortion calibration submodule: Utilizes known calibration methods and techniques to estimate distortion parameters in the preprocessed image;
[0018] Distortion Correction Submodule: Based on distortion parameters, it uses distortion correction technology to perform geometric correction on the image, remapping each pixel in the image to eliminate or reduce image distortion and deformation caused by distortion.
[0019] Furthermore, the distortion correction submodule determines the distortion correction method based on the thread type, hardware design relationship, and selected camera characteristics, and distortion correction only needs to be performed once, without the need for repeated correction judgments.
[0020] Furthermore, the edge detection module specifically includes the following sub-modules:
[0021] Binarization submodule: Uses an adaptive threshold to binarize the thread image to obtain the stripe feature image of the thread image;
[0022] The pass / fail determination submodule is used to determine whether the proportion of 1 pixels in the 0-1 image exceeds 35%. If it does, the edge image obtained by binarization is considered a valid image and is sent to the Radon transform module. Otherwise, the image is considered an invalid image and the threshold adjustment submodule is triggered.
[0023] Threshold adjustment submodule: Used to adjust the adaptive threshold and feed it back to the binarization submodule.
[0024] Furthermore, the Radon transform uses a set of parameters (θ, ρ) to represent a straight line. When a certain direction is selected, an image is transformed into a straight line as a function of ρ, as shown in the formula:
[0025]
[0026] The essence of Radon transform is to project onto a line segment with a normal direction of θ along multiple parallel rays determined by xcosθ + ysinθ = ρ. The method is to rotate the image uniformly by an angle of θ and then calculate the projection on the x-axis. Assuming that the angle interval [0 to π] is divided into n parts and the length of the projected line segment is m, we finally obtain a two-dimensional matrix of size m×n, which is called the projection matrix.
[0027] Furthermore, the detection and analysis module analyzes the angle distribution of the two-dimensional array. When the angle distribution accounts for more than 85%, that is, when the value in the two-dimensional array is greater than 85% of the maximum value, it can be considered as representing a region where the texture direction is concentrated. In the new matrix, it is marked as 1, and the remaining data is marked as 0. The point marked as 1 represents the straight line direction angle of the corresponding edge image and the location of the straight line.
[0028] Furthermore, the detection and analysis module analyzes the distribution of 1 and 0 in the new matrix and outputs the 10 two-dimensional arrays with the highest correlation between 1 and texture direction in the new matrix. These two-dimensional arrays represent the thread distribution at different positions in the same direction.
[0029] Furthermore, the thread defect determination logic of the detection and analysis module is based on uneven numerical energy distribution, and thread defects include the following manifestations:
[0030] If the local maxima (energy accumulation points) are not distributed at the same angle, that is, if 0 exists in the new matrix, then the defects are corrosion, scratches, cuts, etc.
[0031] If the distances between local maxima (energy accumulation points) are not equidistant, that is, the distances in the two-dimensional array are not increasing, then the defect is a missing tooth.
[0032] This invention provides an internal thread defect detection system, which has the following advantages:
[0033] This invention preprocesses, calibrates, and corrects distortion in images of the internal thread to be tested, eliminating image distortion and deformation caused by distortion. Binarization is then used to obtain effective edge images. Furthermore, Radon transform is applied to obtain a two-dimensional array distribution of points and lines at different angles and distances. The distribution of local maxima (energy accumulation points) is analyzed to determine the detection result of internal thread defects, achieving accurate detection. Compared to existing detection technologies, the internal thread defect detection system provided by this invention not only has high detection efficiency but also high accuracy, precisely quantifying the size and location of defects to allow for appropriate repair or replacement. Moreover, it is less susceptible to human factors, resulting in more stable detection results. Attached Figure Description
[0034] Figure 1 This is a logic block diagram of an internal thread defect detection system according to the present invention;
[0035] Figure 2 This is a flowchart of the detection process of an internal thread defect detection system according to the present invention;
[0036] Figure 3 This is the original thread image of the internal thread defect detection system of the present invention;
[0037] Figure 4 This is an image after edge detection (binarization) of the thread image in the internal thread defect detection system of the present invention;
[0038] Figure 5 This invention provides a two-dimensional distribution of a thread image after Radon transformation at different angles and distances in an internal thread defect detection system. Detailed Implementation
[0039] The embodiments of the present invention will be described in further detail below with reference to the accompanying drawings and examples. The following examples are for illustrative purposes only and should not be construed as limiting the scope of the invention.
[0040] like Figures 1-5 As shown, an internal thread defect detection system includes:
[0041] Image acquisition module: Captures images of the internal thread under test using a fisheye wide-angle camera;
[0042] Preliminary processing module: Responsible for performing preliminary processing on the raw images, providing high-quality image input for subsequent advanced image processing and analysis; specifically includes the following sub-modules:
[0043] The preprocessing submodule utilizes image processing techniques to enhance the original image (by adjusting parameters such as brightness, contrast, and sharpness to enhance useful information in the image while suppressing or removing unnecessary noise and interference), filter noise (using filters to remove random noise from the image and reduce its impact on subsequent processing steps), and perform histogram equalization (adjusting the histogram distribution of the image to make the brightness distribution more uniform and improve the image contrast), thereby improving image quality and increasing the efficiency and accuracy of subsequent processing.
[0044] Distortion calibration submodule: Utilizes known calibration methods and techniques to estimate distortion parameters in the preprocessed image;
[0045] Distortion correction submodule: Based on distortion parameters, it uses distortion correction technology to perform geometric correction on the image, remapping each pixel in the image to eliminate or reduce image distortion and deformation caused by distortion; the distortion correction submodule determines the distortion correction method according to the thread type, hardware design relationship and selected camera characteristics, and distortion correction only needs to be done once, without the need for repeated correction judgment;
[0046] The edge detection module is responsible for performing edge detection (binarization) on the obtained internal thread image; it specifically includes the following sub-modules:
[0047] Binarization submodule: Uses an adaptive threshold to binarize the thread image to obtain the stripe feature image of the thread image;
[0048] The pass / fail determination submodule is used to determine whether the proportion of 1 pixels in the 0-1 image exceeds 35%. If it does, the edge image obtained by binarization is considered a valid image and is sent to the Radon transform module. Otherwise, the image is considered an invalid image and the threshold adjustment submodule is triggered.
[0049] Threshold adjustment submodule: Used to adjust the adaptive threshold and feed it back to the binarization submodule;
[0050] The Radon transform module is responsible for performing Radon transform on the edge image to obtain a two-dimensional array distribution of points and lines at different angles and distances (each line corresponds to a two-dimensional array of angles and distances), where the brighter points are local maxima (energy accumulation points).
[0051] The Radon transform uses a set of parameters (θ, ρ) to represent a straight line. When a certain direction is selected, an image is transformed into a straight line as a function of ρ, as shown in the formula:
[0052]
[0053] The essence of Radon transform is to establish a projection onto a line segment with a normal direction of θ along multiple parallel rays determined by xcosθ + ysinθ = ρ. The implementation method is to rotate the image uniformly by an angle of θ and then calculate the projection on the x-axis. Assuming that the angle interval [0 ~ π] is divided into n parts and the length of the projected line segment is m, we finally obtain a two-dimensional matrix of size m × n, which is called the projection matrix.
[0054] The detection and analysis module is responsible for detecting and analyzing the internal thread. The angle of the local maximum (energy accumulation point) of the expected two-dimensional array is a fixed value. Therefore, there is one and only one local maximum (energy accumulation point). If the local maximum (energy accumulation point) is distributed in a position greater than one angle, then other local maximums (energy accumulation points) besides the main angle distribution are considered to be places where noise or defects exist.
[0055] The detection and analysis module analyzes the angle distribution of the two-dimensional array. When the angle distribution accounts for more than 85%, that is, when the value in the two-dimensional array is greater than 85% of the maximum value, it can be considered as a region where the texture direction is concentrated. It is marked as 1 in the new matrix, and the remaining data is marked as 0. The point marked as 1 represents the straight line direction angle of the corresponding edge image and the location of the straight line.
[0056] Analyze the distribution of 1 and 0 in the new matrix, and select the 10 two-dimensional arrays with the highest correlation between 1 and texture direction in the new matrix. These two-dimensional arrays represent the distribution of threads at different positions in the same direction.
[0057] The thread defect determination logic of the detection and analysis module is based on uneven numerical energy distribution, and the thread defects include the following manifestations:
[0058] If the local maxima (energy accumulation points) are not distributed at the same angle, that is, if 0 exists in the new matrix, then the defects are corrosion, scratches, cuts, etc.
[0059] If the distances between local maxima (energy accumulation points) are not equidistant, that is, the distances in the two-dimensional array are not increasing, then the defect is a missing tooth.
[0060] The result output module is responsible for outputting the judgment result of the internal thread defect detection, and the output judgment result is 1 for defective and 0 for no defect.
[0061] In summary, combining Figures 1-5 As shown, the usage process of this internal thread defect detection system is as follows:
[0062] Step 1: The image acquisition module captures images of the internal thread to be tested using a fisheye wide-view camera and sends them to the preliminary processing module. The preprocessing submodule of the preliminary processing module uses image processing technology to perform image enhancement, noise filtering, and histogram equalization on the original image. Then, the distortion calibration submodule estimates the distortion parameters of the preprocessed image. Finally, the distortion correction submodule performs geometric correction on the image based on the distortion parameters using distortion correction technology and sends the corrected image to the edge detection module.
[0063] Step 2: The binarization submodule of the edge detection module uses an adaptive threshold to binarize the thread image to obtain the stripe feature image of the thread image. Then, the qualified judgment submodule judges whether the proportion of 1 pixels in the image exceeds 35%. If it exceeds 35%, the edge image obtained by binarization is considered a valid image and is sent to the Radon transform module. Otherwise, the image is considered an invalid image and the threshold adjustment submodule is triggered. The threshold adjustment submodule adjusts the adaptive threshold and feeds it back to the binarization submodule.
[0064] Step 3: The Radon transform module performs a Radon transform on the edge image, obtaining a two-dimensional array distribution of points and lines at different angles and distances. Then, the detection and analysis module analyzes the angular distribution of the two-dimensional array. When the value in the two-dimensional array is greater than 85% of the maximum value, it can be considered to represent a region where the texture direction is concentrated, and it is marked as 1 in the new matrix. The remaining data is marked as 0. Then, the distribution of 1 and 0 in the new matrix is analyzed, and the 10 two-dimensional arrays with the highest correlation between 1 and texture direction in the new matrix are selected. This two-dimensional array represents the thread distribution at different positions in the same direction. The detection and analysis module determines the thread defect based on whether the numerical energy distribution is uniform. Specifically: if the local maxima are not distributed at the same angle, that is, there is 0 in the new matrix, then the defect is corrosion, scratch, or cut; if the distance between the local maxima is not equidistant, that is, the distance in the two-dimensional array is not increasing, then the defect is missing teeth.
[0065] Step 4: The result output module outputs the judgment result of the internal thread defect detection, 1 for defective and 0 for no defect.
[0066] The embodiments of the present invention are given for illustrative and descriptive purposes only, and are not intended to be exhaustive or to limit the invention to the forms disclosed. Many modifications and variations will be apparent to those skilled in the art. The embodiments were chosen and described in order to better illustrate the principles and practical application of the invention, and to enable those skilled in the art to understand the invention and to design various embodiments with various modifications suitable for a particular purpose.
Claims
1. A system for detecting internal thread defects, characterized in that, include: The image acquisition module acquires images of the internal thread to be tested by taking pictures with a fisheye wide-angle camera. The preliminary processing module is responsible for performing preliminary processing on the original image to provide high-quality image input for subsequent advanced image processing and analysis. An edge detection module is responsible for performing edge detection on the obtained internal thread image. The Radon transformation module is responsible for performing Radon transformation on the edge image to obtain a two-dimensional array distribution of points and lines at different angles and distances. The detection and analysis module is responsible for detecting and analyzing the internal thread. The angle of the local maximum of the expected two-dimensional array is a fixed value. Therefore, there is only one angle with a local maximum. If the local maximum is distributed in a position greater than one angle, the other local maximums besides the main angle distribution are considered to be places where noise or defects exist. The result output module is responsible for outputting the judgment result of the internal thread defect detection, and the output judgment result 1 indicates a defect and 0 indicates no defect. The detection and analysis module analyzes the angle distribution of the two-dimensional array. When the angle distribution accounts for more than 85%, that is, when the value in the two-dimensional array is greater than 85% of the maximum value, it can be considered as a region where the texture direction is concentrated. It is marked as 1 in the new matrix, and the remaining data is marked as 0. The point marked as 1 represents the straight line direction angle of the corresponding edge image and the position of the straight line. The detection and analysis module analyzes the distribution of 1 and 0 in the new matrix and outputs the 10 two-dimensional arrays with the highest correlation between 1 and texture direction in the new matrix. These two-dimensional arrays represent the distribution of threads at different positions in the same direction. The thread defect determination logic of the detection and analysis module is based on uneven numerical energy distribution, and the thread defects include the following manifestations: If the local maxima are not distributed at the same angle, that is, if 0 exists in the new matrix, then the defects are rust, scratches, and cuts. If the distances between local maxima are not equidistant, meaning the distances in the two-dimensional array are not increasing, then the defect is a missing tooth.
2. The internal thread defect detection system according to claim 1, characterized in that, The preliminary processing module specifically includes the following sub-modules: Preprocessing submodule: Uses image processing techniques to enhance the original image, filter noise, and perform histogram equalization to improve image quality and increase the efficiency and accuracy of subsequent processing; Distortion calibration submodule: Utilizes known calibration methods and techniques to estimate distortion parameters in the preprocessed image; Distortion Correction Submodule: Based on distortion parameters, it uses distortion correction technology to perform geometric correction on the image, remapping each pixel in the image to eliminate or reduce image distortion and deformation caused by distortion.
3. The internal thread defect detection system according to claim 2, characterized in that, The distortion correction submodule determines the distortion correction method based on the thread type, hardware design relationship and selected camera characteristics, and distortion correction only needs to be performed once, without the need for repeated correction judgment.
4. The internal thread defect detection system according to claim 1, characterized in that, The edge detection module specifically includes the following sub-modules: Binarization submodule: Uses an adaptive threshold to binarize the thread image to obtain the stripe feature image of the thread image; The pass / fail determination submodule is used to determine whether the proportion of 1 pixels in the 0-1 image exceeds 35%. If it does, the edge image obtained by binarization is considered a valid image and is sent to the Radon transform module. Otherwise, the image is considered an invalid image and the threshold adjustment submodule is triggered. Threshold adjustment submodule: Used to adjust the adaptive threshold and feed it back to the binarization submodule.
5. The internal thread defect detection system according to claim 1, characterized in that, The Radon transform uses a set of parameters (θ, ρ) to represent a straight line. When a certain direction is selected, an image is transformed into a straight line as a function of ρ, as shown in the formula: ; The essence of Radon transform is to establish a projection onto a line segment with a normal direction of θ along multiple parallel rays determined by xcosθ + ysinθ = ρ. The method to achieve this is to rotate the image uniformly by an angle of θ and then calculate the projection on the x-axis.
Citation Information
Patent Citations
Efficient internal thread defect detection system
CN118130480A
Device and method based on parallel light and used for multi-vision visual detection
CN101660894A
Internal thread defect detection method, device , system, apparatus and medium
CN109919941A
