Search

CN-122027893-A - Automatic focusing method for oil pipe thread detection

CN122027893ACN 122027893 ACN122027893 ACN 122027893ACN-122027893-A

Abstract

The invention relates to the technical field of camera focusing, in particular to an automatic focusing method for oil pipe thread detection, which comprises the following steps of main camera X-axis positioning and thread area searching; the method comprises the steps of carrying out Z-axis focusing of a main camera by using a definition evaluation value, obtaining a thread end face corner by using an X-axis of a thread overlook surface of the main camera and a Y-axis of a thread end face, carrying out secondary camera focusing, and carrying out thread image acquisition by using the focused main camera and secondary camera. The invention solves the focusing problem of the main camera and the auxiliary camera in the process of detecting the thread of the oil pipe.

Inventors

  • GUAN XUDONG
  • YU SIHAN
  • LU XIAOJIE
  • ZHU HAIFENG
  • ZHAO LEIZHEN
  • ZHU WEI
  • CHEN YALIANG
  • GAO XIAOJING
  • LUO YI

Assignees

  • 常州大学
  • 常州迈格雷电气科技有限公司

Dates

Publication Date
20260512
Application Date
20260204

Claims (10)

  1. 1. An automatic focusing method for oil pipe thread detection is characterized by comprising the following steps: focusing the X axis of the main camera by utilizing the middle point of the thread section; Focusing the Z axis of the main camera by using the definition evaluation value; And thirdly, acquiring an intersection point of the thread end face by using an X central line of the thread overlook surface of the main camera and a Y central line of the thread end face, focusing the axis of the auxiliary camera Y, Z by using the intersection point, focusing the X axis of the auxiliary camera by using a definition evaluation value, and acquiring thread images by using the focused main camera and the focused auxiliary camera.
  2. 2. The method for automatically focusing on thread detection of an oil pipe according to claim 1, wherein the first step specifically comprises: the main camera performs step scanning along the X-axis direction, and acquires a thread overlook image; Extracting contour feature point set of thread overlook image Wherein, the method comprises the steps of, Represent the first The positions of the individual edge feature points in the main camera image coordinate system, The number of the extracted effective feature points is calculated; calculating the geometric center point coordinates of the thread center line ;j= M, wherein, the total number of the components is equal to the total number of the components, The center point coordinates of the oil pipe thread section under the main camera coordinate system are given, and j is the thread stepping sequence number; And connecting the coordinates of the geometric center points to obtain the X center line of the overlooking surface of the thread.
  3. 3. The automatic focusing method for oil pipe thread detection according to claim 1, wherein the second step specifically comprises: The main camera performs step scanning along the Z-axis direction to obtain images at different Z-axis positions; and taking the maximum value of the definition evaluation values as the Z-axis position of the main camera.
  4. 4. The automatic focusing method for oil pipe thread detection according to claim 1, wherein the third step specifically comprises: the linear mapping relation between the main camera and the auxiliary camera is fitted through a least square method, so that the Z-axis center line of the threaded end face is obtained, and the formula is as follows: Wherein, the Is the coordinate on the Z-axis center line of the thread end face; 、 、 、 calibrating parameters for the system; the secondary camera steps along the Y axis to extract the profile feature points of the threaded end face, and finds the coordinates of two pixel points with the maximum distance along the Y axis direction to obtain the Y axis center line of the threaded end face; The focus of the secondary camera moves to the intersection point position of the Y-axis center line of the threaded end face and the Z-axis center line of the threaded end face; The secondary camera performs step scanning along the X-axis direction to obtain images at different X-axis positions, calculates definition evaluation values corresponding to the different images, and takes the maximum value of the definition evaluation values as the X-axis position of the secondary camera.
  5. 5. The auto-focusing method for oil pipe thread detection according to any one of claims 3 and 4, wherein the formula of the sharpness evaluation value is: ; ; wherein (X, Y) is the coordinates of the pixel point on the X, Y axis, Is the Z-axis position of the kth image.
  6. 6. The automatic focusing method for oil pipe thread detection according to claim 2, wherein the extraction of the contour feature points adopts an edge detection operator.
  7. 7. The automatic focusing method for oil pipe thread detection according to claim 3, wherein the parallel light source and the main camera are synchronously moved in the X-axis direction to perform image light filling.
  8. 8. An automatic focusing method for oil pipe thread detection according to claim 3, wherein the length of the sealing surface, the chamfer of the inner wall, the depth of the internal boring and the negative angle of the end face are calculated by using the end face diagram and the top view of the thread after the calibration of the main camera and the auxiliary camera.
  9. 9. An auto-focus system for tubing thread detection comprising a memory for storing instructions executable by a processor and a processor for executing instructions to implement an auto-focus method for tubing thread detection as claimed in any one of claims 1 to 8.
  10. 10. A computer readable medium storing computer program code, characterized in that the computer program code, when executed by a processor, implements an auto-focus method of tubing thread detection according to any one of claims 1-8.

