A multi-parameter integrated visual measurement method for external threads of oil pipes

By building a multi-parameter integrated visual measurement system for the external thread of oil pipes, the problems of slow detection speed and poor applicability of external threads of oil pipes in the existing technology have been solved, and high-precision calculation of multiple parameters and improvement of detection efficiency have been achieved.

CN118565346BActive Publication Date: 2024-10-29CHINA UNIV OF PETROLEUM (EAST CHINA)

Patent Information

Application Number
CN202411033036.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-07-30
Publication Date
2024-10-29
Estimated Expiration
2044-07-30

AI Technical Summary

Technical Problem

Existing methods for detecting external threads of oil pipes have slow detection speeds, are highly influenced by human factors, are not suitable for oil pipes of different specifications, and fail to effectively solve the measurement accuracy problems caused by the non-perpendicularity of the thread axis to the optical axis of the camera and the thread helix angle.

Method used

A multi-parameter integrated visual measurement method for the external thread of the oil pipe is adopted, including building a measurement system consisting of a telecentric light source, a telecentric lens, a camera and a workbench. By calibrating the telecentric lens parameters, correcting the thread image profile, and adaptively extracting the thread axis The effective area of ​​the cross-section profile and calculation of thread geometric parameters.

Benefits of technology

It achieves high-precision calculation of multiple parameters of the external thread of the oil pipe, reduces the impact of the non-perpendicularity of the thread axis and the optical axis of the camera and the thread helix angle on the measurement accuracy. It is suitable for oil pipes of different specifications and improves detection efficiency and accuracy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118565346B_ABST
    Figure CN118565346B_ABST
Patent Text Reader

Abstract

The present invention belongs to the technical field of oil and gas detection devices, and in particular, relates to a multi-parameter integrated visual measurement method for external threads of oil pipes. The measurement method can adaptively extract the effective area of ​​the thread, and can realize the correction of the thread image tooth profile; according to the thread image collected during the detection process, high-precision calculation of multiple parameters of the external threads of the oil pipe is realized. A multi-parameter integrated visual measurement method for external threads of oil pipes, comprising the following steps: step (1): building a multi-parameter integrated visual measurement system for external threads of oil pipes required for the multi-parameter integrated visual measurement method for external threads of oil pipes; step (2): calibrating the parameters of the telecentric lens; step (3): correcting the tooth profile of the external thread image; step (4): segmenting the external thread contour, and adaptively extracting the effective area of ​​the tooth profile of the external thread shaft section; step (5): calculating the geometric parameters of the external thread.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention belongs to the technical field of oil and gas detection devices, and in particular relates to a multi-parameter integrated visual measurement method for external threads of an oil pipe. Background Art

[0002] Oil pipes are an important part of oil extraction equipment. With the development of oil extraction technology, the service environment of oil pipes is becoming increasingly harsh. The threaded connection is a relatively weak link in the oil well pipe system, and its thread processing quality directly affects the safety of oil extraction operations. Therefore, the parameters of the external thread of the oil pipe must be accurately tested and strictly supervised before it leaves the factory to ensure that it meets the relevant design requirements and standard specifications.

[0003] Common parameters for evaluating the processing quality of external threads of oil pipes include pitch, crest height, tooth height and taper. The existing external thread parameter detection method of oil pipes is mainly contact-based. This detection method is not only slow in detection speed and greatly affected by human factors, but also has a single parameter for thread gauge detection. Vision, as a new type of measurement method, has the advantages of non-contact, strong universality, high efficiency and high precision. Among them, the patent number applied by Nantong University is CN109060836A. The "High-pressure oil pipe joint external thread detection method based on machine vision" provides a high-pressure oil pipe joint external thread detection method based on machine vision. A measurement platform consisting of a camera, a lens, a parallel light source and a computer is built. The camera collects the thread profile and transmits it to the computer. The thread parameters are calculated after the collected image is processed. However, the invention does not consider the problem of thread image tooth type occlusion caused by the non-perpendicularity between the thread axis and the camera optical axis and the thread helix angle. In 2011, Zhao Yinhua et al. invented a special external thread automatic detection platform based on visual methods in their patent number CN201837591U "Liquefied Petroleum Gas Cylinder External Thread Detection Platform". The platform consists of a main frame, a pressing mechanism, a lifting mechanism, a special tray and a visual detection system. It can automatically detect the external threads at the gas inlet of the liquefied gas cylinder. However, the platform is only suitable for detecting the external threads of the gas cylinder that match the tray size. When the size of the tested part changes, the corresponding tray needs to be replaced, and the universality of the detection platform is poor.

