Non-contact thread detection method and system

By using a non-contact thread detection method, a robotic arm and detection module are used to acquire multi-view images. Combined with sub-pixel edge detection and equilateral triangle construction, the efficiency, accuracy and adaptability issues of thread detection in existing technologies are solved, and efficient and accurate thread parameter measurement is achieved.

CN120368843BActive Publication Date: 2025-11-04ACADEMY OF PUBLIC SECURITY TECH HEFEI
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510434497.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-04-08
Publication Date
2025-11-04
Estimated Expiration
2045-04-08

AI Technical Summary

Technical Problem

Existing thread inspection technologies suffer from problems such as contact damage and efficiency bottlenecks, contradictions between coverage and cost in non-contact technologies, insufficient multi-parameter synchronous detection capabilities, and difficulties in flexible adaptation. In particular, in the fields of oil and gas pipelines and mechanical connectors, it is difficult to achieve efficient, accurate, and flexible thread parameter measurement.

Method used

A non-contact thread inspection method is adopted. A robotic arm drives the inspection module to rotate at a fixed angle to acquire multi-view images. Combined with subpixel edge detection and equilateral triangle construction, the thread size is calculated. The thread parameters are calculated using the multi-view images, realizing image acquisition and parameter measurement of the entire thread section.

Benefits of technology

It achieves efficient and accurate measurement of thread parameters, reduces measurement errors, improves parameter accuracy within the measurement range, enhances measurement reliability and adaptability, and is suitable for rapid inspection of threaded workpieces of different specifications.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120368843B_ABST
    Figure CN120368843B_ABST
Patent Text Reader

Abstract

The application provides a non-contact thread detection method and system, comprising: S1. determining that a detection object reaches a specified position; starting a mechanical arm; S2. the mechanical arm drives at least a detection module to detect the object as the center of the axial direction, and rotates at a fixed angle N; after each rotation of N degrees, the detection module works; at least two groups of detection modules respectively acquire images of both ends of the diameter of the object to be detected; S3. after accumulating 180 degrees, the mechanical arm drives the detection module to rotate reversely by 360-N / 2 degrees; S4. repeating S2, completing the detection of another 180 degrees of the detection surface, and acquiring multi-view images; S5. calculating the thread size based on the multi-view images. The application drives the detection module to rotate at a set angle first through the mechanical arm, and two groups of detection modules can respectively complete multiple point image acquisition within a range of 180 degrees, then the mechanical arm drives the detection module to overturn by an angle of 360-N / 2 degrees, and then rotates forward by 180 degrees, finally, a total of 720 / N point images are acquired, each image interval is N / 2 degrees, this method does not require the end of the mechanical arm to rotate by 360 degrees, and the conventional mechanical arm can rotate by 180 degrees, and the control is simple, and the acquisition time is low.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of industrial automation detection, in particular to a non-contact thread detection method and system. BACKGROUND

[0002] Thread detection technology is a key link in industrial manufacturing, especially in the fields of petroleum, natural gas pipelines, mechanical connectors, etc. The precision of thread parameters (such as pitch, tooth height, taper, etc.) directly affects the sealing, strength and service life of the workpiece. Thread detection includes contact and non-contact.

[0003] Contact detection technology is a traditional method, which relies on manual use of thread gauges (such as go-no-go gauges, thread micrometers) for contact measurement. Such tools judge whether the thread meets the tolerance requirements through mechanical contact. The limitations are that mechanical contact can scratch the thread surface; manual point-by-point measurement is time-consuming and difficult to automate; manual detection can only detect local parameters such as pitch and diameter, and cannot obtain three-dimensional features such as tooth angle on site.

[0004] Non-contact detection technology mainly includes laser scanning, structured light projection and machine vision, but still has the following problems:

[0005] (1) Laser scanning technology

[0006] Obtain the three-dimensional profile of the thread through laser triangulation or line laser scanning. The limitations are high cost: high-precision laser sensors are expensive; poor anti-interference: susceptible to oil stains and environmental light interference, and the workpiece surface needs to be strictly cleaned.

[0007] (2) Structured light projection technology

[0008] Reconstruct the three-dimensional model of the thread using grating projection and phase unwrapping. The limitations are: high computational complexity: multiple image phase unwrapping is required, with poor real-time performance; local occlusion: fixed viewing angle leads to incomplete imaging of the thread root or back side.

[0009] (3) Machine vision technology

[0010] Analyze the edge features of the thread using two-dimensional images. The limitations are: dimension loss: two-dimensional images cannot obtain three-dimensional parameters such as axial taper and tooth height; dependent on calibration: the relative position of the camera and the workpiece needs to be frequently calibrated, with poor adaptability.

[0011] In summary, the core problems of current thread detection technology include:

[0012] Contact damage and efficiency bottleneck: traditional gauges and semi-automatic equipment cannot balance non-destructive testing and high efficiency;

[0013] The contradiction between coverage and cost of non-contact technology: although the laser or structured light scheme can obtain three-dimensional data, it has problems such as local occlusion, environmental sensitivity and high cost;

[0014] Insufficient multi-parameter synchronous detection capability: the existing technology focuses on a single parameter (such as pitch or diameter), and lacks comprehensive analysis of complex characteristics such as lead-in side angle and load-bearing side angle;

[0015] Flexible adaptation difficulty: fixed detection systems are difficult to adapt to the rapid switching requirements of different specifications of threaded workpieces.

