A method for detecting thread defects in oil pipe fittings based on structured light 3D reconstruction

CN122567690APending Publication Date: 2026-08-14JIANGYIN NANFANG PIPE FITTINGS MFG CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-07-17
Publication Date
2026-08-14

AI Technical Summary

Technical Problem

[0003]当前石油管件螺纹的检测的主流方案为常规光学非接触检测,即采用线激光扫描、普通结构光成像以及二维视觉拍摄等非接触方式,通过采集螺纹表面光学图像,结合基础图像处理算法重构二维轮廓,可避免物理接触损伤,实现螺纹表面缺陷识别;然而,实际工业检测中,石油管件螺纹表面普遍残留加工冷却液和防护螺纹脂防从而形成不均匀油膜,该油膜不会造成肉眼可见的表面遮挡,却会持续改变螺纹表面的光学反射传播路径,致使投射至螺纹表面的结构光条纹产生全域连续、无明显边缘的柔性畸变偏移,而现有光学检测仅能够识别并消除离散式像素噪点、局部突变干扰,难以区分油膜引发的缓变相位偏移干扰与螺纹自身真实形貌变化,导致重构得到的螺纹三维形貌存在系统性偏差,进而制约了石油管件螺纹自动化精密检测的发展

Benefits of technology

1.本发明通过采集恒速旋转石油管件螺纹表面的多时序多偏振态反射光场图像,构建双时序包裹相位场作为动态油膜与静态油膜分层剥离的数据基础,结合非刚性对流速度分量进行空间拓扑回溯,实现了基于运动学特征的动态油膜干扰定量剔除;联合偏振通道相位延迟量与偏振度退化量,实现了静态油膜附着相位偏移量的逐点精确补偿,从而在不依赖物理清洗的条件下完整还原螺纹真实形貌相位信息,从根本上解决了传统结构光检测中油膜干扰与螺纹信号无法分离的技术难题。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122567690A_ABST
    Figure CN122567690A_ABST
Patent Text Reader

Abstract

This invention belongs to the field of non-destructive testing technology for oil pipe fittings. It discloses a method for detecting thread defects in oil pipe fittings based on structured light 3D reconstruction. The method includes: acquiring multi-temporal, multi-polarization state reflected light field images of the thread surface of an oil pipe fitting rotating at a constant speed, and performing spatial reconstruction to obtain a first temporal wrapping phase field and a second temporal wrapping phase field; identifying and back-stripping non-rigid convection velocity components caused by dynamic oil films to obtain an initial wrapping phase field; removing the attached phase offset caused by static oil films to obtain a pure phase field; reconstructing a dense 3D point cloud, identifying and removing artifact regions based on the original contour curvature features to form a standard 3D point cloud; analyzing the complete tooth profile to evaluate various deviation parameters, and verifying and classifying parameters and defects based on defect judgment rules to generate a defect judgment conclusion, thereby improving the sensitivity of defect detection.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of nondestructive testing technology for oil pipe fittings, and more specifically, to a method for detecting thread defects in oil pipe fittings based on structured light three-dimensional reconstruction. Background Technology

[0002] As a core connecting component of oil and gas pipelines, the machining accuracy and surface quality of oil pipe threads directly determine the sealing performance and service safety of the pipeline. Minor defects or dimensional deviations in the thread area can easily lead to major safety accidents such as pipeline leakage and joint breakage. Therefore, there is a rigid demand for high-precision, efficient, and non-destructive testing of oil pipe threads in industrial production.

[0003] The current mainstream approach for inspecting oil pipe thread is conventional optical non-contact inspection, which employs non-contact methods such as line laser scanning, ordinary structured light imaging, and 2D vision imaging. By acquiring optical images of the thread surface and reconstructing the 2D contour using basic image processing algorithms, physical contact damage can be avoided, enabling the identification of thread surface defects. However, in actual industrial inspection, the surface of oil pipe thread commonly contains residual processing coolant and protective thread grease, forming an uneven oil film. This oil film does not cause visible surface obstruction but continuously alters the optical reflection propagation path of the thread surface. This results in a flexible distortion shift of the structured light stripes projected onto the thread surface, which is continuous across the entire domain and has no obvious edges. Existing optical inspection methods can only identify and eliminate discrete pixel noise and local abrupt interference, making it difficult to distinguish between the gradually changing phase shift interference caused by the oil film and the actual changes in the thread's morphology. This leads to a systematic deviation in the reconstructed 3D thread morphology, thus hindering the development of automated precision inspection of oil pipe thread.

[0004] In view of this, the present invention proposes a method for detecting thread defects in oil pipe fittings based on structured light three-dimensional reconstruction to solve the above problems. Summary of the Invention

[0005] In order to overcome the above-mentioned defects of the prior art and to achieve the above objectives, the present invention provides the following technical solution: a method for detecting thread defects in oil pipe fittings based on structured light three-dimensional reconstruction, comprising: S1, acquiring multi-time-series multi-polarization state reflected light field images of the thread surface of an oil pipe fitting rotating at a constant speed, and performing spatial reconstruction to obtain a first time-series wrapping phase field and a second time-series wrapping phase field; S2. Based on the first time-series encapsulated phase field and the second time-series encapsulated phase field, identify the non-rigid convection velocity component caused by the dynamic oil film and perform backtracking peeling to obtain the initial encapsulated phase field. Further remove the attached phase offset caused by the static oil film from the initial encapsulated phase field to obtain the pure phase field. S3. Based on the pure phase field, reconstruct dense 3D point cloud, combine the original contour curvature features to identify and remove artifact regions, and form a standard 3D point cloud. S4. Analyze the complete tooth profile to evaluate each deviation parameter, and combine the parameter verification and defect classification with the defect judgment rules to generate a defect judgment conclusion.

[0006] Furthermore, the methods for obtaining the first time-series wrapped phase field and the second time-series wrapped phase field include: Standard phase-shift structured light stripes are projected onto the threaded surface of an oil pipe fitting that is held at a constant speed and rotated at the inspection station, and four sets of polarization direction switching operations are performed simultaneously; two sets of multi-time-series multi-polarization state reflected light field images at different spatial displacement time step points are captured in parallel. The reflection light field images of each time sequence and polarization state are scanned pixel by pixel. The gray value sequence of the same pixel is extracted and the phase is demodulated to obtain the time sequence-polarization multidimensional phase set of each pixel at different time steps and different polarization directions. The time-polarization multidimensional phase set is divided into phase space distribution arrays of four polarization channels each in the first time series and the second time series according to the time step point and polarization direction dimension, and then the full polarization mean fusion is performed to obtain the first time series wrapped phase field and the second time series wrapped phase field.