Description

Automatic focusing method for oil pipe thread detection Technical Field The invention relates to the technical field of camera focusing, in particular to an automatic focusing method for oil pipe thread detection. Background The oil pipe thread is a key structure in connection of oil drilling and production pipe columns, the machining quality of the oil pipe thread is directly related to the sealing reliability, bearing capacity and overall operation safety of underground operation, in the current engineering application, the oil pipe thread mainly comprises an API buckle thread which accords with an API standard, and a special buckle thread which is more complex in sealing structure and higher in performance requirement, the API buckle thread has the advantages of being high in standardization degree, strong in universality, mature in machining process and the like, but in the actual detection process, a manual detection or single visual detection mode is still used as a main mode, the detection efficiency is lower, the experience dependence on operators is higher, and in contrast, the special buckle thread has higher requirements on the aspects of space positioning accuracy, optical focusing capacity and metal high-reflection surface inhibition due to the fact that the tooth structure of the special buckle thread is complex, the curvature change of a sealing surface is large, the fit clearance is small. The API button thread image can be used to detect key geometric parameters of the thread (e.g., tooth height, pitch, taper, chamfer angle) and surface imperfections. The CN119666844A patent is disclosed, and an oil pipe thread three-dimensional point cloud image is obtained; extracting global feature identification point cloud images, performing point cloud positioning, and partitioning point cloud data; extracting a marked detection area to perform denoising treatment, dividing a 3d point cloud image into a plurality of blocks, performing projection mapping treatment on the plurality of point cloud blocks from front view, top view and side view angles to obtain a pseudo image, and performing pseudo image matching and loss function combination to judge whether the pseudo image is qualified or not. Disclosure of Invention Aiming at the defects of the existing method, the invention solves the focusing problem of a main camera and a secondary camera in the process of detecting the thread of the oil pipe, is used for providing clear images and provides stable input images for subsequent defects and detection. The technical scheme adopted by the invention is that the automatic focusing method for detecting the oil pipe thread comprises the following steps: focusing the X axis of the main camera by utilizing the middle point of the thread section; As a preferred embodiment of the present invention, the first step specifically includes: the main camera performs step scanning along the X-axis direction, and acquires a thread overlook image; Extracting contour feature point set of thread overlook image Wherein, the method comprises the steps of,Represent the firstThe positions of the individual edge feature points in the main camera image coordinate system,The number of the extracted effective feature points is calculated; calculating the geometric center point coordinates of the thread center line ,j=M, wherein, the total number of the components is equal to the total number of the components,The center point coordinates of the oil pipe thread section under the main camera coordinate system are given, and j is the thread stepping sequence number; And connecting the coordinates of the geometric center points to obtain the X center line of the overlooking surface of the thread. As a preferred embodiment of the present invention, the extraction of the contour feature points employs an edge detection operator. Focusing the Z axis of the main camera by using the definition evaluation value; as a preferred embodiment of the present invention, the second step specifically includes: The main camera performs step scanning along the Z-axis direction to obtain images at different Z-axis positions; and taking the maximum value of the definition evaluation values as the Z-axis position of the main camera. As a preferred embodiment of the present invention, the formula of the sharpness evaluation value is: wherein (X, Y) is the coordinates of the pixel point on the X, Y axis, Is the Z-axis position of the kth image. In a preferred embodiment of the present invention, the parallel light source and the main camera are moved in synchronization with each other in the X-axis direction, and image light compensation is performed. Thirdly, acquiring an intersection point of the thread end face by utilizing the X center line of the thread overlook surface of the main camera and the Y axis center line of the thread end face, focusing the axis of the auxiliary camera Y, Z by utilizing the intersection point, focusing the X axis of the aux