Search

CN-122015779-A - Method and device for determining positions of ends of steel pipes, electronic equipment and storage medium

CN122015779ACN 122015779 ACN122015779 ACN 122015779ACN-122015779-A

Abstract

The invention relates to the technical field of steel pipe end positioning, in particular to a method, a device, electronic equipment and a storage medium for determining the position of a steel pipe end; processing the first pipe end image and the second pipe end image by rolling and non-maximum value inhibition of pixels to obtain a first pipe end edge image and a second pipe end edge image, constructing a coordinate mapping equation for mapping the world coordinates of the pipe ends to pixel coordinates according to an internal reference matrix, a first external reference matrix and a second external reference matrix, and finally fitting the coordinate mapping equation according to the first pipe end edge image and the second pipe end edge image to obtain the position of the center of the pipe end of the steel pipe. The whole flow of the method does not need manual intervention, a complete technical link is formed from image acquisition, edge extraction to center positioning, the method is suitable for industrialized batch detection scenes, and the detection cost is reduced.

Inventors

  • YU YANG
  • LI YANNAN

Assignees

  • 承德建龙特殊钢有限公司

Dates

Publication Date
20260512
Application Date
20260410

Claims (10)

  1. 1. A method for determining the position of a pipe end of a steel pipe, comprising: acquiring a first pipe end image and a second pipe end image of a steel pipe, wherein the first pipe end image and the second pipe end image are acquired based on shooting by a binocular shooting device; Processing the first pipe end image and the second pipe end image by rolling pixels and suppressing non-maximum values to obtain a first pipe end edge image and a second pipe end edge image; Constructing a coordinate mapping equation for mapping the end edge world coordinates to pixel coordinates according to an internal reference matrix, a first external reference matrix and a second external reference matrix, wherein the internal reference matrix describes the relation between an image coordinate and a camera coordinate, the external reference matrix describes the relation between the camera coordinate system and the world coordinate system, and the first external reference matrix and the second external reference matrix respectively correspond to two eyes of a shooting device; and fitting the coordinate mapping equation according to the first pipe end edge map and the second pipe end edge map to obtain the position of the center of the pipe end of the steel pipe.
  2. 2. The method according to claim 1, wherein the processing the first pipe end image and the second pipe end image by rolling up and non-maximum suppressing pixels to obtain a first pipe end edge map and a second pipe end edge map comprises: for each of the first tube end image and the second tube end image, the following steps are performed: acquiring a horizontal differential operator and a vertical differential operator; Carrying out convolution processing on the pipe end image through the horizontal differential operator and the vertical differential operator to obtain a horizontal differential image and a vertical differential image; Constructing a gradient map representing image pixel gradient values and gradient directions according to the horizontal differential map and the vertical differential map; For each pixel in the gradient map, finding out the pixels in the gradient direction and the gradient opposite direction from the neighborhood as first neighborhood pixels, and reserving the pixel value or setting the pixel value to 0 according to whether the pixels are larger than all the first neighborhood pixels; and taking the gradient map subjected to pixel value processing according to the first neighborhood pixels as a pipe end edge map.
  3. 3. The method for determining the position of the end of the steel pipe according to claim 2, wherein constructing a gradient map representing the gradient values and the gradient directions of the pixels of the image based on the horizontal differential map and the vertical differential map comprises: Extracting a pixel gradient value and a pixel gradient direction of each pixel according to a first formula, the horizontal differential diagram and the vertical differential diagram, and adding the obtained pixel gradient value and the pixel gradient direction into the gradient diagram, wherein the first formula is as follows: In the formula, For the value of the pixel gradient, Is the direction of the gradient of the pixel, For the values of the pixels in the vertical difference map, For the values of the pixels in the level difference map, In order to round the function of the rounding, In order to achieve a peripheral rate of the material, As an arctangent function.
  4. 4. The method of determining the position of the end of the steel pipe according to claim 1, wherein constructing a coordinate mapping equation for the end edge world coordinate to the pixel coordinate based on the internal reference matrix, the first external reference matrix, and the second external reference matrix comprises: Constructing a circular equation under a three-dimensional coordinate system taking the center of a pipe end as a reference; according to the first extrinsic matrix and the second extrinsic matrix, a first coordinate conversion equation and a second coordinate conversion equation which convert world coordinates into camera coordinates are constructed, wherein the first coordinate conversion equation and the second coordinate conversion equation respectively correspond to two purposes of a shooting device; according to the internal reference matrix, a third coordinate conversion equation for converting the camera coordinates into pixel coordinates is constructed; And combining the circular equation, the first coordinate conversion equation, the second coordinate conversion equation and the third coordinate conversion equation to obtain the coordinate mapping equation.
  5. 5. The method for determining the position of the end of a steel pipe according to claim 4, wherein the circular equation is: In the formula, Is the world coordinate of the edge of the pipe end, Is the coordinates of the center of the tube end, Is the radius of the steel pipe, Is the output of a circular equation; the first extrinsic matrix and the second extrinsic matrix respectively comprise a rotation matrix describing a rotation relation from a world coordinate system to a camera coordinate system and a translation vector describing coordinates of an origin of the world coordinate system in the camera coordinate system, and the first coordinate conversion equation or the second coordinate conversion equation is as follows: In the formula, For the coordinates of the camera(s), Is a rotation matrix of the first extrinsic matrix or a rotation matrix of the second extrinsic matrix, Is the translation vector of the first extrinsic matrix or the translation vector of the second extrinsic matrix; the third coordinate conversion equation is: In the formula, For the pixel coordinates, For the distance of the tip edge to the camera optical center, Is an internal reference matrix.
  6. 6. The method for determining the position of the end of the steel pipe according to any one of claims 1 to 5, wherein the fitting the coordinate mapping equation according to the first end edge map and the second end edge map to obtain the position of the center of the end of the steel pipe comprises: Acquiring the radius of the steel pipe and a plurality of parameter arrays, wherein each parameter array comprises a pipe end center coordinate and a distance from the edge of the pipe end to the optical center of the camera; Substituting each parameter array into the coordinate mapping equation to obtain a first fitting equation; substituting coordinates of pipe end pixels in the first pipe end edge graph and the second pipe end edge graph into a first fitting equation for each first fitting equation, and determining fitting deviation of a parameter array according to a plurality of outputs of the first fitting equation; If the preset iteration times are not reached, adjusting the parameter arrays according to the fitting deviations, and jumping to the step of substituting each parameter array into the coordinate mapping equation to obtain a first fitting equation; Otherwise, taking the parameter array with the minimum fitting deviation as a target parameter array, and determining the position of the center of the pipe end according to the target parameter array.
  7. 7. The method of determining the position of the end of a steel pipe according to claim 6, wherein the plurality of outputs of the first fitting equation determine fitting deviations of the parameter array, comprising: Determining a fitting deviation of the parameter array according to a second formula and a plurality of outputs of the first fitting equation, wherein the second formula is as follows: In the formula, In order to fit the deviation is calculated, For the first fitting equation The number of outputs is chosen such that, Is the total number of tube end pixels in the first tube end edge map and the second tube end edge map.
  8. 8. A steel pipe end position determining apparatus for realizing the steel pipe end position determining method according to any one of claims 1 to 7, comprising: The binocular image acquisition module is used for acquiring a first pipe end image and a second pipe end image of the steel pipe, wherein the first pipe end image and the second pipe end image are acquired based on shooting of a binocular shooting device; The image edge extraction module is used for processing the first pipe end image and the second pipe end image in a mode of rolling pixels and suppressing non-maximum values to obtain a first pipe end edge image and a second pipe end edge image; The coordinate mapping equation construction module is used for constructing a coordinate mapping equation for mapping the end edge world coordinates to pixel coordinates according to an internal reference matrix, a first external reference matrix and a second external reference matrix, wherein the internal reference matrix describes the relation between the image coordinates and the camera coordinates, the external reference matrix describes the relation between the camera coordinates and the world coordinates, and the first external reference matrix and the second external reference matrix respectively correspond to two eyes of the shooting device; And And the pipe end center positioning module is used for fitting the coordinate mapping equation according to the first pipe end edge diagram and the second pipe end edge diagram to obtain the position of the center of the pipe end of the steel pipe.
  9. 9. An electronic device comprising a memory and a processor, the memory having stored therein a computer program executable on the processor, characterized in that the processor implements the steps of the method according to any of the preceding claims 1 to 7 when the computer program is executed.
  10. 10. A computer readable storage medium storing a computer program, characterized in that the computer program when executed by a processor implements the steps of the method according to any of the preceding claims 1 to 7.