[0007] Furthermore, methods for obtaining the initial wrapper phase field include: By comparing the phase value change trajectory of each pixel between the first time-series wrapped phase field and the second time-series wrapped phase field, the spatial optical flow field velocity distribution of the global pixels is obtained; based on the gradient and divergence differences in the spatial optical flow field velocity distribution, the non-rigid convection velocity component caused by the dynamic oil film is identified. Spatial topological backtracking of the global pixels along the opposite direction of the non-rigid convection velocity components yields the local phase rheological deterioration caused by the dynamic oil film motion. By combining the measured micro-amplitude time interval parameters, the local phase rheological difference is spatiotemporally mapped to form an instantaneous flow phase shift, which is then separated from the first time-series wrapped phase field to obtain the initial wrapped phase field.

[0008] Furthermore, methods for eliminating the adhesion phase offset caused by static oil film include: The phase spatial distribution array of the four polarization channels in the first time sequence is analyzed, the phase delay and polarization degree degradation of the same pixel under different polarization directions are extracted, and the physical feature map of spatial polarization anisotropy distribution is generated by mapping. Based on the stable polarization retention characteristics of metals and the polarization degradation characteristics caused by multilayer refraction of liquid oil films, the physical characteristic map of spatial polarization anisotropy distribution is divided to obtain the rigid substrate region and the residual boundary film region. The physical mapping relationship between the refractive index of the preset medium and the phase attenuation is used to quantitatively analyze the degree of polarization degradation in the residual boundary film region, thereby obtaining the absolute shift of the static oil film's attachment phase. The attached absolute phase offset is removed point by point from the initial wrapped phase field, and the remaining phase data is spatially aligned and normalized to obtain a pure phase field.

[0009] Furthermore, methods for reconstructing dense 3D point clouds include: Spatiotemporal phase expansion processing is performed on the pure phase field to obtain a global continuous absolute phase field; the structural cursor positioning parameters are retrieved and the optical imaging position corresponding to the global continuous absolute phase field is combined to calculate the three-dimensional spatial position information of each pixel on the surface of the oil pipe thread; all three-dimensional spatial position information is integrated to form a spatial point set, generating a dense three-dimensional point cloud of the oil pipe thread.

[0010] Furthermore, methods for forming standard 3D point clouds include: For each spatial point in the three-dimensional dense point cloud of the thread, a local k-neighborhood search is performed, and the obtained neighborhood point set is fitted with a local quadratic surface to obtain the original contour curvature features. A spatial stepping feature analysis window is established to perform window stepping scanning on the spatial first-order differential field extracted from the original contour curvature features, dividing the dense three-dimensional point cloud into artifact regions or local curvature abrupt defect regions. Tangential smoothing is performed on the artifact region, and spatial topology merging is performed in conjunction with the local curvature abrupt defect region to obtain the standard three-dimensional point cloud of oil pipe thread.

[0011] Furthermore, methods for dividing regions into artifact regions or local curvature abrupt defect regions include: If the value of the first-order differential field exhibits a spatial periodic alternation of positive and negative values ​​locally, and the spatial spacing between the peaks and troughs corresponds to the period of the stripe pixels, then it is determined to be an artifact region. If the value of the first-order differential field exhibits an isolated, non-periodic, and drastic step increase in a local area, and the geometric widening of the local curvature abrupt change region is limited to a set micrometer-level size threshold, then it is determined to be a local curvature abrupt change region.

[0012] Furthermore, the methods for evaluating each deviation parameter include: Based on the standard 3D point cloud, the curvature features of the corrected contour are re-extracted, the evolution law of the macroscopic geometric waveform in the spatial axis is analyzed, the extreme value jump points of each curvature are locked, and the tooth crest position, tooth flank position and tooth root position of the oil pipe thread are identified and marked. Based on the spatial geometric center points of the tooth crest and root positions, reverse fitting is performed, and the fitted central axis equation is used as the rotation axis to drive the virtual cutting plane to perform equal-angle rotation step cutting along the thread helical trajectory. Extract and connect the spatial intersection point projection set of the virtual cutting plane and the standard 3D point cloud, and extract the complete tooth profile outline along the spiral trajectory; align and compare the complete tooth profile outline with the standard theoretical outline to obtain tooth height, tooth angle, and local profile deviation parameters.

[0013] Furthermore, the methods for generating defect determination conclusions include: Call the defect judgment rules stored in the memory for each threshold range; if the tooth height and tooth angle deviation parameters exceed the corresponding threshold range, it is judged as a dimensional defect and the defect location coordinates are output. For connected regions where the local contour deviation parameter exceeds the corresponding threshold range, the defect type is marked; the dimensional deviation judgment result and the defect type mark are summarized to generate the defect judgment conclusion.

[0014] Furthermore, methods for defect type labeling include: Data points whose local contour deviation parameters exceed the corresponding threshold range are extracted as outlier data points; spatially adjacent outlier data points are clustered into connected components. If the local contour deviation direction within the connected domain is towards the interior of the central axis and the depth gradually changes, it is determined to be a concave defect; if the local contour deviation direction is away from the exterior of the central axis, it is determined to be a convex defect. If a connected region exhibits a narrow, linear extension with a sudden change in depth, it is classified as a scratch defect; if a connected region is located at the edge of the tooth crest or lateral surface and causes a geometric break in the continuous tooth profile, it is classified as a chipped corner defect.

[0015] The technical effects and advantages of the present invention regarding the method for detecting thread defects in oil pipe fittings based on structured light 3D reconstruction are as follows: 1. This invention acquires multi-temporal, multi-polarization reflected light field images of the threaded surface of a constantly rotating oil pipe fitting, constructs a dual-temporal wrapping phase field as the data basis for the separation of dynamic and static oil film layers, and combines non-rigid convection velocity components for spatial topological backtracking to achieve quantitative removal of dynamic oil film interference based on kinematic characteristics; by combining the phase delay of the polarization channel and the polarization degree degradation, it achieves point-by-point accurate compensation of the static oil film adhesion phase offset, thereby completely restoring the true morphology and phase information of the thread without relying on physical cleaning, fundamentally solving the technical problem of the inability to separate oil film interference and thread signals in traditional structured light detection.