[0004] Based on this, it is urgent for technical personnel in this field to further provide a multi-parameter integrated visual measurement method for external threads of oil pipes to meet the measurement requirements of multiple parameters of external threads of oil pipes. Summary of the invention

[0005] The present invention provides a multi-parameter integrated visual measurement method for external threads of oil pipes. The measurement method can adaptively extract the effective area of ​​the thread and correct the tooth shape of the thread image; based on the thread image collected during the detection process, high-precision calculation of multiple parameters of the external threads of the oil pipes is achieved.

[0006] In order to solve the above technical problems, the present invention adopts the following technical solutions:

[0007] A multi-parameter integrated visual measurement method for external threads of an oil pipe comprises the following steps:

[0008] Step (1): constructing a multi-parameter integrated visual measurement system for external threads of an oil pipe required for the multi-parameter integrated visual measurement method for external threads of an oil pipe; the multi-parameter integrated visual measurement system for external threads of an oil pipe at least comprises a telecentric light source, a telecentric lens, a camera and a workbench;

[0009] Step (2): Calibrate telecentric lens parameters;

[0010] Step (3): Correct the external thread image tooth shape;

[0011] Step (4): segment the external thread profile and adaptively extract the effective area of ​​the external thread shaft cross-section tooth profile;

[0012] Step (5): Calculate the external thread geometric parameters.

[0013] Preferably, the specific process of calibrating the telecentric lens parameters in step (2) can be described as follows:

[0014] The imaging model of a telecentric lens satisfies:

[0015] (1);

[0016] in, is the three-dimensional coordinates of the corner points of the chessboard calibration plate in the world coordinate system, is the magnification of the telecentric lens, , For each pixel in the image coordinate system and The physical size in the direction, is the coordinate of the origin of the image coordinate system in the pixel coordinate system, , They are the rotation matrix and translation vector that transform the world coordinate system to the camera coordinate system;

[0017] After acquiring the checkerboard image of the calibration plate, extract the pixel coordinates of the checkerboard corners and calculate the average pixel length of all squares in the checkerboard image; combine the physical size of each square on the checkerboard to calculate the magnification to satisfy:

[0018] (2);

[0019] Where: is the magnification of the telecentric lens, Indicates the physical length of each grid of the chessboard calibration plate, in units of , Indicates the average number of pixels per grid on the checkerboard calibration plate, in pixels.

[0020] Preferably, before implementing step (3), the method further comprises:

[0021] Step (300): pre-processing the thread image;

[0022] The gray value linear transformation method of point operation is used to improve the contrast of the thread image;

[0023] Gray threshold segmentation method is used to segment the thread image;

[0024] The Canny algorithm is used to detect the edge of the thread image;

[0025] The interpolation method is used to perform sub-pixel positioning of the thread image.

[0026] Preferably, the specific process of correcting the external thread image tooth profile in step (3) can be described as follows:

[0027] A mathematical model is established for the external thread in the external thread image; the axis section coordinate system O-XYZ is established with the center of the small end face of the thread as the origin O; the positive direction of the Z axis points from the origin along the thread axis to the center of the large end face of the thread, the thread axis section is taken as the XOZ plane, and the Y axis direction is determined by the right-hand rule; take a point on the external thread profile ,point The angle of motion along the spiral line is After arriving A point on the thread profile ,point The coordinates are the theoretical tooth profile equation of the external thread of the oil pipe at the ideal position, which satisfies:

[0028] (3);

[0029] in, satisfy:

[0030] ;

[0031] is the external thread pitch, For point Distance to the external thread axis, is the number of teeth, is the external thread top arc radius, It is the small end diameter of the external thread. The major diameter of the small end face of the external thread. It is the half angle of external thread profile. is the taper half angle of the external thread;

[0032] The axial section is perpendicular to the plane where the camera optical axis and the worktable axis are located, that is, perpendicular to the YOZ plane; let formula (3) , the S equation of the tooth profile on the shaft section can be calculated, which satisfies:

[0033] (4);

[0034] in, satisfy:

[0035] ;

[0036] When the external thread of the oil pipe is in a general position, the projection coordinate system O-UVW is introduced; the UOW plane is the projection plane; the angle between the axial section XOZ and the projection plane is , the angle between the axis and the VOW plane is ; By rotating the workpiece and taking two images 90° apart, the angle is calculated and ;

[0037] Will As a general position, solve the difference curve; according to the conversion relationship between the axial section coordinate system O-XYZ and the projection coordinate system O-UVW, combine equations (3) and (4) to obtain the theoretical tooth profile equation in the general position, which satisfies:

[0038] (5);

[0039] The theoretical tooth profile S equation of the axial section in general position satisfies:

[0040] (6);

[0041] Taking the upper surface of the external thread profile as an example, the theoretical difference equation of the theoretical tooth profile line S of the axial section at a general position under the influence of the thread helix angle is solved to satisfy:

[0042] (7);

[0043] in, , ;

[0044] According to the position of the thread axis, the corresponding relationship between the points on the tooth profile of the image under the projection coordinate system O-UVW and the points on the tooth profile of the axial section under the axial section coordinate system O-XYZ is obtained, which satisfies:

[0045] (8);

[0046] The tooth profile of the external thread image can be corrected through this corresponding relationship.

[0047] Preferably, the specific process of adaptively extracting the effective area of ​​the tooth profile of the external thread shaft section in step (4) can be described as follows:

[0048] The Ramer-Douglas-Peucker algorithm is used to segment the external thread profile and distinguish the arc segments and straight line segments.

[0049] After eliminating the first two incomplete arcs at the corners at both ends of the external thread image, a series of arcs are obtained;

[0050] Take out the top and bottom coordinate values ​​and use them as a reference to intercept the effective thread profile.

[0051] Preferably, among the external thread geometric parameters calculated in step (5), the pitch ,satisfy: (9) ;

[0052] Taper ,satisfy: (10) ;

[0053] Tooth height ,satisfy: (11) ;

[0054] Tooth top height ,satisfy: (12) .

[0055] The present invention provides a multi-parameter integrated visual measurement method for external threads of oil pipes, and the visual measurement method comprises the following steps: step (1): building a multi-parameter integrated visual measurement system for external threads of oil pipes required for the multi-parameter integrated visual measurement method for external threads of oil pipes; step (2): calibrating the parameters of the telecentric lens; step (3): correcting the tooth profile of the external thread image; step (4): segmenting the external thread profile, and adaptively extracting the effective area of ​​the tooth profile of the external thread shaft section; step (5): calculating the geometric parameters of the external thread. Compared with the existing measurement method, the multi-parameter integrated visual measurement method for external threads of oil pipes with the above-mentioned step characteristics reduces the influence of the non-perpendicularity between the thread axis and the camera optical axis and the thread helix angle on the measurement accuracy; for oil pipes of different specifications, the effective area of ​​the thread can be adaptively obtained, and the calculation of its parameters can be realized; in addition, multiple parameters of the external threads of the oil pipes can be obtained through a single measurement process, thereby improving the detection accuracy and detection efficiency of visual detection. BRIEF DESCRIPTION OF THE DRAWINGS

[0056] The accompanying drawings are used to provide a further understanding of the present invention and constitute a part of the specification. Together with the embodiments of the present invention, they are used to explain the present invention and do not constitute a limitation of the present invention. In the following drawings:

[0057] Figure 1 A schematic diagram of the process of the multi-parameter integrated visual measurement method for external threads of oil pipes provided by the present invention;

[0058] Figure 2 The schematic diagram of the structure of the multi-parameter integrated visual measurement system for external threads of oil pipes;

[0059] Figure 3 It is a schematic diagram of the projection of the external thread of the oil pipe in a general position;

[0060] Figure 4 Schematic diagram of the mapping relationship between thread taper and pitch;

[0061] Figure 5 Schematic diagram of the mapping relationship between thread height and crest height.

[0062] Figure numerals: 1. Telecentric light source; 2. Telecentric lens; 3. Camera; 4. Workbench. DETAILED DESCRIPTION

[0063] The present invention provides a multi-parameter integrated visual measurement method for external threads of oil pipes. The measurement method can adaptively extract the effective area of ​​the thread and correct the tooth shape of the thread image; based on the thread image collected during the detection process, high-precision calculation of multiple parameters of the external threads of the oil pipes is achieved.

[0064] A multi-parameter integrated visual measurement method for external threads of oil pipes, such as Figure 1 As shown, the following steps are included:

[0065] Step (1): Build a multi-parameter integrated visual measurement system for external threads of oil pipes required for the multi-parameter integrated visual measurement method for external threads of oil pipes. Figure 2 As shown, the multi-parameter integrated visual measurement system for external threads of oil pipes at least includes a telecentric light source 1, a telecentric lens 2, a camera 3 and a workbench 4.

[0066] It is worth noting that the multi-parameter integrated visual measurement system for the external thread of the oil pipe can be set up in the following manner: the telecentric light source 1 and the telecentric lens 2 are located on both sides of the external thread, the telecentric light source 1 and the telecentric lens 2 are arranged coaxially opposite to each other, and the axes of the two are perpendicular to the axis of the external thread. The external thread is placed on the workbench 4 and is at the object distance of the telecentric lens 2. Figure 2As shown, the telecentric light source 1 is used to enhance the external thread profile information, and the telecentric lens 2 is used to collect high-quality images of the external thread shaft section. Furthermore, the specific parameters of the telecentric light source 1, telecentric lens 2, camera 3 and workbench 4 can be referred to as follows: The telecentric lens 2 uses the TCCR3M080-C compact double-sided telecentric lens of Opto Engineering, and the image shape and size are , working distance 226.8mm, depth of field 19.9mm; telecentric light source 1 uses model LTCLCR080-G light source, and is compatible with telecentric lens 2; camera 3 uses model MARS-1230-23U3M high-resolution CMOS area array camera, with a resolution of 4096×3000 pixels, a frame rate of 23.4fps, and a pixel size of 3.45μm×3.45μm; the specification of the thread to be measured is 2-7 / 8 inches.

[0067] Step (2): Calibrate telecentric lens parameters.

[0068] As a preferred embodiment of the present invention, the specific process of calibrating the telecentric lens parameters in step (2) can be described as follows:

[0069] The imaging model of a telecentric lens satisfies:

[0070] (1);

[0071] in, is the three-dimensional coordinates of the corner points of the chessboard calibration plate in the world coordinate system, is the magnification of the telecentric lens, , For each pixel in the image coordinate system and The physical size in the direction, is the coordinate of the origin of the image coordinate system in the pixel coordinate system, , They are the rotation matrix and translation vector that transform the world coordinate system to the camera coordinate system.

[0072] After acquiring the checkerboard image of the calibration plate, extract the pixel coordinates of the checkerboard corners and calculate the average pixel length of all squares in the checkerboard image; combine the physical size of each square on the checkerboard to calculate the magnification to satisfy:

[0073] (2);

[0074] in, is the magnification of the telecentric lens, Indicates the physical length of each grid of the chessboard calibration plate, in units of , Indicates the average number of pixels per grid on the checkerboard calibration plate, in pixels.