[0016] In addition, when collecting images by traditional non-contact technology, the cameras arranged in a ring are used to take pictures at the same time, or the cameras are driven by a mechanical arm to rotate around the threaded pipe to take pictures at multiple fixed points. The ring arrangement of the camera is high in cost and easy to expose. The mechanical arm drives the camera to rotate around the threaded pipe to take pictures at multiple points, which is time-consuming and low in efficiency. SUMMARY

[0017] The technical problem to be solved by the present application is how to obtain multi-view images in the shortest time.

[0018] The present application solves the above technical problems by the following technical means:

[0019] The non-contact threaded detection method comprises:

[0020] S1. Determine that the detection object reaches the specified position; start the mechanical arm;

[0021] S2. The mechanical arm drives at least one detection module to rotate at a fixed angle N around the axis of the detection object; after each rotation of N degrees, the detection module works; at least two detection modules obtain images of the two ends of the diameter of the object to be detected;

[0022] S3. After accumulating 180 degrees, the mechanical arm drives the detection module to rotate reversely by 360-N / 2 degrees;

[0023] S4. Repeat S2 to complete the second detection and obtain multi-view images;

[0024] S5. According to the set mechanical arm forward step, move the detection module to another detection position, repeat steps S2-S4 until the image collection of the whole threaded section is completed;

[0025] S6. Calculate the threaded size based on the multi-view images.

[0026] Further, it further comprises:

[0027] S5. After the 360-degree circumferential detection is completed, the mechanical arm drives the detection module to deflect by M degrees horizontally, and then deflect by 2M degrees reversely to obtain the images of the lead-in side and the load-bearing side of the thread.

[0028] Further, the step S5 is specifically:

[0029] S51. Correcting the sub-pixel of the profile point of each map;

[0030] S52. Thread profile feature point extraction based on equilateral triangle construction: sort the obtained corrected sub-pixel profile points according to the profile direction of the thread, and along the profile traversal direction, construct equilateral triangles between the adjacent two sub-pixel points according to the Euclidean distance between the adjacent two sub-pixel points, and calculate the included angle θ between the adjacent two equilateral triangles i If θ i is greater than a preset threshold θ t , it is judged as the corresponding feature point.

[0031] S53. Splicing the map guided by the feature point;

[0032] S54. Based on the spliced map, respectively calculating the simulated height and the measured height of the tooth profile, calculating the standard deviation of the tooth profile parameters based on the simulated height and the measured height, and further judging whether the thread size is abnormal according to the standard deviation of the tooth profile parameters.

[0033] Further, the step S51 is specifically: for different maps of the thread, first, the binary map is subjected to pixel-level edge detection using the canny operator to extract the thread profile:

[0034] C={(x i ,y i )|i=1,2,…n}

[0035] Where (x i , y i ) represents the i-th profile point coordinate, and n is the total number of profile edge sampling points; the first-order gradient and the second-order gradient of the profile edge C are used to obtain the neighborhood information of the edge. In order to make the differential of discrete pixels provide unbiased and high-precision numerical approximation, the 7-tap interpolator and its differential kernel proposed by Farid and Simoncelli are used for gradient calculation, and the first-order gradient g x , g y and the second-order gradient g xx , g yy , g xy of the profile edge in x and y directions are calculated; finally, the Steger unbiased curve structure detection is used to eliminate the systematic deviation caused by discrete sampling, and the Hessian matrix is constructed by using the first-order and second-order derivatives of the edge c i (x i , y i ) neighborhood:

[0036]

[0037] By analyzing H i Perform singular value decomposition and select the eigenvector corresponding to the largest eigenvalue. This vector represents a unit vector along the direction perpendicular to the edge; calculate the contour edge c. i Correction amount t along the normal direction i for:

[0038]

[0039] Update edge contour pixels c i The position is obtained by sub-pixel coordinates:

[0040]

[0041] Furthermore, step S52 specifically involves: firstly, sorting the acquired corrected sub-pixel contour points according to the contour direction of the thread, c i ∈C{i=1,2,…n} are sub-pixel edge points. Along the contour traversal direction, an equilateral triangle is constructed using two adjacent sub-pixel edge points, v i With v i+1 These are the vertices of two adjacent equilateral triangles. i For c i Around c i+1 The rotation matrix obtained by rotating by an angle α is expressed as:

[0042]

[0043] Where α is the rotation angle; the same method can be used to calculate v. i+1 Coordinates; the angle θ between two adjacent equilateral triangles i It can be calculated using the following formula:

[0044]

[0045] Then, θ1 is compared with the preset threshold θ t Compare, if it is greater than θ t The corresponding feature points are identified; the entire contour is traversed sequentially according to this method.

[0046] Furthermore, step S53 specifically involves: assuming two map sheets F A With F B Furthermore, there exists a known fixed moving distance L between them, and the feature point set F extracted from the two map sheets. A ={f A1 ,f A2 ,...,f An} and F B ={f B1 ,f B2 ,…,fBn}, where f Ai = (x Ai , y Ai ) and f Bi = (x Bi , y Bi ) denote the coordinates of feature points in map F A and map F B , respectively;

[0047] First, the map F B is translated according to the given movement distance L:

[0048] b' = B + L

[0049] For a feature point f Bi = (x Bi , y Bi ) in F B , translation is performed according to the fixed movement distance:

[0050] (x B′ , y B′ ) = (x B + L, y B + L)

[0051] From the preliminarily translated map F B , the matching error between feature points is calculated, and the position is further optimized using the least squares method; the transformation matrix T is represented as a two-dimensional affine transformation matrix:

[0052]

[0053] where a 11 , a 12 , a 21 , a 22 are the coefficients of the affine transformation, and t x and t y are the translation amounts; the translation amounts t x and t y are adjusted for the preliminarily translated map F B ; the cost function E(T) represents the sum of squares of coordinate errors between feature points in map F B and corresponding feature points in map F A :

[0054]

[0055] where (x B′i , y B′i ) are the coordinates of the translated feature points; by minimizing the cost function, the transformation matrix T is optimized so that the feature points in map F B match the feature points in map FA The feature points in the image F are better aligned; in order to minimize the cost function, the least square method is used to obtain the optimal transformation matrix T; the image F B The image F is aligned according to the initial translation and the transformation matrix optimized by the least square method A The image F is accurately aligned, and the image is spliced.

[0056] Further, the step S54 is specifically: after the spatial splicing of the multi-image data is completed, the least square method is used to parameterize modeling of the tooth profile feature point set, and the best fitting straight line equations of the l3 and l4 profile sides are respectively established as:

[0057]

[0058] Wherein, A1, B1, C1 are l3 straight line parameters, A2, B2, C2 are l4 straight line parameters; the ball center coordinates are assumed as The vertical distance from c2 to l3 and l4 is expressed as:

[0059]

[0060] According to the above formula, the coordinates The tooth profile height parameter h can be further obtained, and then the axial distribution function of the thread is constructed:

[0061]

[0062] In the above formula, h k represents the measured height value of the kth sampling position, is the theoretical nominal value. The spatial domain analysis of the tooth profile parameters is carried out, and the standard deviation of the tooth profile parameters is calculated:

[0063]

[0064] The dispersion degree of the thread processing quality can be quantitatively evaluated, and the gradual error caused by tool wear or clamping deformation in the thread manufacturing process can be effectively identified, thereby providing a quantitative basis for process optimization.

[0065] The application also provides a non-contact thread detection system, comprising:

[0066] A target positioning module: determines that the detection object reaches a specified position; starts the mechanical arm;

[0067] Multi-view image acquisition module: the mechanical arm drives at least the detection module to detect the object axis as the center, and rotates according to the fixed angle N; after rotating N degrees, the detection module works; at least two groups of detection modules acquire the images of the two ends of the diameter of the object to be detected; after accumulating 180 degrees, the mechanical arm drives the detection module to rotate reversely by 360-N / 2 degrees; then it continues to rotate by the fixed angle N; after rotating N degrees, the detection module works, and the detection of the other 180 degrees of the detection surface is completed, and multi-view images are acquired;

[0068] Calculation module: based on the multi-view images, the thread size is calculated.

[0069] Further, it further comprises:

[0070] Thread lead-in side and load side image acquisition module: after the 360-degree circumferential detection is completed, the mechanical arm drives the detection module to horizontally deflect by M degrees, and then reversely deflect by 2M degrees, to acquire the thread lead-in side and load side images.

[0071] Further, the specific process of the calculation module is:

[0072] S51. Correct the sub-pixel of the profile point of each image;

[0073] S52. Thread profile feature point extraction based on equilateral triangle construction: the sorted sub-pixel profile points are sorted according to the profile direction of the thread, and the equilateral triangle is constructed between the adjacent two sub-pixel points along the profile traversal direction, and the included angle θ between the adjacent two equilateral triangles is calculated i , if θ i is greater than the preset threshold θ t , it is judged as the corresponding feature point.

[0074] S53. The image guided by the feature point is spliced;

[0075] S54. Based on the spliced image, the tooth profile simulation height and the measured height are calculated respectively, the tooth profile parameter standard deviation is calculated based on the simulation height and the measured height, and then whether the thread size is abnormal is judged according to the tooth profile parameter standard deviation.

[0076] The advantages of the present application are:

[0077] The present application drives the detection module by the mechanical arm to rotate according to the set angle first, and two groups of detection modules can complete a plurality of point image in the range of 180° respectively, then the mechanical arm drives the detection module to overturn by 360-N / 2 degrees, and then rotates by 180°, finally a total of 720 / N point images are acquired, each image interval is N / 2°, this method does not require the mechanical arm end to rotate 360 degrees, and the conventional 180° can be rotated, and the control is simple, and the acquisition time is low.

[0078] The present application overcomes the limitation that single visual field is difficult to capture the overall appearance of the thread by collecting multiple local images to realize complete coverage of the full profile of the thread; secondly, sub-pixel edge detection is used to extract the profile of each image, and the feature points in each image are analyzed in depth. Subsequently, a stitching model based on feature constraints is established to realize accurate alignment and global optimization of different visual field data, reduce the error amplification effect caused by geometric mismatch and perspective deviation, and realize non-linear error suppression of parameter accuracy in the measurement range. The method can comprehensively and accurately measure the key parameters of API round thread (such as taper, pitch, tooth profile change and minimum effective connection length). The method not only significantly improves the overall accuracy and reliability of thread measurement, but also provides a solid technical guarantee for the safety and durability of oil well pipe connection, and has important reference value for research and application in related fields. BRIEF DESCRIPTION OF DRAWINGS