[0016] 2. This invention extracts the contour curvature features of the three-dimensional dense point cloud of the thread and constructs a first-order spatial differential field. It utilizes the physical difference between the reconstructed artifacts exhibiting periodic positive and negative alternating fluctuations in the rate of curvature change and the real defects exhibiting isolated step-like dramatic increases. This enables the automatic differentiation and identification of artifact regions and defect regions with local curvature abrupt changes. Furthermore, it effectively eliminates high-frequency regular jitter artifacts while completely preserving the original morphology of micron-level defects, ensuring the sensitivity and specificity of subsequent defect detection. Attached Figure Description

[0017] Figure 1 This is a schematic diagram illustrating the principle of the method for detecting thread defects in oil pipe fittings based on structured light 3D reconstruction according to the present invention. Figure 2 This is a flowchart illustrating the process of obtaining the initial package phase field in this invention; Figure 3 This is a flowchart for determining the defect category in this invention. Detailed Implementation

[0018] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0019] Example 1, please refer to Figure 1 , Figure 2 and Figure 3 As shown in this embodiment, the method for detecting thread defects in oil pipe fittings based on structured light 3D reconstruction includes: S1. Acquire multi-time-series, multi-polarization state reflected light field images of the threaded surface of an oil pipe fitting that is rotating at a constant speed, and perform spatial reconstruction to obtain the first time-series wrapped phase field and the second time-series wrapped phase field.

[0020] Setting a constant speed rotation allows the oil pipe thread to move rigidly and uniformly, providing a motion reference for distinguishing between "rigid displacement of the workpiece" and "non-rigid slippage of the oil film" in two sets of multi-time-series, multi-polarization-state reflected light field images.

[0021] Standard phase-shift structured light fringes are projected onto the threaded surface of an oil pipe fitting that is clamped and rotated at a constant speed (e.g., a linear rotation speed set between 1 mm / s and 10 mm / s) at the inspection station. The phase of the standard phase-shift structured light fringes undergoes periodic step changes synchronously with the spatial step time; for example, four frames of standard phase-shift structured light fringes are projected, with phase step values ​​of 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 10 ... π and .

[0022] Four sets of polarization direction switching operations are executed simultaneously. The four sets of polarization directions are 0° polarization direction, 45° polarization direction, 90° polarization direction and 135° polarization direction, and are cyclically switched at high speed between the four independent polarization angles.

[0023] Two sets of multi-time-series, multi-polarization-state reflected light field images were captured in parallel at different spatial displacement time step points.

[0024] When the oil pipe fitting is rotated at a constant speed to the first spatial displacement time step point, the driving optical field imaging device captures multi-time sequence multi-polarization state reflected light field images at the first spatial displacement time step point: 0° polarization channel reflected light field image, 45° polarization channel reflected light field image, 90° polarization channel reflected light field image, and 135° polarization channel reflected light field image at the first spatial displacement time step point.

[0025] When rotating at a constant speed to the second spatial displacement time step point, the driving optical field imaging device captures multi-time-series, multi-polarization-state reflected light field images at the second spatial displacement time step point: the 0° polarization channel reflected light field image, the 45° polarization channel reflected light field image, the 90° polarization channel reflected light field image, and the 135° polarization channel reflected light field image at the second spatial displacement time step point.

[0026] The reflection light field images of each time sequence and polarization state are scanned pixel by pixel. For the same horizontal and vertical coordinate positions in each reflection light field image, the gray values ​​of the same pixel are extracted at two different spatial displacement time step points, different independent polarization angles and different phase shift states to form a gray value sequence.

[0027] By performing tangent and arctangent mathematical operations on the gray value sequence of the same pixel, the phase demodulation operation of each same pixel is completed, and the time-polarization multidimensional phase set of each pixel at different time steps and different polarization directions is obtained.

[0028] The time-polarization multidimensional phase set is divided into phase space distribution arrays of four polarization channels each for the first time series and the second time series, based on the time step point and polarization direction dimension.

[0029] For example, the phase space distribution array of the four polarization channels in the first time sequence includes the phase space distribution array of the 0° polarization channel in the first time sequence, the phase space distribution array of the 45° polarization channel in the first time sequence, the phase space distribution array of the 90° polarization channel in the first time sequence, and the phase space distribution array of the 135° polarization channel in the first time sequence.

[0030] The phase space distribution array of the four polarization channels in the second time sequence includes the phase space distribution array of the 0° polarization channel in the second time sequence, the phase space distribution array of the 45° polarization channel in the second time sequence, the phase space distribution array of the 90° polarization channel in the second time sequence, and the phase space distribution array of the 135° polarization channel in the second time sequence.

[0031] The phase values ​​of the same pixels in the phase spatial distribution array of the four polarization channels in the first time sequence are arithmetically averaged in the four polarization directions. At the same time, the phase values ​​of the same pixels in the phase spatial distribution array of the four polarization channels in the second time sequence are arithmetically averaged in the four polarization directions. This completes the full polarization mean fusion, resulting in the first time sequence wrapped phase field and the second time sequence wrapped phase field.

[0032] S2. Based on the first and second time-series encapsulated phase fields, identify the non-rigid convection velocity components caused by the dynamic oil film and perform backtracking stripping to obtain the initial encapsulated phase field. Further remove the attached phase offset caused by the static oil film from the initial encapsulated phase field to obtain the pure phase field.

[0033] The oil film adhering to the threaded surface of oil pipe fittings is subjected to the combined effects of constant speed rotation centrifugal force, fluid viscosity force, and interfacial adhesion force. The adhering oil film can be divided into two types: "dynamic flow oil film" which slips, stretches, and accumulates locally with the rotation of the pipe fitting; and "static residual oil film" which adheres tightly to the metal thread base and does not undergo macroscopic flow.

[0034] Under constant-speed rotation, the angular velocity of the pipe fitting's entire point motion is uniform, and the displacement pattern is consistent, which belongs to rigid uniform motion. The corresponding phase changes of the two time sequences have a unified spatial displacement pattern. The oil film is a viscous liquid fluid and cannot rotate synchronously with the metal matrix. It is subjected to shear slip and produces local disordered flow. The flow velocity of the oil film in different regions is inconsistent, which belongs to non-rigid convection motion. The displacement changes of the phase distortion of the two time sequences are chaotic. By utilizing the natural difference in motion properties between the uniform displacement of the rigid workpiece and the non-uniform convection displacement of the oil film, the non-rigid convection velocity component brought by the oil film can be separated by comparing the phase change trajectory of the first and second time sequence wrapping phase fields. By backtracking along the flow direction, the additional phase of the dynamic oil film is canceled out, and the initial wrapping phase field after removing the dynamic interference is obtained.