[0075] It is worth noting that in order to reduce the distortion of the chessboard calibration plate image, the chessboard calibration plate needs to be perpendicular to the optical axis of the telecentric lens 2 and the workbench 4. After fixing the multi-parameter integrated visual measurement system for the external thread of the oil pipe, the calibration of the telecentric lens parameters begins. Here, taking the transparent chessboard calibration plate as an example, the average side length of the chessboard in the collected image is 59.32 pixels. Combined with the side length of the chessboard of 1.35 mm, the magnification of the telecentric lens 2 at the calibration plate position is obtained, which meets .

[0076] Step (3): Modify the external thread image profile.

[0077] As a preferred embodiment of the present invention, the specific process of correcting the external thread image tooth profile in step (3) can be described as follows:

[0078] A mathematical model is established for the external threads in the external thread image; Figure 3 As shown in the figure, take the center of the small end face of the thread as the origin O, and establish the axis section coordinate system O-XYZ; the positive direction of the Z axis points from the origin along the thread axis to the center of the large end face of the thread, the thread axis section is taken as the XOZ plane, and the Y axis direction is determined by the right-hand rule; take a point on the external thread profile ,point The angle of motion along the spiral line is After arriving A point on the thread profile ,point The coordinates are the theoretical tooth profile equation of the external thread of the oil pipe at the ideal position, which satisfies:

[0079] (3);

[0080] in, satisfy: ;

[0081] is the external thread pitch, For point Distance to the external thread axis, is the number of teeth, is the external thread top arc radius, It is the small end diameter of the external thread. The major diameter of the small end face of the external thread. It is the half angle of external thread profile. is the taper half angle of the external thread;

[0082] The axial section is perpendicular to the plane where the camera optical axis and the worktable axis are located, that is, perpendicular to the YOZ plane; let formula (3) , the S equation of the tooth profile on the shaft section can be calculated, which satisfies:

[0083] (4);

[0084] in, satisfy: ;

[0085] When the external thread of the oil pipe is in a general position, the projection coordinate system O-UVW is introduced; the UOW plane is the projection plane; the angle between the axial section XOZ and the projection plane is , the angle between the axis and the VOW plane is ; By rotating the workpiece and taking two images 90° apart, the angle is calculated and ;

[0086] Will As a general position, solve the difference curve; according to the conversion relationship between the axial section coordinate system O-XYZ and the projection coordinate system O-UVW, combine equations (3) and (4) to obtain the theoretical tooth profile equation in the general position, which satisfies:

[0087] (5);

[0088] The theoretical tooth profile S equation of the axial section in general position satisfies:

[0089] (6);

[0090] Taking the upper surface of the external thread profile as an example, the theoretical difference equation of the theoretical tooth profile line S of the axial section at a general position under the influence of the thread helix angle is solved to satisfy:

[0091] (7);

[0092] in, , ;

[0093] According to the position of the thread axis, the corresponding relationship between the points on the tooth profile of the image under the projection coordinate system O-UVW and the points on the tooth profile of the axial section under the axial section coordinate system O-XYZ is obtained, which satisfies:

[0094] (8);

[0095] The correspondence between each point on the tooth profile of the image under the projection coordinate system O-UVW and each point on the tooth profile of the axial section under the axial section coordinate system O-XYZ can realize the correction of the tooth profile of the external thread image.

[0096] One point that needs to be supplemented is that according to the API standard, all parameters of external threads are defined on an axial section passing through the thread axis. The external thread profile distortion is mainly affected by two factors: on the one hand, due to the existence of the thread helix angle and the influence of the taper, the tooth profile of the external thread axial section in the collected external thread image is blocked by the spiral surface, resulting in tooth distortion; on the other hand, during the measurement process, due to factors such as the fixture accuracy and the thread clamping position, the external thread axis is in a general position that is not perpendicular to the camera optical axis, causing the actual imaging section to deviate from the axial section and produce occlusion. Therefore, in step (3), the technical means of establishing a mathematical model for the external thread is used to eliminate the above-mentioned external thread profile distortion phenomenon.