[0079] Figure 1 It is a system structure schematic diagram of the method in embodiment 1 of the present application.

[0080] Figure 2 It is a flow chart of the method in embodiment 1 of the present application.

[0081] Figure 3 It is a multi-view image acquisition schematic diagram in the method in embodiment 1 of the present application.

[0082] Figure 4 It is a point position schematic diagram of acquiring multi-view images by two groups of horizontal light projection devices in embodiment 1 of the present application.

[0083] Figure 5 It is a schematic diagram of the load side and lead-in side angle of the round thread tooth in the method in embodiment 1 of the present application.

[0084] Figure 6 It is an implementation flow chart of the method in embodiment 2 of the present application.

[0085] Figure 7 It is a multi-view image acquisition schematic diagram in the method in embodiment 2 of the present application.

[0086] Figure 8 It is a thread feature point calculation schematic diagram in the method in embodiment 2 of the present application.

[0087] Figure 9 It is a round thread tooth profile height measurement schematic diagram in the method in embodiment 2 of the present application. DETAILED DESCRIPTION

[0088] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below in conjunction with the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, 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.

[0089] Example 1

[0090] This embodiment provides a non-contact thread detection system, such as Figure 1 As shown, the system includes a robotic arm 1, a detection module 10, a first sensor 5, a second sensor 6, a third sensor 7, and a support roller 8. The detection module is fixed to the end of the robotic arm, and the support roller is used to lift and transport the threaded pipe 4. When the threaded pipe 4 enters the detection area of ​​the detection module, it passes through the first sensor, the second sensor, and the third sensor in sequence. The detection module includes a rotating bracket, a parallel light projection device 2, and a positioning camera 3. The rotating bracket is rotatably fixed to the end of the robotic arm. The parallel light projection device consists of multiple sets; this embodiment uses three sets, arranged at the top, middle, and bottom of the bracket. In actual application, depending on the pipe diameter, only two sets of devices are used each time (the third set is not needed). Assuming they are numbered a, b, and c from top to bottom, there are three combinations: ab, ac, and bc. This embodiment uses the ac combination. The positioning camera is a binocular camera fixed to the bracket. The second and third sensors can be composed of multiple sensors to improve detection accuracy.

[0091] Based on the above detection system, such as Figure 2 As shown, the detection method is as follows:

[0092] Step 1: Start the pipe feed and initiate the process.

[0093] Step 2: The first sensor detects the threaded pipe and notifies the control system to reduce the pipe feed speed;

[0094] Step 3: If the second sensor does not detect the threaded tube (considering a malfunction of the second sensor), but the third sensor detects the threaded tube, then notify the controller to retract the tube until the second sensor detects the threaded tube, then notify to stop tube feeding.

[0095] Step 4: The robotic arm moves to the detection position;

[0096] Step 5: Position the camera and take a picture;

[0097] Step 6: Based on the images captured by the positioning camera, identify the circular coordinates of the tube end face and convert them into robotic arm coordinates;

[0098] Step 7, the mechanical arm carries the detection detection module to the pipe end surface position;

[0099] Step 8, the detection module works, parallel light projection and horizontal view image shooting;

[0100] Step 9, the mechanical arm advances by a set step (usually set to 71mm, which can cover all types of threaded pipes);

[0101] Step 10, repeat step 8 and step 9 once, at this time the detection module will move to the thread disappearance place, complete the horizontal view image shooting of the threaded pipe (three groups of images are shot at the threaded pipe end surface, the first time advancing 71mm, and the second time advancing 71mm, and the complete threaded image is formed by splicing);

[0102] Step 11, the mechanical arm drives the detection module to complete multi-view image shooting by rotating;

[0103] Step 12, the mechanical arm carries the detection module to retreat 142mm to the pipe end surface position;

[0104] Step 13, repeat step 11 to complete 360 degree shooting at the pipe end surface position;

[0105] Step 14, the mechanical arm carries the detection module to advance 71mm to the middle position of the thread;

[0106] Step 15, repeat step 11 to complete 360 degree shooting at the middle position of the thread;

[0107] Step 16, the mechanical arm drives the detection module to horizontally deflect M°;

[0108] Step 17, the detection module works, parallel light projection and photographing;

[0109] Step 18, the mechanical arm drives the detection module to reverse horizontal deflection 2M°;

[0110] Step 19, the detection process is completed, the mechanical arm carries the detection module to the home position;

[0111] Step 20, output the result.

[0112] As shown in the step 11, two groups of horizontal projection devices are used to project and take images on the upper and lower surfaces of the threaded pipe. The multi-view image shooting process is as follows: Figure 3

[0113] Step 101. The mechanical arm drives at least the detection module to rotate around the axis of the detection object at a fixed angle N; after rotating N degrees, the detection module works; at least two groups of detection modules respectively acquire images of both ends of the diameter of the object to be detected;

[0114] ​Step 102. After accumulating 180 degrees (due to the limited rotation angle of the robotic arm, 180° is the maximum rotation angle), the robotic arm drives the detection module to rotate in the opposite direction by 360°-N / 2°.

[0115] Step 103. Repeat S2 to complete the detection of the other 180° surface to be detected and obtain multi-view images;

[0116] Step 104. Calculate the thread dimensions based on the multi-view map.