[0035] Methods for obtaining the initial wrapper phase field include: By comparing the phase value changes of each pixel between the first and second temporal wrapped phase fields, the spatial optical flow velocity distribution of the entire pixel domain is obtained. A pyramid-based optical flow calculation method is employed, constructing four-layer Gaussian pyramids for both the first and second temporal wrapped phase fields, with each layer's image size being one-quarter of the previous layer. Initial optical flow estimates are calculated at the top layer of the pyramid, using the Lucas-Kanade local weighted least squares method to solve for the velocity vector of each pixel (e.g., setting the local window size to 15×15 pixels). The top-layer calculation results are passed to the next layer as initial values, and this process is refined layer by layer until the bottom layer, yielding the spatial optical flow velocity vector for each pixel. This spatial optical flow velocity vector includes both horizontal and vertical velocity components.

[0036] Based on the gradient and divergence differences in the spatial optical flow field velocity distribution, the non-rigid convection velocity components caused by dynamic oil film are identified. The first-order spatial partial derivatives of the horizontal and vertical velocity components of each pixel in the spatial optical flow field velocity distribution of the entire pixel area are calculated to obtain the spatial optical flow field velocity gradient tensor of the entire pixel area. The divergence value of each pixel in the spatial optical flow field velocity gradient tensor is obtained by summing the diagonal elements of the spatial optical flow field velocity gradient tensor.

[0037] Simultaneously, the off-diagonal elements in the spatial optical flow field velocity gradient tensor are used to perform interpolation to obtain the curl value of each pixel in the spatial optical flow field velocity distribution of the entire pixel. The first-order partial derivative of the curl value is then calculated to obtain the curl gradient magnitude of each pixel in the spatial optical flow field velocity distribution.

[0038] The arithmetic mean of the divergence values ​​of all pixels is used as the baseline divergence value; the difference between the divergence value of each pixel and the baseline divergence value is used as the divergence residual, and pixels with a divergence residual greater than zero are marked as divergence outliers.

[0039] The arithmetic mean of the curl gradient magnitudes of all pixels is used as the baseline curl gradient value. The algebraic difference between the curl gradient magnitude of each pixel and the baseline curl gradient value is used as the curl gradient residual. Pixels with curl gradient residuals greater than zero are marked as curl gradient outliers.

[0040] Pixels simultaneously marked as divergence anomalies and curl gradient anomalies are identified as non-rigid fluid convection points. The instantaneous displacement vectors corresponding to the non-rigid fluid convection points are isolated and extracted from the spatial optical flow field velocity distribution of the global pixels to obtain the non-rigid convection velocity components caused by the dynamic oil film.

[0041] Spatial topological backtracking is performed on the global pixels along the opposite direction of the non-rigid convection velocity component to obtain the local phase rheological variation caused by the dynamic oil film motion. The instantaneous displacement vector of each non-rigid fluid convection point in the non-rigid convection velocity component is inverted to obtain the reverse motion vector field of the global pixels during the spatial topological backtracking process. Using a spatial bilinear interpolation coordinate mapping operator, the two-dimensional spatial coordinates of each pixel in the global pixels are traced backward along the direction of the reverse motion vector field to find the coordinates of the predecessor pixel at the time-backtracking predecessor position. The phase value of the predecessor pixel coordinates is retrieved in the first temporal enveloping phase field, and the original position phase value of the corresponding pixel in the first temporal enveloping phase field is extracted simultaneously. The original position phase value is algebraically subtracted from the predecessor position phase value to obtain the local phase rheological variation.

[0042] Meanwhile, for pixels not identified as non-rigid fluid convection points, their instantaneous displacement vector is set to zero, and the velocity component at the corresponding position in the reverse motion vector field is set to zero. That is, rigid regions do not produce local phase rheological differences.

[0043] By combining the measured micro-amplitude time interval parameter (i.e., the time difference between the first and second time sequences) to perform spatiotemporal mapping on the local phase rheological difference, an instantaneous flow phase shift is formed. Instantaneous flow phase shift = local phase rheological difference ÷ micro-amplitude time interval parameter; this quantifies the intensity of transient phase interference caused by the oil film fluid motion in the first time sequence.

[0044] Lock the pixels at the same horizontal and vertical coordinate positions in the first temporal wrapping phase field and the instantaneous flow phase offset. Subtract the instantaneous flow phase offset from the wrapping phase value of the corresponding pixel in the first temporal wrapping phase field to complete the stripping of the first temporal wrapping phase field and obtain the initial wrapping phase field.

[0045] The metal thread substrate and the liquid oil film have inherent optical differences in polarized incident light: the metal substrate reflects polarized light with small attenuation of polarization state and strong polarization retention capability; the oil film is a transparent medium, and multi-layer refraction will cause polarization attenuation and phase delay shift; the optical path loss caused by light rays with different polarization directions penetrating the same thickness of static oil film is different; the phase shift and the degree of polarization degradation have a fixed physical mapping relationship; by inverting the fixed adhesion phase shift caused by the static oil film through the polarization degradation, the shift is quantitatively subtracted from the initial wrapped phase field to eliminate the interference of static residual oil, thereby obtaining a pure phase field that only represents the true morphology of the thread.

[0046] Methods for eliminating the adhesion phase shift caused by static oil film include: The phase spatial distribution array of the four polarization channels in the first time sequence is analyzed. The phase delay of the same pixel under different polarization directions (used to represent the degree of phase lag deviation relative to the oil-free metal reference condition after different polarized light rays penetrate the oil film at the same pixel position) and the polarization degradation (used to characterize the attenuation of the polarization regularity of the incident polarized light after reflection from the threaded test surface compared to the incident light source) are extracted and mapped to generate a physical feature map of spatial polarization anisotropy distribution. The phase value corresponding to the phase spatial distribution array in the 0° polarization direction is selected as the reference phase. The phase lag difference of the corresponding phase values ​​in the four polarization directions of 45°, 90°, and 135° relative to the reference phase is calculated respectively. The average value of the three sets of phase lag differences is taken as the phase delay of the corresponding pixel.

[0047] The ratio of the range to the mean of the phase values ​​in the four polarization directions of 0°, 45°, 90°, and 135° is used as the polarization degree degradation. Among them, the polarization loss of the metal substrate is extremely low, while the polarization loss of the oil-coated area is significantly larger.