[0097] Specifically, a point on the outer thread profile Take it as an example to illustrate. First, according to the API standard, a mathematical model is established for the external thread, and the axial section coordinate system O-XYZ is established with the center of the small end face of the thread as the origin O. The positive direction of the Z axis points from the origin O along the thread axis to the center of the large end face of the thread. The thread axial section is taken as the XOZ plane, and the Y-axis direction is determined by the right-hand rule to obtain the theoretical tooth profile equation of the external thread of the oil pipe in the ideal position. When the external thread of the oil pipe is in a general position, the projection coordinate system O-UVW is introduced, where the UOW plane is the projection plane. The angle between the axial section XOZ and the projection plane is , and the angle between the axis and the VOW plane is Rotate the workpiece and take two images 90° apart to calculate the angle ,angle It will not affect the difference between the tooth profile projection curve and the axial section tooth profile projection curve in the axial direction. As a general position, the difference curve is solved. According to the conversion relationship between the axis section coordinate system O-XYZ and the projection coordinate system O-UVW, (3) and (4) are combined to calculate the theoretical difference of the axis section theoretical tooth profile S under the general position, which satisfies According to the correspondence between the tooth profile points of the image in the projection coordinate system O-UVW and the points on the tooth profile of the axial section in the axial section coordinate system O-XYZ, the corrected coordinates of the point Q on the external thread profile are calculated by combining equations (5) to (8), satisfying .

[0098] The specific process of adaptively extracting the effective area of ​​the tooth profile of the external thread shaft section in step (4) can be described as follows:

[0099] The Ramer-Douglas-Peucker algorithm is used to segment the external thread profile and distinguish the arc segments and straight line segments.

[0100] After eliminating the first two incomplete arcs at the corners at both ends of the external thread image, a series of arcs are obtained;

[0101] Take out the top and bottom coordinate values ​​and use them as a reference to intercept the effective thread profile.

[0102] One point that needs to be supplemented is that the Ramer-Douglas-Peucker algorithm used in the contour segmentation process can be described as an algorithm that downsamples a curve or polyline composed of multiple points into a similar curve or polyline with a smaller number of points. The specific process can be referred to as follows:

[0103] 1) Define the starting curve as a set of ordered points or lines, and then set a distance dimension ;

[0104] 2) Fit the straight line between the first point and the last point as the chord of the starting curve;

[0105] 3) Calculate the distance from all points on the starting curve to the above straight line, and get the point farthest from the straight line. The farthest distance is ;

[0106] 4) Compare the longest distance And the distance dimension The size of , then we can ignore all the points on the curve and use this straight line as an approximation of the curve; if , then this point is retained, and the original curve is divided into two segments based on this point, and the process is continued recursively;

[0107] 5) When the recursion is completed, a new output curve can be generated, which consists of the points retained in step 4).

[0108] Specifically, the Ramer-Douglas-Peucker algorithm can be used to segment the tooth profile of the external thread shaft section and distinguish the arc segments and straight line segments. After removing the first two incomplete arcs at the corners of the thread image, a series of arcs are obtained, and their top and bottom coordinate values ​​are taken out (the top coordinate value taken out is , the bottom coordinate value is ), using this as a reference, the effective area of ​​the tooth profile of the external thread shaft section can be intercepted.

[0109] Step (5): Calculate the external thread geometric parameters.

[0110] As a preferred embodiment of the present invention, among the calculated external thread geometric parameters, the pitch ,satisfy: (9);

[0111] Taper ,satisfy: (10) ;

[0112] Tooth height ,satisfy: (11) ;

[0113] Tooth top height ,satisfy: (12) .

[0114] Among them, it is necessary to add that Figure 4 , Figure 5 As shown, the pitch It refers to the axial distance between corresponding points on the thread body per inch of axial length; taper It refers to the increase in the pitch diameter per unit thread length; tooth height It refers to the distance from the top to the bottom of the thread in the direction perpendicular to the thread axis; It refers to the distance from the thread pitch cone to the thread top cone.

[0115] Through the above steps, the following set of external thread parameter values ​​are calculated.