[0117] Specifically, assuming N is 30°, then in step 101, the first horizontal projection device will... Figure 4 The first horizontal projection device rotates 6 times from point A to point B, while the second horizontal projection device moves from point B to point A. The two sets of horizontal projection devices then complete image acquisition at 12 points (360°), as shown in the red circles in the diagram. Next, the device rotates 345° in the opposite direction, reaching point C. It then rotates 30° to point D, while the second horizontal projection device moves from point D to point C. The two sets of horizontal projection devices complete image acquisition at another 12 points, as shown in the green circles in the diagram. After this process, the actual interval between detection points is 15°. With the same number of image sheets, this method has the shortest time and is easy to control. When parallel light is projected onto the thread surface, the thread tooth structure produces light stripe distortion, and the distortion pattern corresponds one-to-one with the thread geometric parameters.

[0118] To meet high-resolution requirements while ensuring complete acquisition of the 2D image of the thread projection, this embodiment employs a multi-image collaborative acquisition method. For example... Figure 7 As shown, the image width and height are w and h, respectively. A monocular camera is driven by a translation stage to perform equidistant stepping motion along the thread axis, acquiring sequential images of adjacent fields of view through a time-triggered image acquisition method. The image size F... A With F B To create complementary fields of view along the thread axis, and to ensure sufficient overlap between adjacent drawing sheets to completely cover the thread, the axial step distance L satisfies the following:

[0119] L <min(w,h)

[0120] To avoid misalignment or breakage between map sheets due to errors, the forward motion error ε must be controlled within half of the pitch p, i.e.:

[0121] ε<0.5*p

[0122] This embodiment can not only obtain multi-view images of the threaded pipe using a horizontal projection device, but also obtain images of the threaded pipe's tooth guide side and bearing side using a horizontal projection device, such as... Figure 5As shown, the mechanical arm first drives the parallel light projection device to project perpendicularly to the threaded pipe, then swings horizontally by M degrees to project, and then swings horizontally by 2M degrees in the opposite direction to project. In this way, the projections of the tooth lead-in side and the load-bearing side can be obtained, and then the angle difference between the two sides of the tooth profile can be analyzed according to the slope change of the light stripes, and the angles of the lead-in side and the load-bearing side can be calculated. In this embodiment, the calculation process of the angles of the two sides of the tooth profile is not given, and only the technical principle is disclosed.

[0123] In this embodiment, the three-dimensional binocular camera coordinates are converted into the mechanical arm coordinates, and the calibration of the coordinate system can be completed:

[0124] The three-dimensional binocular camera is fixed on the end effector of the mechanical arm, and the coordinate system thereof has a fixed relative pose relationship with the end coordinate system of the mechanical arm. The core principle of converting the center coordinates in the camera coordinate system to the mechanical arm motion coordinate system (base coordinate system) is a hierarchical transformation chain, that is, through the cascade of the hand-eye calibration matrix (static) and the forward kinematics matrix (dynamic), the accurate mapping from the camera coordinate system to the mechanical arm base coordinate system is realized. Through the hierarchical transformation of the coordinate system, the specific steps are as follows:

[0125] 1. Definition of coordinate system and hierarchical relationship

[0126] Camera coordinate system {C}: taking the optical center of the camera as the origin, and the center coordinates as P C =[x C ,y C ,z C ] T .

[0127] End coordinate system of the mechanical arm {E}: taking the end effector (such as a gripper) of the mechanical arm as the origin.

[0128] Mechanical arm base coordinate system {B}: taking the base of the mechanical arm as the origin, which is the reference coordinate system of the global motion of the mechanical arm.

[0129] Hierarchical relationship: {C}→{E}→{B}.

[0130] 2. Conversion principle

[0131] Through two times of coordinate transformation:

[0132] (1). Camera coordinate system→end coordinate system of the mechanical arm: use the fixed hand-eye calibration parameters (relative pose of the camera and the end).

[0133] (2). End coordinate system of the mechanical arm→base coordinate system: use the real-time forward kinematics model of the mechanical arm (position and attitude of the end relative to the base).

[0134] 3. Transformation formula

[0135] (1) Camera coordinate system to end coordinate system

[0136] Suppose the transformation matrix from camera coordinate system {C} to end coordinate system {E} is which contains a rotation matrix and a translation vector

[0137] The homogeneous coordinates of the circle center in the camera coordinate system is P C = [x C , y C , z C , 1] T (the last 1 is appended), then its coordinates in the end coordinate system are:

[0138]

[0139] (2) Transformation from end coordinate system to base coordinate system

[0140] The transformation matrix from the end coordinate system {E} of the robot arm to the base coordinate system {B} is which is calculated by forward kinematics according to the real-time joint angles of the robot arm:

[0141]

[0142] The coordinates of the circle center in the base coordinate system are:

[0143]

[0144] Summary of key formulas

[0145]

[0146] 5. Implementation steps

[0147] (1). Hand-eye calibration:

[0148] Calibrate the fixed pose of the camera and the end of the robot arm Common methods include chessboard calibration or point cloud matching-based calibration.

[0149] Calibration results: rotation matrix and translation vector

[0150] (2). Forward kinematics calculation:

[0151] According to the current joint angles of the robot arm, calculate the transformation matrix from the end coordinate system to the base coordinate system

[0152] (3). Coordinate transformation:

[0153] Convert the circle center coordinates P C detected by the camera to P B, directly applying the formula

[0154] Example 2