[0048] The polarization degree degradation and phase delay of each pixel in the entire domain are repositioned and assembled into a two-dimensional spatial geometric matrix according to the original horizontal and vertical coordinate positions, forming a physical feature map of spatial polarization anisotropy distribution.

[0049] Based on the stable polarization retention characteristics of metals and the polarization degradation characteristics caused by multilayer refraction of liquid oil films, the physical characteristic map of spatial polarization anisotropy distribution is divided to obtain the rigid substrate region and the residual boundary film region.

[0050] The stable polarization retention characteristic of metals specifically refers to the fact that when a bare, oil-free metal threaded substrate receives multi-polarized incident light, the phase values ​​corresponding to different polarization dimensions fluctuate little and the degree of polarization loss is low. As a result, the phase delay and polarization degradation obtained by multi-polarization measurement at the same pixel position are generally in a low fluctuation range.

[0051] The polarization degradation characteristics caused by multi-layer refraction of liquid oil film specifically refer to the following: when a static oil film is attached to the surface of the thread of an oil pipe fitting, the incident light rays pass through the air medium and the oil film medium in sequence and arrive at the surface of the metal thread substrate. The continuous refraction at the interface of the two media causes polarization energy loss and phase lag, resulting in the phase delay and polarization degradation of the corresponding pixel position being in the high step range as a whole.

[0052] The arithmetic mean of the polarization degradation of all pixels in the physical feature map of spatial polarization anisotropy distribution is used as the reference value. Pixels with polarization degradation less than or equal to the reference value are classified as rigid substrate regions, and pixels with polarization degradation greater than the reference value are classified as residual boundary film regions. The classification results are output in the form of a binary mask map, with a mask value of 0 for rigid substrate regions and a mask value of 1 for residual boundary film regions.

[0053] By pre-setting the physical mapping relationship between the refractive index of the medium and the phase attenuation, and combining it with the degree of polarization degradation in the residual boundary film region, a quantitative analysis is performed to obtain the absolute shift of the adhesion phase of the static oil film.

[0054] The physical mapping relationship refers to the fixed physical correspondence between the inherent refractive index of a static oil film, a medium with fixed physical properties, and the phase attenuation caused by light passing through the oil film. This physical mapping relationship is obtained by fitting experimentally calibrated data. Specifically: A set of standard oil film samples with known thicknesses were prepared. For each standard oil film sample, a physical feature map of spatial polarization anisotropy was generated, and the polarization degradation in the residual boundary film region was extracted. A correlation was established between the oil film thickness and the corresponding polarization degradation of the standard oil film samples. The correlation between oil film thickness and the absolute shift of the attached phase was established using optical interference principles. By combining the two sets of correlations, the mapping coefficient between the polarization degradation and the absolute shift of the attached phase was obtained.

[0055] The absolute attachment phase offset of each pixel within the residual boundary film region is obtained by multiplying the polarization degradation by a mapping coefficient. The absolute attachment phase offset of the rigid substrate region (pixels with a mask value of 0 in the binary mask image) is set to 0. After traversing all pixels in the entire region, the absolute attachment phase offset caused by the static oil film at the corresponding pixel is obtained.

[0056] The attached absolute phase offset is removed point by point from the initial wrapped phase field, and the remaining phase data is spatially aligned and normalized to obtain a pure phase field.

[0057] S3. Based on the pure phase field, reconstruct the dense 3D point cloud, combine the original contour curvature features to identify and remove artifact regions, and form a standard 3D point cloud.

[0058] Methods for reconstructing dense 3D point clouds include: Perform spatiotemporal phase expansion processing on the pure phase field to obtain a global continuous absolute phase field.

[0059] In the pure phase field, the phase value corresponding to each pixel is constrained within a single phase period. However, the pure phase field exhibits a 2π numerical jump at the point where it crosses the period on the spatial threaded surface, resulting in spatial discontinuity and making it unsuitable for direct 3D spatial coordinate conversion. To address this, a spatiotemporal joint phase expansion method is employed. This method combines the continuity of temporal phase changes between adjacent frames with the continuity of spatial phase neighborhoods within a single frame. Periodic phase jumps in the pure phase field are eliminated point-by-point, and the phase values ​​at the jump points are periodically compensated and extended. This ensures that the phase data corresponding to all pixels in the oil pipe thread achieves spatial and temporal continuity, resulting in a jump-free, globally continuous absolute phase field suitable for spatial geometric calculations.

[0060] By retrieving the structural cursor positioning parameters and combining them with the optical imaging position corresponding to the global continuous absolute phase field, the three-dimensional spatial position information of each pixel on the threaded surface of the oil pipe fitting is obtained.

[0061] The structural cursor positioning parameters are hardware geometric parameters pre-stored in the industrial control computer, specifically including the external rotation matrix of the fringe projection device, the external translation vector of the fringe projection device, the internal distortion correction matrix of the industrial camera, and the internal intrinsic parameter matrix of the industrial camera.

[0062] Each pixel in the global continuous absolute phase field corresponds to a unique structured light fringe imaging position (including the two-dimensional imaging plane position information corresponding to the pixel row and column coordinates). Based on the structured light triangulation imaging principle, the phase value of the global continuous absolute phase field, the two-dimensional imaging plane position information, and the structured light calibration parameters are simultaneously geometrically calculated. The real spatial depth information and planar coordinate information corresponding to each imaging pixel are obtained pixel by pixel, forming the three-dimensional spatial position information corresponding to each pixel on the threaded surface of the oil pipe fitting.

[0063] By integrating all three-dimensional spatial location information to form a set of spatial points, a dense three-dimensional point cloud of oil pipe thread is generated.

[0064] Methods for generating standard 3D point clouds include: Perform a local k-neighborhood search for each spatial point in the dense point cloud of the thread (e.g., set the search count to 20). Use each spatial point as a reference to filter out the neighborhood point set of the corresponding spatial point.

[0065] The obtained neighborhood point set is fitted with a local quadratic surface to obtain the original contour curvature features. Specifically, the current spatial point is taken as the origin of the local coordinate system, and the normal vector direction of the current spatial point is taken as the Z-axis direction of the local coordinate system to establish a local rectangular coordinate system. The three-dimensional spatial coordinates of each neighborhood spatial point in the neighborhood point set are transformed into the local coordinate system to obtain the local coordinates of each neighborhood spatial point in the local coordinate system. The least squares method is used to fit the quadratic surface equation to solve for the local coordinates of each neighborhood spatial point to obtain the average curvature value of the current spatial point (the average curvature value reflects the degree of curvature of the surface at the current spatial point; a positive value indicates convex curvature, a negative value indicates concave curvature, and the larger the absolute value, the more severe the curvature). The average curvature value of each spatial point is recorded as the original contour curvature feature value. The original contour curvature feature values ​​of all spatial points are arranged in the order of spatial points to form the original contour curvature feature corresponding to the entire three-dimensional dense point cloud of the thread.