[0116]

[0117] By comparing the measured values ​​in the table with the standard values ​​of external thread parameters in the API standard, it can be determined that the external thread of the oil pipe is a qualified product.

[0118] In addition, as a more preferred embodiment of the present invention, before implementing step (3), the following steps are also included:

[0119] Step (300): pre-processing the external thread image;

[0120] The gray value linear transformation method of point operation is used to improve the contrast of external thread image;

[0121] The gray threshold segmentation method is used to segment the external thread image;

[0122] The Canny algorithm is used to detect the edge of the external thread image;

[0123] The interpolation method is used to perform sub-pixel positioning of the external thread image.

[0124] The purpose of this preferred step (300) is to obtain a more accurate tooth profile of the external thread image by preprocessing the external thread image, thereby providing help for further improving the detection accuracy of subsequent steps.

[0125] Thus, the multi-parameter integrated visual measurement method of the external thread of the oil pipe provided by the present invention realizes the integrated measurement of the geometric parameters of the external thread; through a single measurement process, multiple parameters of the external thread of the oil pipe are obtained, thereby effectively improving the detection accuracy and detection efficiency of visual inspection.

[0126] The present invention provides a multi-parameter integrated visual measurement method for external threads of oil pipes, and the visual measurement method comprises the following steps: step (1): building a multi-parameter integrated visual measurement system for external threads of oil pipes required for the multi-parameter integrated visual measurement method for external threads of oil pipes; step (2): calibrating the parameters of the telecentric lens; step (3): correcting the tooth profile of the external thread image; step (4): segmenting the external thread profile, and adaptively extracting the effective area of ​​the tooth profile of the external thread shaft section; step (5): calculating the geometric parameters of the external thread. Compared with the existing measurement method, the multi-parameter integrated visual measurement method for external threads of oil pipes with the above-mentioned step characteristics reduces the influence of the non-perpendicularity between the thread axis and the camera optical axis and the thread helix angle on the measurement accuracy; for oil pipes of different specifications, the effective area of ​​the thread can be adaptively obtained, and the calculation of its parameters can be realized; in addition, multiple parameters of the external threads of the oil pipes can be obtained through a single measurement process, thereby improving the detection accuracy and detection efficiency of visual detection.

[0127] The above is only a specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any person skilled in the art can easily think of changes or substitutions within the technical scope disclosed by the present invention, which should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention should be based on the protection scope of the claims.

Claims