[0155] This example is based on the multi-view map collected in Example 1, and the size of the round thread is measured, the specific method is as follows: the flow is as shown in Figure 6 , and the following steps are taken:

[0156] Step 1: Sub-pixel correction of the contour point position of each map.

[0157] In order to accurately find the sub-pixel boundary of the thread, different maps of the thread are used. First, the binary map is used to extract the thread contour by using the canny operator for pixel-level edge detection:

[0158] C = {(x i ,y i )|i = 1, 2, … n}

[0159] Where (x i ,y i ) represents the i-th contour point coordinate, and n is the total number of contour edge sampling points. Then, the neighborhood information of the edge is obtained by using the first-order gradient and the second-order gradient of the contour edge C. In order to make the differential of discrete pixels provide unbiased and high-precision numerical approximation, the 7-tap interpolator and its differential kernel proposed by Farid and Simoncelli are used when calculating the gradient, and the first-order gradient g x , g y and the second-order gradient g xx , g yy g xy of the contour edge in x and y directions are calculated. Finally, the Steger unbiased curve structure detection is used to eliminate the systematic deviation caused by discrete sampling, and the Hessian matrix is constructed by using the first-order and second-order derivatives of the edge c i (x i ,y i ) neighborhood:

[0160]

[0161] By singular value decomposition of H i , the eigenvector corresponding to the maximum eigenvalue is selected This vector represents a unit vector perpendicular to the edge direction. The correction amount t i of the contour edge c i in the normal direction is:

[0162]

[0163] The sub-pixel coordinates of the updated edge contour pixel c i position are obtained:

[0164]

[0165] Step 2: Feature point extraction method based on equilateral triangle constructed thread profile.

[0166] In order to extract the feature points of the thread profile and better realize the splicing between the maps, the sorted modified sub-pixel profile points are obtained according to the profile direction of the thread. Figure 8 Mid c i ∈C{i=1,2,…n} is a sub-pixel edge point, along the profile direction, the Euclidean distance between c1 and c2 Construct an equilateral triangle c1c2v1, and the Euclidean distance between c2 and c3 Construct an equilateral triangle c2c3v2, v1 and v2 are the vertices of the triangles c1c2v1 and c2c3v2 respectively. v1 is obtained by rotating c1 around c2 by 60°, and the rotation matrix is represented as:

[0167]

[0168] Where, α is the rotation angle. The same way can be used to calculate v2 coordinates. Angle θ1 can be calculated by the following formula:

[0169]

[0170] Then, θ1 and the preset threshold θ t are compared, if θ1 is greater than θ t , it is determined that the feature point is an accurate feature point. According to this method, the whole profile is sequentially traversed, and whether each point is a feature point is judged. The feature point searching process is shown in Table 1. Figure 8 Where, θ i is greater than θ i+1 , it is determined that the corresponding feature point is greater than θ t . The specific algorithm is shown in Table 1.

[0171] Table 1 Thread feature point extraction algorithm based on equilateral triangle

[0172]

[0173]

[0174] Step 3: Map splicing guided by feature points.

[0175] In the map splicing, the feature points are used for registration and the least square method is used for optimization. Figure 7 There are two maps F A and F B, and there is a known fixed moving distance L between them, the feature point sets F A = {f A1 ,f A2 ,…,f Anm} and F B = {f B1 ,f B2 ,…,f Bn} are extracted from the two maps, where f ASi = (x Ai ,y Ai ), f Bi = (x Bi ,y Bi ) represent the feature point coordinates in map F A and map F B respectively.

[0176] First, the map F B is translated according to the given moving distance L:

[0177] B' = B + L

[0178] For the feature point f Bi = (x Bi ,y Bi ) in F B , translation is performed according to the fixed moving distance:

[0179] (x B′ ,y B′ ) = (x B + L,y B + L)

[0180] From the initially translated map F B , the matching error between the feature points is calculated, and the positions are further optimized using the least squares method. The transformation matrix T is represented as a two-dimensional affine transformation matrix:

[0181]

[0182] where a 11 , a 12 , a 21 , a 22 are the coefficients of the affine transformation, and t x and t y are the translation amounts. The translation amounts t x and t y are adjusted for the initially translated map F B . The cost function E(T) represents the sum of the squares of the coordinate errors between the feature points of map F B and the corresponding feature points in map F A :

[0183]