[0066] Establish a spatial step feature analysis window (for example, take the direction of the spiral trajectory in the three-dimensional dense point cloud of the thread as the starting position, and set the window width to 11 spatial points).

[0067] A windowed step scan is performed on the spatial first-order differential field extracted from the original contour curvature features to divide the dense 3D point cloud into artifact regions or local curvature abrupt defect regions. The spatial first-order differential field is used to quantify the rate and direction of curvature fluctuations in the local spatial location of the dense 3D point cloud of the thread. Positive and negative values ​​represent the concave and convex directions of the curvature fluctuations, and the magnitude of the value represents the severity of the curvature fluctuations.

[0068] Artifact regions refer to anomalous regions of curvature fluctuations on the surface of a dense 3D point cloud of a thread, formed during structured light 3D reconstruction due to the influence of periodic thread profile surface modulation, fringe imaging interference, and point cloud fitting errors. Local curvature abrupt change defect regions refer to isolated, non-periodic, step-like curvature abrupt changes in a real anomaly region formed at a local location within the dense 3D point cloud of an oil pipe fitting thread, where actual microscopic morphological damage exists.

[0069] Tangential smoothing is performed on the artifact region, that is, the three-dimensional spatial coordinates of the spatial points within the artifact region are low-pass filtered along the tangent direction of the thread helical trajectory to eliminate high-frequency regular jitter artifacts, while maintaining the macroscopic morphological features perpendicular to the thread surface. At the same time, spatial topology merging is performed in conjunction with local curvature abrupt defect regions to obtain the standard three-dimensional point cloud of oil pipe thread.

[0070] Methods for classifying regions into artifact regions or local curvature abrupt defect regions include: If the value of the first-order differential field exhibits a spatial periodic alternation of positive and negative values ​​locally, and the spatial distance between the peak (representing the location of the local maximum positive value in the first-order differential field) and the trough (representing the location of the local minimum negative value in the first-order differential field) corresponds to the stripe pixel period (referring to the spatial distance between adjacent bright stripes on the threaded surface projected by the structured light projection device, which is pre-stored in micrometers), then it is determined to be an artifact region.

[0071] The rule for determining periodic alternating positive and negative fluctuations is: if the probability that two adjacent values ​​in a first-order differential field have different signs is greater than 80%, then the alternating positive and negative condition is satisfied.

[0072] If the value of the first-order differential field exhibits an isolated, non-periodic, and drastic step increase in a local area, and the geometric widening of the local curvature abrupt change region is limited to a set micrometer-level size threshold, then it is determined to be a local curvature abrupt change region.

[0073] An isolated, non-periodic step surge indicates that the value of the first-order differential field suddenly becomes much larger than the values ​​of surrounding points (in either the positive or negative direction) at a local point, and this surge occurs only at a single or very few spatial points, without periodic repetition. The specific determination method is as follows: Within the statistical spatial step characteristic analysis window, excluding the center point, calculate the mean and standard deviation of the absolute values ​​of the first-order differential values ​​for all other spatial points; add three times the standard deviation to the mean as the step threshold. Iterate through the first-order differential values ​​within the window, marking spatial points with absolute values ​​greater than the step threshold as candidate mutation points; check whether the candidate mutation point is isolated within the window (i.e., neither of the two spatial points surrounding the candidate mutation point satisfies the step condition). If the candidate mutation point exists in isolation, it is determined that an isolated, non-periodic step surge exists.

[0074] The geometric widening limitation of the local curvature abrupt change region characterizes the overall spatial size of the continuous spatial region where a drastic change in the first-order differential field occurs, representing the actual extension range of the morphologically abnormal region. It is obtained by: starting from the candidate abrupt change point, extending forward and backward along the spiral trajectory until the first-order differential value returns to below the step threshold; calculating the spatial distance covered from the starting point to the end of the extension, which is taken as the geometric widening of the local curvature abrupt change region.

[0075] It should be explained that the micron-level size threshold is used to limit the effective size range of actual microscopic damage on the thread surface, filtering out interference from large-scale normal morphological fluctuations; the micron-level size threshold is obtained through offline experimental calibration data.

[0076] S4. Analyze the complete tooth profile to evaluate each deviation parameter, and combine the parameter verification and defect classification with the defect judgment rules to generate a defect judgment conclusion.

[0077] Methods for evaluating various deviation parameters include: Based on the standard 3D point cloud, the curvature features of the corrected contour are re-extracted, the evolution law of the macroscopic geometric waveform in the spatial axis is analyzed, the extreme value jump points of each curvature are locked, and the tooth crest, tooth flank and tooth root positions of the oil pipe thread are identified and marked.

[0078] Along the central axis of the oil pipe thread, the correction profile curvature features of all spatial points in the standard 3D point cloud are extracted and arranged according to their axial positions to form a one-dimensional curvature waveform curve (the horizontal axis represents the axial position, and the vertical axis represents the correction profile curvature features). For each point on the curvature waveform curve, the correction profile curvature features of that point are compared with those of the two adjacent points. If the correction profile curvature features of that point are greater than those of the two adjacent points, then that point is identified as a positive extreme value jump point among the curvature extreme value jump points. The positive extreme value jump point corresponds to the crest position of the oil pipe thread.

[0079] If the corrected profile curvature feature at a point is less than that of the two adjacent points, then that point is identified as a negative extreme value transition point among the extreme curvature transition points. The negative extreme value transition point corresponds to the root position of the thread in the oil pipe fitting. The transition interval between the positive extreme value transition point and the adjacent negative extreme value transition point is marked as the flank position.

[0080] Based on the spatial geometric center point of the tooth crest and root position (i.e. the three-dimensional spatial midpoint of a single set of corresponding tooth crest and root positions), a reverse fitting is performed. The fitted central axis equation is used as the rotation axis to drive the virtual cutting plane to perform equal-angle rotation step cutting along the thread helical trajectory (for example, the rotation step angle is set to 5°).