Description

Method and device for determining positions of ends of steel pipes, electronic equipment and storage medium Technical Field The present invention relates to the field of positioning technologies of steel pipe ends, and in particular, to a method and an apparatus for determining a position of a steel pipe end, an electronic device, and a storage medium. Background The polishing of the steel pipe end is a key process in the manufacture of the steel pipe, and the core purpose is to remove burrs, oxide skin and groove processing residues of the pipe end, realize end surface leveling and groove smoothness, and ensure the reliability of subsequent welding, flange connection and anti-corrosion treatment. The core of polishing the end of the steel pipe is to precisely control geometric precision, adapt material characteristics and guarantee the reliability of subsequent procedures. In site construction, proper tools and parameters are required to be selected according to the materials, pipe diameters and connection modes of the steel pipes, and the positioning-polishing-checking process is strictly followed. For mass-produced steel pipes, steel pipe gesture recognition and positioning are key to high-quality polishing. The traditional positioning mode adopts a tool and a fixture to determine the posture of the steel pipe, and the traditional pipe end position determining mode has the problem of low efficiency due to the fact that the steel pipe needs to follow-up rotation and production batch and specification. Based on the above, a method for determining the position of the end of the steel pipe needs to be developed and designed. Disclosure of Invention The embodiment of the invention provides a method, a device, electronic equipment and a storage medium for determining the position of a steel pipe end, which are used for solving the problem of low efficiency in determining the position of the steel pipe end in the prior art. In a first aspect, an embodiment of the present invention provides a method for determining a position of a pipe end of a steel pipe, including: acquiring a first pipe end image and a second pipe end image of a steel pipe, wherein the first pipe end image and the second pipe end image are acquired based on shooting by a binocular shooting device; Processing the first pipe end image and the second pipe end image by rolling pixels and suppressing non-maximum values to obtain a first pipe end edge image and a second pipe end edge image; Constructing a coordinate mapping equation for mapping the end edge world coordinates to pixel coordinates according to an internal reference matrix, a first external reference matrix and a second external reference matrix, wherein the internal reference matrix describes the relation between an image coordinate and a camera coordinate, the external reference matrix describes the relation between the camera coordinate system and the world coordinate system, and the first external reference matrix and the second external reference matrix respectively correspond to two eyes of a shooting device; and fitting the coordinate mapping equation according to the first pipe end edge map and the second pipe end edge map to obtain the position of the center of the pipe end of the steel pipe. In one possible implementation manner, the processing the first pipe end image and the second pipe end image by performing rolling and non-maximum suppression on pixels to obtain a first pipe end edge map and a second pipe end edge map includes: for each of the first tube end image and the second tube end image, the following steps are performed: acquiring a horizontal differential operator and a vertical differential operator; Carrying out convolution processing on the pipe end image through the horizontal differential operator and the vertical differential operator to obtain a horizontal differential image and a vertical differential image; Constructing a gradient map representing image pixel gradient values and gradient directions according to the horizontal differential map and the vertical differential map; For each pixel in the gradient map, finding out the pixels in the gradient direction and the gradient opposite direction from the neighborhood as first neighborhood pixels, and reserving the pixel value or setting the pixel value to 0 according to whether the pixels are larger than all the first neighborhood pixels; and taking the gradient map subjected to pixel value processing according to the first neighborhood pixels as a pipe end edge map. In one possible implementation manner, the constructing a gradient map characterizing gradient values and gradient directions of pixels of an image according to the horizontal difference map and the vertical difference map includes: Extracting a pixel gradient value and a pixel gradient direction of each pixel according to a first formula, the horizontal differential diagram and the vertical differential diagram, and adding the obtained pi