[0184] Among them, (x B′i ,y B′i () represents the coordinates of the translated feature points. By minimizing the cost function, the transformation matrix T is optimized to make the map area F... B Feature points and map size F A The feature points in the image are better aligned. To minimize the cost function, the least squares method is used to obtain the optimal transformation matrix T. (Image size F) B The transformation matrix optimized by the initial translation and least squares method will be used in conjunction with the map size F. A Precise alignment enables the splicing of map sheets.

[0185] Step 4: Parameter measurement and calculation.

[0186] After completing the image stitching in step 9, in order to accurately capture the changing trend of tooth height, a digital inspection method based on virtual measuring tools is used to measure the tooth height parameters using a simulated height gauge. For example... Figure 9 The diagram illustrates the principle of measuring the tooth profile height of a circular thread. This method constructs a spherical virtual probe with radius r, which contacts the right and left contact surfaces of adjacent thread profiles in space. The tooth profile height parameter h is derived by calculating the normal distance from the center of the sphere to the baseline b1_b3. After completing the spatial registration (i.e., multi-map stitching) of multi-map data, the least squares method is used to parametrically model the tooth profile feature point set, establishing... Figure 9 The best-fit line equations for the contours on both sides of l3 and l4 are:

[0187]

[0188] Where A1, B1, and C1 are the line parameters of line l3, and A2, B2, and C2 are the line parameters of line l4. Assume the coordinates of the sphere's center are... The perpendicular distance from c2 to l3 and l4 is expressed as:

[0189]

[0190] The coordinates can be obtained from the above formula. Then the tooth height parameter h can be calculated. Furthermore, based on... Figure 9 The digital inspection method for the virtual gauge shown is achieved by constructing a thread axial distribution function:

[0191]

[0192] In the above formula, h k This represents the measured height value at the k-th sampling location. Theoretical nominal value. For the tooth profile parameter, spatial domain analysis is carried out by calculating the standard deviation of the tooth profile parameter:

[0193]

[0194] The discrete degree of the thread processing quality can be quantitatively evaluated, and the gradual error caused by tool wear or clamping deformation in the thread manufacturing process can be effectively identified, thereby providing a quantitative basis for process optimization.

[0195] In the embodiment, the thread discretization local map is acquired from a multi-view image acquisition system, the profile feature points are extracted by using sub-pixel level edge detection, a global registration model based on feature constraint is constructed, the discrete map is mapped to a unified global coordinate system, and seamless reconstruction of the full tooth profile data is realized. Therefore, continuous acquisition of the API round thread full tooth profile and accurate measurement of the tooth profile height parameter are realized. While the thread measurement difficulty is simplified, the measurement accuracy is improved, the error caused by geometric mismatch and perspective deviation is reduced, and the robustness and adaptability of the visual scheme in thread measurement are enhanced.

[0196] The above embodiments are only used to illustrate the technical solutions of the present application, but not to limit them; although the present application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that the technical solutions recorded in the foregoing embodiments can be modified, or some technical features can be replaced by equivalents; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present application.

Claims

1. A non-contact thread inspection method, characterized in that, include: S1. Determine if the target object has reached the designated location; Start the robotic arm; S2. The robotic arm drives at least one detection module to rotate around the axis of the object being detected at a fixed angle N; after each rotation of N degrees, the detection module works; at least two sets of detection modules acquire images of both ends of the diameter of the object being tested; S3. After accumulating 180 degrees, the robotic arm drives the detection module to rotate in the opposite direction by 360-N / 2 degrees; S4. Repeat S2 to complete the second detection and obtain multi-view images; S5. Based on the set forward step length of the robotic arm, move the detection module to another detection position, and repeat steps S2-S4 until the image acquisition of the entire thread section is completed. S6. Calculate thread dimensions based on multi-view maps.

2. The non-contact thread detection method according to claim 1, characterized in that, Also includes: S5. After the 360-degree circumferential inspection is completed, the robotic arm drives the inspection module to deflect horizontally by M degrees, and then deflects in the opposite direction by 2M degrees to obtain images of the thread inlet side and the bearing side.

3. The non-contact thread detection method according to claim 1, characterized in that, The specific process of step S5 shown is as follows: S51. Correct the sub-pixel positions of the outline points in each map sheet; S52. Extraction of thread contour feature points based on equilateral triangles: Sort the obtained corrected sub-pixel contour points according to the thread contour direction. Along the contour traversal direction, construct equilateral triangles based on the Euclidean distance between two adjacent sub-pixel points, and calculate the included angle θ between two adjacent equilateral triangles. i If θ i Greater than the preset threshold θ t , and determine them as the corresponding feature points; S53. Stitch together the map sheets guided by feature points; S54. Based on the spliced ​​drawing, calculate the simulated height and the measured height of the thread profile respectively. Calculate the standard deviation of the thread profile parameters based on the simulated height and the measured height, and then determine whether the thread size is abnormal based on the standard deviation of the thread profile parameters.

4. The non-contact thread detection method according to claim 3, characterized in that, Specifically, step S51 involves: for different thread profiles, firstly, using the Canny operator to perform pixel-level edge detection on the binarized profile to extract the thread outline. C={(x i ,y i )|i=1,2,…n} Where (x) i ,y i () represents the coordinates of the i-th contour point, and n is the total number of contour edge sampling points. The neighborhood information of the edge is obtained using the first and second gradients of the contour edge C. To provide an unbiased and high-precision numerical approximation for the differentiation of discrete pixels, the 7-tap interpolator and its differential kernel proposed by Farid and Simoncelli are used in the gradient calculation to calculate the first gradient g of the contour edge in the x and y directions. x g y With the second gradient g xx g yy g xy Finally, Steger unbiased curve structure detection is used to eliminate systematic bias caused by discrete sampling, utilizing edge c i (x i ,y i Construct the Hessian matrix using the first and second derivatives of the neighborhood: By analyzing H i Perform singular value decomposition and select the eigenvector corresponding to the largest eigenvalue. This vector represents a unit vector along the direction perpendicular to the edge; calculate the contour edge c. i Correction amount t along the normal direction i for: Update edge contour pixels c i The position is obtained by sub-pixel coordinates:

5. The non-contact thread detection method according to claim 3, characterized in that, Step S52 specifically involves: first, sorting the obtained corrected sub-pixel contour points according to the contour direction of the thread, c i ∈C{i=1,2,…n} are sub-pixel edge points. Along the contour traversal direction, an equilateral triangle is constructed using two adjacent sub-pixel edge points, v i With v i+1 These are the vertices of two adjacent equilateral triangles; v i For c i Around c i+1 The rotation matrix obtained by rotating by an angle α is expressed as: Where α is the rotation angle; the same method can be used to calculate v. i+1 Coordinates; the angle θ between two adjacent equilateral triangles i It can be calculated using the following formula: Then, θ1 is compared with the preset threshold θ t Compare, if it is greater than θ t The corresponding feature points are identified; the entire contour is traversed sequentially according to this method.

6. The non-contact thread detection method according to claim 3, characterized in that, Step S53 specifically involves: assuming two map sheets F A With F B Furthermore, there exists a known fixed moving distance L between them, and the feature point set F extracted from the two map sheets. A ={f A1 ,f A2 ,…,f An } and F B ={f B1 ,f B2 ,…,f Bn }, where f Ai =(x Ai ,y Ai ), f Bi =(x Bi ,y Bi ) represent map sheet F respectively A and map sheet F B The coordinates of the feature points in the image; First, based on the given movement distance L, the map sheet F is... B Perform translation: B′=B+L For F B Feature point f in Bi =(x Bi ,y Bi Translate by a fixed distance: (x B′ ,y B′ )=(x B +L,y B +L) Map F after preliminary translation B The matching error between feature points is calculated, and the position is further optimized using the least squares method; the transformation matrix T is represented as a two-dimensional affine transformation matrix: Among them, a 11 ,a 12 ,a 21 ,a 22 These are the coefficients of the affine transformation, t x and t y It is the translation amount; the translation amount t x and t y This refers to map sheet F after the initial translation. B Adjustments are made; the cost function E(T) represents the map size F. B Feature points and map size F A The sum of squares of the coordinate errors between corresponding feature points: Among them, (x B′i ,y B′i () represents the coordinates of the translated feature points. By minimizing the cost function, the transformation matrix T is optimized to make the map area F... B Feature points and map size F A The feature points in the image are better aligned; to minimize the cost function, the least squares method is used to obtain the optimal transformation matrix T; the image size F B The transformation matrix optimized by the initial translation and least squares method will be used in conjunction with the map size F. A Precise alignment enables the splicing of map sheets.

7. The non-contact thread detection method according to claim 3, characterized in that, Step S54 specifically involves: after completing the spatial stitching of multiple map images, using the least squares method to parametrically model the tooth profile feature point set, and establishing the best-fit line equations for the contours on both sides of l3 and l4 respectively: Where A1, B1, and C1 are the line parameters of line l3, and A2, B2, and C2 are the line parameters of line l4; assuming the coordinates of the sphere's center are... The perpendicular distance from c2 to l3 and l4 is expressed as: The coordinates can be obtained from the above formula. The thread height parameter h can then be calculated, and then the thread axial distribution function can be constructed: In the above formula, h k This represents the measured height value at the k-th sampling location. These are theoretical nominal values; spatial domain analysis is performed on the tooth profile parameters, and the standard deviation of the tooth profile parameters is calculated: It can quantitatively assess the dispersion of thread processing quality, effectively identify gradual errors caused by tool wear or clamping deformation during thread manufacturing, and provide a quantitative basis for process optimization.

8. A non-contact thread inspection system, characterized in that, include: Target localization module: Determines when the detected object has reached the designated location; Start the robotic arm; Multi-view image acquisition module: The robotic arm drives at least one detection module to rotate around the axis of the object to be detected by a fixed angle N; after every N degrees of rotation, the detection module works; at least two sets of detection modules acquire images of both ends of the diameter of the object to be tested; after a cumulative 180 degrees, the robotic arm drives the detection module to rotate in the opposite direction by 360-N / 2 degrees; then it continues to rotate by a fixed angle N; after every N degrees of rotation, the detection module works to complete the detection of the other 180 degrees of the surface to be tested, and acquire multi-view images; Calculation module: Calculates thread dimensions based on multi-view images.

9. The non-contact thread detection system according to claim 8, characterized in that, Also includes: Thread inlet side and load-bearing side image acquisition module: After the circumferential 360-degree detection is completed, the robotic arm drives the detection module to deflect horizontally by M degrees, and then deflects in the opposite direction by 2M degrees to acquire the thread inlet side and load-bearing side images.

10. The non-contact thread detection system according to claim 8, characterized in that, The specific process of the calculation module is as follows: S51. Correct the sub-pixel positions of the outline points in each map sheet; S52. Extraction of thread contour feature points based on equilateral triangles: Sort the obtained corrected sub-pixel contour points according to the thread contour direction. Along the contour traversal direction, construct equilateral triangles based on the Euclidean distance between two adjacent sub-pixel points, and calculate the included angle θ between two adjacent equilateral triangles. i If θ i Greater than the preset threshold θ t , and determine them as the corresponding feature points; S53. Stitch together the map sheets guided by feature points; S54. Based on the spliced ​​drawing, calculate the simulated height and the measured height of the thread profile respectively. Calculate the standard deviation of the thread profile parameters based on the simulated height and the measured height, and then determine whether the thread size is abnormal based on the standard deviation of the thread profile parameters.

Citation Information

Patent Citations

  • Thread detection method and system based on three-dimensional modeling

    CN103528523A

  • Automatic pipeline thread measuring device and measuring method

    CN111583114A