[0081] The virtual cutting plane is a two-dimensional spatial meridional plane containing the central axis equation and used to longitudinally cut the thread of oil pipe fittings. It is used to extract the thread profile cross-sectional shape under a single rotational cross-section dimension.

[0082] Extract and connect the spatial intersection point projections of the virtual cutting plane and the standard 3D point cloud, and extract the complete tooth profile contour line along the thread helical trajectory. The complete tooth profile contour line represents the overall closed curve of the continuous, uninterrupted, and fully covered thread helical extension path.

[0083] The complete tooth profile outline is aligned and compared with the standard theoretical outline to obtain tooth height, tooth angle, and local profile deviation parameters.

[0084] The tooth height deviation parameter is obtained by extracting the tooth crest point and the adjacent tooth root point from the complete tooth profile and calculating the difference as the measured tooth height. The measured tooth height is then compared with the theoretical tooth height in the standard theoretical profile to obtain the tooth height deviation parameter.

[0085] The tooth profile angle deviation parameter is obtained as follows: extract the left tooth lateral profile and the right tooth lateral profile from the complete tooth profile outline, fit the left tooth lateral line and the right tooth lateral line respectively, and obtain the included angle between the two lines as the measured tooth profile angle value; subtract the standard tooth profile angle value obtained by the standard theoretical profile from the measured tooth profile angle value to obtain the tooth profile angle deviation parameter.

[0086] The method for obtaining local contour deviation parameters is as follows: For each spatial point on the complete tooth profile contour line, calculate the normal distance from that point to the corresponding point on the standard theoretical contour line (where a positive value is taken when the spatial point is outside the standard theoretical contour line, indicating "protrusion", and a negative value is taken when it is inside, indicating "concavity"). The normal distance is used as the local contour deviation parameter for each spatial point.

[0087] Methods for generating defect determination conclusions include: Call the defect judgment rules stored in the memory for each threshold range; if the tooth height and tooth angle deviation parameters exceed the corresponding threshold range, it is judged as a dimensional defect and the defect location coordinates are output. The defect judgment rules include threshold ranges for judging tooth height deviation parameters, tooth angle deviation parameters, and local contour deviation parameters. For example, the acceptable threshold range for tooth height is ±0.50 mm, the threshold range for tooth angle deviation parameters is ±1°, and the threshold range for local contour deviation is ±0.50 mm.

[0088] For connected regions where the local contour deviation parameter exceeds the corresponding threshold range, the defect type is marked; the dimensional deviation judgment result and the defect type mark are summarized to generate the defect judgment conclusion.

[0089] Methods for marking defect types include: Data points whose local contour deviation parameters exceed the corresponding threshold range are extracted and designated as outlier data points. Spatially adjacent outlier data points are clustered into connected components. Each connected component corresponds to an independent morphological anomaly region on the surface of the oil pipe fitting thread.

[0090] The sign direction of the contour deviation parameter that accounts for more than half of the total within the connected domain is taken as the local contour deviation direction. That is, if the sign of the contour deviation parameter is positive, it means that the deviation direction is away from the outside of the central axis; if the sign of the contour deviation parameter is negative, it means that the deviation direction is towards the inside of the central axis.

[0091] If the local contour deviation direction within the connected domain is towards the interior of the central axis and the depth gradually changes, it is determined to be a concave defect; if the local contour deviation direction is away from the exterior of the central axis, it is determined to be a convex defect. If a connected region exhibits a narrow, linear extension with a sudden change in depth, it is considered a scratch defect.

[0092] The rule for determining the elongated linear extension shape is: the maximum extension length of the main axis of the connected region is greater than or equal to five times the maximum extension width perpendicular to the main axis direction.

[0093] The rule for determining depth gradient is: the rate of change of the contour deviation parameter between adjacent abnormal data points is less than 0.5.

[0094] The rule for determining sudden changes in depth is: the absolute value of the first derivative of each local contour deviation parameter within the connected domain, taken along the direction of the maximum principal axis extension, is greater than or equal to the rate of change threshold (e.g., 0.2).

[0095] If a connected region is located at the edge of the tooth crest or flank and causes a geometric break in the continuous tooth profile, it is considered a chipped corner defect. A geometric break is defined as a spatial distance between adjacent abnormal data points within the connected region that is greater than twice the normal point spacing, and the abnormal data points on both sides of the break are located at the tooth crest or flank edge of the same thread tooth, with the break direction perpendicular to the extension direction of the tooth profile.

[0096] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed in this invention can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementations should not be considered beyond the scope of this invention.

[0097] In the several embodiments provided by this invention, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only one method, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or units may be electrical, mechanical, or other forms.

[0098] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any changes or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in the present invention should be included within the scope of protection of the present invention.

[0099] In conclusion, the above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.

Claims

1. A method for detecting thread defects in oil pipe fittings based on structured light 3D reconstruction, characterized in that, The method includes: S1. Acquire multi-time-series, multi-polarization state reflected light field images of the threaded surface of an oil pipe fitting that is rotating at a constant speed, and perform spatial reconstruction to obtain the first time-series wrapped phase field and the second time-series wrapped phase field. S2. Based on the first time-series encapsulated phase field and the second time-series encapsulated phase field, identify the non-rigid convection velocity component caused by the dynamic oil film and perform backtracking peeling to obtain the initial encapsulated phase field. Further remove the attached phase offset caused by the static oil film from the initial encapsulated phase field to obtain the pure phase field. S3. Based on the pure phase field, reconstruct dense 3D point cloud, combine the original contour curvature features to identify and remove artifact regions, and form a standard 3D point cloud. S4. Analyze the complete tooth profile to evaluate each deviation parameter, and combine the parameter verification and defect classification with the defect judgment rules to generate a defect judgment conclusion.

2. The method for detecting thread defects in oil pipe fittings based on structured light three-dimensional reconstruction according to claim 1, characterized in that, The method for obtaining the first time-wrapped phase field and the second time-wrapped phase field includes: Standard phase-shift structured light stripes are projected onto the threaded surface of an oil pipe fitting that is held at a constant speed and rotated at the inspection station, and four sets of polarization direction switching operations are performed simultaneously; two sets of multi-time-series multi-polarization state reflected light field images at different spatial displacement time step points are captured in parallel. The reflection light field images of each time sequence and polarization state are scanned pixel by pixel. The gray value sequence of the same pixel is extracted and the phase is demodulated to obtain the time sequence-polarization multidimensional phase set of each pixel at different time steps and different polarization directions. The time-polarization multidimensional phase set is divided into phase space distribution arrays of four polarization channels each in the first time series and the second time series according to the time step point and polarization direction dimension, and then the full polarization mean fusion is performed to obtain the first time series wrapped phase field and the second time series wrapped phase field.

