A kind of outer thread detection method and detection module of multi-optical equipment dynamic cooperation
By using multiple optical devices to collaboratively inspect threads and combining visible light and infrared images, foreign object edge points can be identified and repaired, thus solving the accuracy problem of thread defect detection and achieving higher detection precision.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- JIANGSU VALIN XIGANG SPECIAL STEEL
- Filing Date
- 2025-04-09
- Publication Date
- 2026-04-10
AI Technical Summary
In existing technologies, the presence of foreign objects adhering to the edge of the threaded area can easily lead to misjudgment, resulting in inaccurate thread defect detection.
A method of dynamic collaboration of multiple optical devices is adopted to detect thread contour points through visible light images, identify abnormal edge points, acquire infrared detection images, repair abnormal edge points, and determine whether thread defects exist in the repaired images.
It improves the accuracy of thread defect detection and avoids misjudgments caused by foreign object interference.
Smart Images

Figure CN119959226B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of thread detection, and in particular to a multi-optical device dynamic cooperation external thread detection method and detection module. BACKGROUND
[0002] In the process of oil and gas exploration and development, the oil well pipe column is connected by taper threads, and the quality of the threads has an important influence on the quality and service life of the oil and gas well. Therefore, in the production and processing process of the oil well pipe, the measurement and inspection of the thread parameters must be strengthened, so as to ensure that the quality of the oil well pipe thread meets the requirements and ensures the integrity and sealing of the oil well pipe column structure.
[0003] There is a method for detecting external threads in the prior art. The Chinese patent with publication number CN109060836B discloses a high-pressure oil pipe joint external thread detection method based on machine vision. The method collects images of the high-pressure oil pipe joint, automatically identifies the features of the thread area, removes the foreign matter edge points on the thread area, calculates the corresponding thread data, and judges whether the thread meets the standard.
[0004] However, when removing the foreign matter edge points on the thread area in the above-mentioned patent, the edge of the thread area with foreign matter edge points is easily misjudged, for example, surface scratches or micro-cracks. However, due to the adhesion of foreign matter at the damage site, the scratches or micro-cracks are blocked by the foreign matter in the camera imaging. The detection method disclosed in the above-mentioned patent considers the damage site as normal, and the defect misjudgment occurs.
[0005] Therefore, how to improve the accuracy of thread defect detection has become a technical problem to be solved. SUMMARY
[0006] The technical problem solved by the present application is that the related art is prone to misjudgment at the edge point with foreign matter, resulting in inaccurate thread defect detection.
[0007] To solve the above technical problems, the present application provides the following technical solutions: in a first aspect, a multi-optical device dynamic cooperation external thread detection method, the detection method comprising: performing edge detection on a visible light image of a target object, and extracting contour points of an external thread of the target object; if there is a first abnormal edge point in the contour points, determining an abnormal area where the first abnormal edge point is located; obtaining an infrared detection image of the abnormal area; identifying a second abnormal edge point in the infrared detection image; repairing the second abnormal edge point in the infrared detection image to obtain a repaired image; and judging whether the abnormal area in the repaired image has a thread defect.
[0008] Preferably, the infrared detection image is generated by an infrared detection device; before acquiring the infrared detection image of the abnormal area, the detection method further comprises: determining a center pixel coordinate of the abnormal area in the visible light image; converting the center pixel coordinate into a spatial coordinate in a coordinate system of the infrared detection device; determining a target coordinate of the infrared detection device according to the spatial coordinate; controlling the infrared detection device to move to the target coordinate; and controlling a thermal imaging optical axis of the infrared detection device to align with the center of the abnormal area.
[0009] Preferably, the controlling of the thermal imaging optical axis of the infrared detection device to align with the center of the abnormal area comprises: controlling a line between the thermal imaging optical axis of the infrared detection device and the center of the abnormal area to be perpendicular to a central axis of the target object in a world coordinate system.
[0010] Preferably, the controlling of the thermal imaging optical axis of the infrared detection device to align with the center of the abnormal area comprises: controlling the thermal imaging optical axis to be directed to the center of the abnormal area at a first angle, wherein the first angle is not less than 43 degrees and not more than 47 degrees.
[0011] Preferably, the identifying of the second abnormal edge point in the infrared detection image comprises: performing interpolation processing on the infrared detection image to obtain an infrared magnified image; identifying the second abnormal edge point in the infrared magnified image; and repairing the second abnormal edge point in the infrared detection image to obtain a repaired image, which comprises: repairing the second abnormal edge point in the infrared magnified image to obtain the repaired image.
[0012] Preferably, the interpolation processing on the infrared detection image to obtain the infrared magnified image comprises: determining a first adjacent region of each target pixel point in the infrared detection image along a spiral direction of the external thread; determining a maximum temperature difference between a plurality of pixel points in the first adjacent region; if the maximum temperature difference is less than a preset temperature difference threshold, performing bicubic interpolation processing on the target pixel point corresponding to the first adjacent region; and if the maximum temperature difference is not less than the preset temperature difference threshold, performing nearest neighbor interpolation processing on the target pixel point corresponding to the first adjacent region.
[0013] Preferably, the repairing of the second abnormal edge point in the infrared magnified image to obtain the repaired image comprises: determining a thread edge point in the infrared magnified image; determining a non-thread region and a thread region in the infrared magnified image according to the thread edge point; if the second abnormal point is located in the thread region, repairing the second abnormal edge point according to the thread region to obtain the repaired image; and if the second abnormal point is located in the non-thread region, repairing the second abnormal edge point according to the non-thread region to obtain the repaired image.
[0014] Preferably, judging whether the abnormal area in the repaired image has a thread defect comprises: matching a thread infrared image consistent with the target object from a pre-stored thread infrared template library according to the infrared detection image; performing alignment processing on the thread infrared image according to the infrared detection image to obtain an aligned sub-image of the thread infrared image; and judging whether the repaired image has a thread defect according to the aligned sub-image.
[0015] Preferably, matching a thread infrared image consistent with the target object from a pre-stored thread infrared template library according to the infrared detection image comprises: determining a geometric parameter of the target object according to the visible light image, and determining a material thermal conductivity parameter of the target object according to the infrared detection image; and matching the thread infrared image consistent with the target object from the thread infrared template library according to the geometric parameter and the material thermal conductivity parameter, wherein the thread infrared image comprises a preset thread, the preset thread has a geometric parameter tolerance less than a preset tolerance threshold with respect to the target object, and the preset thread has a material thermal conductivity coefficient deviation less than a preset deviation threshold with respect to the target object; and performing alignment processing on the thread infrared image according to the infrared detection image to obtain an aligned sub-image of the thread infrared image, comprising: performing thermal expansion compensation alignment on the thread infrared image according to a thermal compensation formula to obtain the aligned sub-image of the thread infrared image; and the thermal compensation formula is: ; wherein, is a pixel coordinate of the thread infrared image, is a compensated pixel coordinate in the thread infrared image, and a is a material linear expansion coefficient of the target object, is a temperature of the target object during detection, is a reference temperature during collection of the thread infrared template library.
[0016] In a second aspect, the present application provides a multi-optical device dynamic cooperation external thread detection module, which comprises: a photographing module configured to capture a visible light image of a target object; a processing module configured to perform edge detection on the visible light image, extract contour points of an external thread of the target object, and determine an abnormal area where a first abnormal edge point is located if the first abnormal edge point exists in the contour points; an infrared detection module configured to determine an infrared detection image of the abnormal area; and the processing module is further configured to identify a second abnormal edge point in the infrared detection image, repair the second abnormal edge point in the infrared detection image, obtain a repaired image, and judge whether the abnormal area in the repaired image has a thread defect.
[0017] The beneficial effects of the present application are: by performing edge detection on the visible light image of the target object, extracting the contour points of the external thread of the target object, and identifying that there is a first abnormal edge point in the contour points, the first abnormal edge point is used to represent the foreign matter adhered edge point to locate the foreign matter adhered edge point; by obtaining the infrared detection image of the abnormal area corresponding to the first abnormal edge point, identifying the second abnormal edge point in the infrared detection image, identifying the coordinates of the foreign matter adhered edge point in the infrared detection image, and repairing the foreign matter adhered to the edge point in the infrared detection image, to obtain the repaired image after removing the foreign matter, and judging whether there is a thread defect at the foreign matter adhered edge point according to the repaired image, thereby improving the accuracy of thread defect detection at the edge point. BRIEF DESCRIPTION OF DRAWINGS
[0018] Figure 1 The basic flowchart of the external thread detection method of the multi-optical equipment dynamic cooperation provided by an embodiment of the present application is shown. DETAILED DESCRIPTION
[0019] In order to make the above-mentioned objects, features and advantages of the present application more obvious and easy to understand, the specific embodiments of the present application will be described in detail below with reference to the drawings of the specification. Obviously, the described embodiments are part of the embodiments of the present application, not all embodiments.
[0020] Embodiment 1, refer to Figure 1 For an embodiment of the present application, a multi-optical equipment dynamic cooperation external thread detection method is provided, which includes S110-S160:
[0021] S110, performing edge detection on the visible light image of the target object, and extracting the contour points of the external thread of the target object.
[0022] S120, if there is a first abnormal edge point in the contour points, determining the abnormal area where the first abnormal edge point is located.
[0023] The first abnormal edge point is used to represent the foreign matter adhered edge point.
[0024] S130, obtaining the infrared detection image of the abnormal area.
[0025] The infrared detection image is generated by an infrared detection device; before S130, the detection method further includes S121-S129:
[0026] S121, determining the center pixel coordinates of the abnormal area in the visible light image.
[0027] The pixel coordinates of the center of the abnormal area in the visible light image.
[0028] S123, convert the center pixel coordinate into a spatial coordinate in the coordinate system of the infrared detection device.
[0029] 、 is the scaling factor of the visible light camera's pixel to the actual space (obtained by calibration), 、 is the installation position deviation compensation value of the visible light camera and the infrared device.
[0030] The spatial coordinate of the center pixel coordinate in the coordinate system of the infrared detection device is:
[0031] ( ), z is a preset value.
[0032] S125, determine the target coordinate of the infrared detection device according to the spatial coordinate.
[0033] The target coordinate is:
[0034] S127, control the infrared detection device to move to the target coordinate.
[0035] S129, control the thermal imaging optical axis of the infrared detection device to align the center of the abnormal area.
[0036] Specifically, S129 further comprises: S129a, controlling the line between the thermal imaging optical axis of the infrared detection device and the center of the abnormal area to be perpendicular to the center axis of the target object in the world coordinate system, so as to avoid the infrared rays from being unable to penetrate the outer thread one turn after another.
[0037] Preferably, S129 can further comprise: S129b, controlling the thermal imaging optical axis to be incident on the center of the abnormal area at a first angle, wherein the first angle is not less than 43 degrees and not greater than 47 degrees, and when the foreign matter is an emulsion, the infrared rays are set to be incident at 45°, which can improve the penetration effect of the infrared rays on the emulsion.
[0038] The first angle calculation: the first incident angle of the infrared optical axis , which is constrained by the following formula:
[0039]
[0040] is the standard pitch of the outer thread of the target object;
[0041] is the nominal diameter of the outer thread of the target object;
[0042] is an angle correction value, which is in the range of , which is used to compensate for the penetration requirement of the emulsion / foreign matter; and finally constrain .
[0043] S140, identify the second abnormal edge point in the infrared detection image.
[0044] The second abnormal edge point is used to represent a foreign object region, such as an emulsion, iron filings, etc.
[0045] S150, repair the second abnormal edge point in the infrared detection image to obtain a repaired image.
[0046] In the infrared detection image, the foreign object is repaired, and the repaired image is obtained. The repaired image is detected to avoid mistaking the foreign object as a defect and causing interference in the detection.
[0047] To improve the repair effect of the repaired image, S140 includes sub-steps S141-S143:
[0048] S141, performing interpolation processing on the infrared detection image to obtain an infrared magnified image.
[0049] Specifically, S141 includes sub-steps S141a-S141d:
[0050] S141a, determining a first adjacent region of each target pixel point in the infrared detection image along the spiral direction of the external thread.
[0051] S141b, determining the maximum temperature difference between a plurality of pixel points in the first adjacent region.
[0052] S141c, if the maximum temperature difference is less than a preset temperature difference threshold, performing bicubic interpolation processing on the target pixel point corresponding to the first adjacent region.
[0053] S141d, if the maximum temperature difference is not less than the preset temperature difference threshold, performing nearest neighbor interpolation processing on the target pixel point corresponding to the first adjacent region.
[0054] The traditional method causes misjudgment in the temperature mutation region (such as the edge of a scratch), such as amplifying a small scratch into a larger artifact; therefore, the bicubic interpolation is used to maintain details in the temperature change smooth region, and the nearest neighbor is used to avoid artifacts in the temperature mutation region; the adjacent region is determined along the spiral direction, which is related to the structure of the thread, ensuring that the analysis window conforms to the physical characteristics of the thread, and avoiding mistaking the artifacts between the protruding part and the non-protruding part of the thread as a crack.
[0055] S143, identifying the second abnormal edge point in the infrared magnified image.
[0056] S150 includes a sub-step S151: S151, repairing the second abnormal edge point in the infrared magnified image to obtain a repaired image.
[0057] S151 comprises sub-steps S151a-S151d:
[0058] S151a, determining a thread edge point in the infrared amplified image.
[0059] S151b, determining a non-thread region and a thread region in the infrared amplified image according to the thread edge point.
[0060] S151c, if the second abnormal point is located in the thread region, repairing the second abnormal edge point according to the thread region to obtain a repaired image.
[0061] S151d, if the second abnormal point is located in the non-thread region, repairing the second abnormal edge point according to the non-thread region to obtain a repaired image.
[0062] S160, judging whether the repaired image has a thread defect.
[0063] S161, matching a thread infrared image consistent with the target object from a pre-stored thread infrared template library according to the infrared detection image.
[0064] S162, performing alignment processing on the thread infrared image according to the infrared detection image to obtain an aligned sub-image of the thread infrared image.
[0065] S163, judging whether the repaired image has a thread defect according to the aligned sub-image.
[0066] Specifically, S161 comprises sub-steps S161a-S161b:
[0067] S161a, determining a geometric parameter of the target object according to the visible light image, and determining a material thermal conductivity parameter of the target object according to the infrared detection image.
[0068] S161b, matching a thread infrared image consistent with the target object from a thread infrared template library according to the geometric parameter and the material thermal conductivity coefficient, wherein the thread infrared image comprises a preset thread, the preset thread has a geometric parameter tolerance with the target object less than a preset tolerance threshold, and the preset thread has a material thermal conductivity coefficient deviation with the target object less than a preset deviation threshold.
[0069] S162 comprises sub-step S162a:
[0070] S162a, performing thermal expansion compensation alignment on the thread infrared image according to a thermal compensation formula to obtain an aligned sub-image of the thread infrared image, wherein the thermal compensation formula is:
[0071]
[0072] wherein, is a pixel coordinate of the thread infrared image, is the pixel coordinate of the compensated thread in the infrared image, a is the linear expansion coefficient of the material of the target object, is the temperature of the target object during detection, is the reference temperature during acquisition of the infrared template library of the thread.
[0073] If thermal expansion is not compensated, temperature changes will cause the thread to shift at the pixel level in the image. For example, after turning is completed, the surface temperature of the thread is above 80°C, which causes expansion of about 0.058 mm per 10 mm in length. If the imaging resolution is 0.02 mm / pixel, the deformation is equivalent to a 2.9 pixel shift, which causes image registration to fail. The function of the thermal compensation formula is to dynamically correct the coordinate mapping relationship according to the temperature difference, so that the detection image and the template are aligned in physical dimensions.
[0074] For example, the pitch of a certain threaded joint is P = 5.08 mm at 20°C, and the temperature is still maintained at 70°C during summer detection: P' = 5.08·[1+11.7×10-6·(70-20)] = 5.082967 mm. Therefore, after thermal compensation, comparison can be performed to avoid misjudgment of pitch out-of-tolerance due to thermal expansion.
[0075] The embodiment of the present application extracts the contour points of the external thread of the target object by performing edge detection on the visible light image of the target object, and identifies the first abnormal edge point existing in the contour points. The first abnormal edge point is used to represent the foreign matter edge point to locate the foreign matter edge point. By obtaining the infrared detection image of the abnormal area corresponding to the first abnormal edge point, the second abnormal edge point in the infrared detection image is identified to identify the coordinates of the foreign matter edge point in the infrared detection image, and the foreign matter adhered to the edge point in the infrared detection image is repaired to obtain a repaired image after removing the foreign matter, and whether there is a thread defect at the foreign matter edge point is judged according to the repaired image, thereby improving the accuracy of thread defect detection at the edge point.
[0076] Further, the experimental data of the embodiment of the present application is provided to illustrate the technical effect of the embodiment of the present application. Specifically, please refer to Table 1.
[0077] Table 1: Data effect of the present scheme
[0078]
[0079] According to another aspect of the embodiments of the present application, a multi-optical device dynamic cooperation outer thread detection module is also provided. The detection module comprises: a photographing module configured to capture a visible light image of a target object; a processing module configured to perform edge detection on the visible light image, extract contour points of an outer thread of the target object, and determine an abnormal area in which a first abnormal edge point is located if the first abnormal edge point exists in the contour points; and an infrared detection module configured to determine an infrared detection image of the abnormal area. The processing module is further configured to identify a second abnormal edge point in the infrared detection image, repair the second abnormal edge point in the infrared detection image to obtain a repaired image, and determine whether the abnormal area in the repaired image has a thread defect.
[0080] Those skilled in the art should understand that the embodiments of the present application can be provided as a method, a system or a computer program product. Therefore, the present application can take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Moreover, the present application can take the form of a computer program product implemented on one or more computer-usable storage media having computer-usable program code embodied in the medium. The storage media can be realized by any type of volatile or non-volatile storage devices or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, magnetic disk or optical disk. These computer program instructions can also be stored in a computer readable storage medium which can guide a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer readable storage medium produce a manufactured product including instruction devices which realize the functions specified in the flowcharts Figure 1 one or more flows and / or blocks Figure 1 one or more flows and / or blocks
[0081] It should be noted that the above embodiments are only used to illustrate the technical solutions of the present application but not limit the present application. Although the present application has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solutions of the present application can be modified or replaced by equivalents without departing from the spirit and scope of the present application, which should be covered in the scope of the claims of the present application.
Claims
1. A method for detecting external threads in a multi-optical device dynamic coordination, characterized by, The detection method comprises: performing edge detection on a visible light image of a target object to extract contour points of an external thread of the target object; if there is a first abnormal edge point in the contour points, determining an abnormal area where the first abnormal edge point is located; obtaining an infrared detection image of the abnormal area; identifying a second abnormal edge point in the infrared detection image; repairing the second abnormal edge point in the infrared detection image to obtain a repaired image; judging whether the abnormal area in the repaired image has a thread defect; the identification of the second abnormal edge point in the infrared detection image comprises: performing interpolation processing on the infrared detection image to obtain an infrared magnified image; identifying a second abnormal edge point in the infrared magnified image; the repairing of the second abnormal edge point in the infrared detection image to obtain a repaired image comprises: repairing the second abnormal edge point in the infrared magnified image to obtain a repaired image; the repairing of the second abnormal edge point in the infrared magnified image to obtain a repaired image comprises: determining a thread edge point in the infrared magnified image; determining a non-thread area and a thread area in the infrared magnified image according to the thread edge point; if the second abnormal point is located in the thread area, repairing the second abnormal edge point according to the thread area to obtain the repaired image; if the second abnormal point is located in the non-thread area, repairing the second abnormal edge point according to the non-thread area to obtain the repaired image; the judgment of whether the abnormal area in the repaired image has a thread defect comprises: matching a thread infrared image consistent with the target object from a pre-stored thread infrared template library according to the infrared detection image; performing alignment processing on the thread infrared image according to the infrared detection image to obtain an alignment sub-image of the thread infrared image; judging whether the repaired image has a thread defect according to the alignment sub-image; the matching of the thread infrared image consistent with the target object from the pre-stored thread infrared template library according to the infrared detection image comprises: determining a geometric parameter of the target object according to the visible light image, and determining a material thermal conductivity parameter of the target object according to the infrared detection image; matching a thread infrared image consistent with the target object from the thread infrared template library according to the geometric parameter and the material thermal conductivity coefficient, wherein the thread infrared image comprises a preset thread, the preset thread has a geometric parameter tolerance less than a preset tolerance threshold with the target object, and the preset thread has a material thermal conductivity coefficient deviation less than a preset deviation threshold with the target object; the alignment processing of the thread infrared image according to the infrared detection image to obtain an alignment sub-image of the thread infrared image comprises: performing thermal expansion compensation alignment on the thread infrared image according to a thermal compensation formula to obtain the alignment sub-image of the thread infrared image; the thermal compensation formula is: ; wherein, is the pixel coordinate of the threaded infrared image, is the pixel coordinate of the threaded infrared image after compensation, and a is the material linear expansion coefficient of the target object, is the temperature of the target object when detected, is the reference temperature when the threaded infrared template library is collected.
2. The detection method according to claim 1, characterized in that, the infrared detection image is generated by an infrared detection device; before the obtaining of the infrared detection image of the abnormal area, the detection method further comprises: determining a center pixel coordinate of the abnormal area in the visible light image; convert the center pixel coordinate into a spatial coordinate in a coordinate system of the infrared detection device; determine a target coordinate of the infrared detection device according to the spatial coordinate; control the infrared detection device to move to the target coordinate; control a thermal imaging optical axis of the infrared detection device to align with a center of the abnormal region.
3. The detection method according to claim 2, characterized in that, The control of the thermal imaging optical axis of the infrared detection device to align with the center of the abnormal region includes: controlling a line between the thermal imaging optical axis of the infrared detection device and the center of the abnormal region to be perpendicular to a central axis of the target object in a world coordinate system.
4. The detection method according to claim 3, characterized in that, The control of the thermal imaging optical axis of the infrared detection device to align with the center of the abnormal region includes: controlling the thermal imaging optical axis to be directed to the center of the abnormal region at a first angle, wherein the first angle is not less than 43 degrees and not more than 47 degrees.
5. The method of claim 1, wherein, The interpolation processing of the infrared detection image to obtain an infrared magnified image includes: determining a first adjacent region of each target pixel point in the infrared detection image along a spiral direction of the external thread; determining a maximum temperature difference between a plurality of pixel points in the first adjacent region; if the maximum temperature difference is less than a preset temperature difference threshold, performing bicubic interpolation processing on a target pixel point corresponding to the first adjacent region; if the maximum temperature difference is not less than the preset temperature difference threshold, performing nearest neighbor interpolation processing on the target pixel point corresponding to the first adjacent region.
6. A detection module for implementing the detection method of claim 1, characterized in that, The detection module includes: a photographing module configured to capture a visible light image of a target object; a processing module configured to perform edge detection on the visible light image, extract contour points of an external thread of the target object, and determine an abnormal region where a first abnormal edge point is located if the first abnormal edge point exists in the contour points; an infrared detection module configured to determine an infrared detection image of the abnormal region; the processing module is further configured to identify a second abnormal edge point in the infrared detection image, repair the second abnormal edge point in the infrared detection image to obtain a repaired image, and determine whether the abnormal region in the repaired image has a thread defect.
Citation Information
Patent Citations
Machine vision-based method for detecting external threads of high-pressure oil pipe joints
CN109060836B
Ship identification method and system based on high-resolution infrared simulation image
CN119229303A
Product surface defect detection method and related hardware
CN119540221A