1. A multi-parameter integrated visual measurement method for external threads of oil pipes, characterized in that: The steps include: Step (1): constructing a multi-parameter integrated visual measurement system for external threads of an oil pipe required for the multi-parameter integrated visual measurement method for external threads of an oil pipe; the multi-parameter integrated visual measurement system for external threads of an oil pipe at least comprises a telecentric light source, a telecentric lens, a camera and a workbench; Step (2): Calibrate telecentric lens parameters; The specific process of calibrating the telecentric lens parameters in step (2) can be described as: The imaging model of a telecentric lens satisfies: (1); in, is the three-dimensional coordinates of the corner points of the chessboard calibration plate in the world coordinate system, is the magnification of the telecentric lens, , For each pixel in the image coordinate system and The physical size in the direction, is the coordinate of the origin of the image coordinate system in the pixel coordinate system, , They are the rotation matrix and translation vector that transform the world coordinate system to the camera coordinate system; After acquiring the checkerboard image of the calibration plate, extract the pixel coordinates of the checkerboard corners and calculate the average pixel length of all squares in the checkerboard image; combine the physical size of each square on the checkerboard to calculate the magnification to satisfy: (2); in, is the magnification of the telecentric lens, Indicates the physical length of each grid of the chessboard calibration plate, in units of , Indicates the average number of pixels per grid on the checkerboard calibration plate, in pixels; Step (3): Correct the external thread image tooth profile; The specific process of correcting the external thread image tooth profile in step (3) can be described as follows: A mathematical model is established for the external thread in the external thread image; the axis section coordinate system O-XYZ is established with the center of the small end face of the thread as the origin O; the positive direction of the Z axis points from the origin along the thread axis to the center of the large end face of the thread, the thread axis section is taken as the XOZ plane, and the Y axis direction is determined by the right-hand rule; take a point on the external thread profile ,point The angle of motion along the spiral line is After arriving A point on the thread profile ,point The coordinates are the theoretical tooth profile equation of the external thread of the oil pipe at the ideal position, which satisfies: (3); in, satisfy: ; is the external thread pitch, For point Distance to the external thread axis, is the number of teeth, is the external thread top arc radius, It is the small end diameter of the external thread. The major diameter of the small end face of the external thread. It is the half angle of external thread profile. is the taper half angle of the external thread; The axial section is perpendicular to the plane where the camera optical axis and the worktable axis are located, that is, perpendicular to the YOZ plane; let formula (3) , the S equation of the tooth profile on the shaft section can be calculated, which satisfies: (4); in, satisfy: ; When the external thread of the oil pipe is in a general position, the projection coordinate system O-UVW is introduced; the UOW plane is the projection plane; the angle between the axial section XOZ and the projection plane is , the angle between the axis and the VOW plane is ; By rotating the workpiece and taking two images 90° apart, the angle is calculated and ; Will =0° is taken as the general position, and the difference curve is solved; according to the conversion relationship between the axial section coordinate system O-XYZ and the projection coordinate system O-UVW, equations (3) and (4) are combined to obtain the theoretical tooth profile equation in the general position, which satisfies: (5); The theoretical tooth profile S equation of the axial section in general position satisfies: (6); Select the upper surface of the external thread profile as the reference, and solve the theoretical difference equation of the theoretical tooth profile line S of the axial section at a general position under the influence of the thread helix angle, which satisfies: (7); in, , ; According to the position of the thread axis, the corresponding relationship between the points on the tooth profile of the image under the projection coordinate system O-UVW and the points on the tooth profile of the axial section under the axial section coordinate system O-XYZ is obtained, which satisfies: (8); The tooth profile of the external thread image can be corrected through this corresponding relationship; Step (4): segment the external thread profile and adaptively extract the effective area of ​​the external thread shaft cross-section tooth profile; The specific process of adaptively extracting the effective area of ​​the tooth profile of the external thread shaft section in step (4) can be described as follows: The Ramer-Douglas-Peucker algorithm is used to segment the external thread profile and distinguish the arc segments and straight line segments. After eliminating the first two incomplete arcs at the corners at both ends of the external thread image, a series of arcs are obtained; Take out the top and bottom coordinate values ​​and use them as a reference to intercept the effective thread profile; Step (5): Calculate the external thread geometric parameters.

2. The multi-parameter integrated visual measurement method for external threads of oil pipes according to claim 1 is characterized in that: Before implementing step (3), the following steps are also included: Step (300): pre-processing the external thread image; The gray value linear transformation method of point operation is used to improve the contrast of external thread image; The gray threshold segmentation method is used to segment the external thread image; The Canny algorithm is used to detect the edge of the external thread image; The interpolation method is used to perform sub-pixel positioning of the external thread image.

3. The multi-parameter integrated visual measurement method for external threads of oil pipes according to claim 1 is characterized in that: Among the external thread geometric parameters calculated in step (5), the pitch ,satisfy: (9) ; Taper ,satisfy: (10) ; Tooth height ,satisfy: (11) ; Tooth top height ,satisfy: (12).

Citation Information

Patent Citations

  • External screw thread detection table of liquefied petroleum gas bottle

    CN201837591U

  • Method for detecting external thread of high-pressure oil pipe joint based on machine vision

    CN109060836A

  • Rubber roller thread online detection and correction method based on machine vision

    CN115127479A

  • Oil pipe internal thread full-circumference measuring system and measuring method based on mirror image structured light

    CN117450953A

Cited By

  • Thread parameter high-precision real-time detection method and system based on line laser contourgraph

    CN122486511A