3. The method for detecting thread defects in oil pipe fittings based on structured light three-dimensional reconstruction according to claim 2, characterized in that, The method for obtaining the initial wrapped phase field includes: By comparing the phase value change trajectory of each pixel between the first time-series wrapped phase field and the second time-series wrapped phase field, the spatial optical flow field velocity distribution of the global pixels is obtained; based on the gradient and divergence differences in the spatial optical flow field velocity distribution, the non-rigid convection velocity component caused by the dynamic oil film is identified. Spatial topological backtracking of the global pixels along the opposite direction of the non-rigid convection velocity components yields the local phase rheological deterioration caused by the dynamic oil film motion. By combining the measured micro-amplitude time interval parameters, the local phase rheological difference is spatiotemporally mapped to form an instantaneous flow phase shift, which is then separated from the first time-series wrapped phase field to obtain the initial wrapped phase field.

4. The method for detecting thread defects in oil pipe fittings based on structured light three-dimensional reconstruction according to claim 3, characterized in that, The method for removing the adhesion phase offset caused by static oil film includes: The phase spatial distribution array of the four polarization channels in the first time sequence is analyzed, the phase delay and polarization degree degradation of the same pixel under different polarization directions are extracted, and the physical feature map of spatial polarization anisotropy distribution is generated by mapping. Based on the stable polarization retention characteristics of metals and the polarization degradation characteristics caused by multilayer refraction of liquid oil films, the physical characteristic map of spatial polarization anisotropy distribution is divided to obtain the rigid substrate region and the residual boundary film region. The physical mapping relationship between the refractive index of the preset medium and the phase attenuation is used to quantitatively analyze the degree of polarization degradation in the residual boundary film region, thereby obtaining the absolute shift of the static oil film's attachment phase. The attached absolute phase offset is removed point by point from the initial wrapped phase field, and the remaining phase data is spatially aligned and normalized to obtain a pure phase field.

5. The method for detecting thread defects in oil pipe fittings based on structured light three-dimensional reconstruction according to claim 4, characterized in that, The method for reconstructing dense 3D point clouds includes: Spatiotemporal phase expansion processing is performed on the pure phase field to obtain a global continuous absolute phase field; the structural cursor positioning parameters are retrieved and the optical imaging position corresponding to the global continuous absolute phase field is combined to calculate the three-dimensional spatial position information of each pixel on the surface of the oil pipe thread; all three-dimensional spatial position information is integrated to form a spatial point set, generating a dense three-dimensional point cloud of the oil pipe thread.

6. The method for detecting thread defects in oil pipe fittings based on structured light three-dimensional reconstruction according to claim 5, characterized in that, The method for forming a standard three-dimensional point cloud includes: For each spatial point in the three-dimensional dense point cloud of the thread, a local k-neighborhood search is performed, and the obtained neighborhood point set is fitted with a local quadratic surface to obtain the original contour curvature features. A spatial stepping feature analysis window is established to perform window stepping scanning on the spatial first-order differential field extracted from the original contour curvature features, dividing the dense three-dimensional point cloud into artifact regions or local curvature abrupt defect regions. Tangential smoothing is performed on the artifact region, and spatial topology merging is performed in conjunction with the local curvature abrupt defect region to obtain the standard three-dimensional point cloud of oil pipe thread.

7. The method for detecting thread defects in oil pipe fittings based on structured light three-dimensional reconstruction according to claim 6, characterized in that, The method for dividing regions into artifact regions or local curvature abrupt defect regions includes: If the value of the first-order differential field exhibits a spatial periodic alternation of positive and negative values ​​locally, and the spatial spacing between the peaks and troughs corresponds to the period of the stripe pixels, then it is determined to be an artifact region. If the value of the first-order differential field exhibits an isolated, non-periodic, and drastic step increase in a local area, and the geometric widening of the local curvature abrupt change region is limited to a set micrometer-level size threshold, then it is determined to be a local curvature abrupt change region.

8. The method for detecting thread defects in oil pipe fittings based on structured light three-dimensional reconstruction according to claim 7, characterized in that, The method for evaluating each deviation parameter includes: Based on the standard 3D point cloud, the curvature features of the corrected contour are re-extracted, the evolution law of the macroscopic geometric waveform in the spatial axis is analyzed, the extreme value jump points of each curvature are locked, and the tooth crest position, tooth flank position and tooth root position of the oil pipe thread are identified and marked. Based on the spatial geometric center points of the tooth crest and root positions, reverse fitting is performed, and the fitted central axis equation is used as the rotation axis to drive the virtual cutting plane to perform equal-angle rotation step cutting along the thread helical trajectory. Extract and connect the spatial intersection point projection set of the virtual cutting plane and the standard 3D point cloud, and extract the complete tooth profile outline along the spiral trajectory; align and compare the complete tooth profile outline with the standard theoretical outline to obtain tooth height, tooth angle, and local profile deviation parameters.

9. The method for detecting thread defects in oil pipe fittings based on structured light three-dimensional reconstruction according to claim 8, characterized in that, The method for generating defect determination conclusions includes: Call the defect judgment rules stored in the memory for each threshold range; if the tooth height and tooth angle deviation parameters exceed the corresponding threshold range, it is judged as a dimensional defect and the defect location coordinates are output. For connected regions where the local contour deviation parameter exceeds the corresponding threshold range, the defect type is marked; the dimensional deviation judgment result and the defect type mark are summarized to generate the defect judgment conclusion.

10. The method for detecting thread defects in oil pipe fittings based on structured light three-dimensional reconstruction according to claim 9, characterized in that, The method for marking defect types includes: Data points whose local contour deviation parameters exceed the corresponding threshold range are extracted as outlier data points; spatially adjacent outlier data points are clustered into connected components. If the local contour deviation direction within the connected domain is towards the interior of the central axis and the depth gradually changes, it is determined to be a concave defect; if the local contour deviation direction is away from the exterior of the central axis, it is determined to be a convex defect. If a connected region exhibits a narrow, linear extension with a sudden change in depth, it is classified as a scratch defect; if a connected region is located at the edge of the tooth crest or lateral surface and causes a geometric break in the continuous tooth profile, it is classified as a chipped corner defect.