CN-121994198-A - Steel pipe posture determining method and device, electronic equipment and storage medium
Abstract
The invention relates to the technical field of steel tube attitude positioning, in particular to a steel tube attitude determination method, a device, electronic equipment and a storage medium; and then converting a plurality of edge pixel coordinates in the first edge image into a plurality of edge world coordinates according to an internal reference matrix describing the imaging characteristics of the camera and an external reference matrix describing the relative posture of the camera and a world coordinate system, and finally fitting the plurality of edge world coordinates through a three-dimensional elliptic equation to obtain the posture of the steel pipe. According to the invention, the gesture of the steel pipe is determined through image analysis, contact and fixture are not needed, the determining process efficiency is higher, and the speed of positioning the gesture of the steel pipe is improved.
Inventors
- YU YANG
- LI YANNAN
Assignees
- 承德建龙特殊钢有限公司
Dates
- Publication Date
- 20260508
- Application Date
- 20260410
Claims (10)
- 1. The method for determining the attitude of the steel pipe is characterized by comprising the following steps of: acquiring a first pipe end image of a steel pipe; extracting edge characteristics of the first pipe end image in a differential and non-maximum value elimination mode to obtain a first edge image; According to an internal reference matrix describing imaging characteristics of the camera and an external reference matrix describing relative postures of the camera and a world coordinate system, converting a plurality of edge pixel coordinates in a first edge map into a plurality of edge world coordinates; Fitting the plurality of edge world coordinates through a three-dimensional elliptic equation to obtain the posture of the steel pipe.
- 2. The method for determining the pose of a steel pipe according to claim 1, wherein the performing edge feature extraction on the first pipe end image by means of differential and non-maximum elimination to obtain a first edge map comprises: Acquiring a horizontal differential operator and a vertical differential operator; For each difference operator, carrying out dot product on the first pipe end image in a sliding mode to obtain a horizontal difference image and a vertical difference image; constructing a gradient map expressing the gradient direction and the gradient amplitude of the pixel according to the horizontal differential map and the vertical differential map; And processing the non-maximum value of the gradient map in a non-maximum value inhibition mode to obtain the first edge map.
- 3. The method according to claim 2, wherein constructing a gradient map expressing a pixel gradient direction and a gradient magnitude from the horizontal differential map and the vertical differential map comprises: for each pixel, calculating a gradient direction and a gradient amplitude according to a first formula, the horizontal differential graph and the vertical differential graph to obtain the first gradient direction and the first gradient amplitude, wherein the first formula is as follows: in the formula, For the first gradient magnitude value, In the direction of the first gradient, As the level difference value of the pixel, As the vertical differential value of the pixel, Is a rounding function; A gradient map is constructed from the plurality of first gradient directions and the plurality of first gradient magnitudes.
- 4. The method according to claim 2, wherein the processing the non-maxima of the gradient map by means of non-maxima suppression to obtain the first edge map comprises: Acquiring a first neighborhood radius; For each pixel in the gradient map, the following steps are performed: extracting the gradient direction of the pixel; Extracting pixels in the gradient direction and the opposite gradient direction of the pixels in the radius of a first neighborhood of the pixels by taking the pixels as centers, and taking the pixels as neighborhood pixels; If the gradient amplitude of the pixel is larger than that of all the neighborhood pixels, adding the pixel value of the pixel into the first edge map; otherwise, the pixel value of the pixel is set to zero and added to the first edge map.
- 5. The method for determining the pose of a steel pipe according to claim 1, wherein the converting the plurality of edge pixel coordinates in the first edge map into the plurality of edge world coordinates based on the internal reference matrix describing the imaging characteristics of the camera itself and the external reference matrix describing the relative pose of the camera and the world coordinate system comprises: Obtaining an internal reference matrix and an external reference matrix, wherein the external reference matrix comprises a rotation matrix describing the rotation relation from a world coordinate system to a camera coordinate system and a translation vector describing the coordinates of an origin of the world coordinate system in the camera coordinate system; For each edge pixel coordinate, the following steps are performed: According to the internal reference matrix and a second formula, converting the edge pixel coordinates into edge camera coordinates, wherein the second formula is as follows: in the formula, For the coordinates of the camera(s), To the end face of the steel pipe the distance between the optical centers of the cameras, As the matrix of the internal reference, Is pixel coordinates; according to the extrinsic matrix and a third formula, converting the edge pixel coordinates into edge world coordinates, wherein the third formula is as follows: in the formula, As a world coordinate of the world, In order to rotate the matrix is rotated, Is a translation vector.
- 6. The method of determining the pose of a steel pipe according to any one of claims 1 to 5, wherein said fitting said plurality of edge world coordinates by three-dimensional elliptic equations comprises: Obtaining a three-dimensional elliptic equation and a plurality of undetermined coefficient arrays, wherein each undetermined coefficient array comprises a plurality of coefficients required for constructing a fitting three-dimensional elliptic equation; Substituting the plurality of undetermined coefficient arrays into the three-dimensional elliptic equation respectively to obtain a plurality of first equations; Substituting the plurality of edge world coordinates into the first equations respectively for each first equation, and constructing a plurality of obtained equation outputs into an output array; for each coefficient array to be determined, determining fitting deviation according to an output array corresponding to the first equation; If the iteration times are not reached, each coefficient array to be determined is adjusted according to a plurality of fitting deviations, and the step of substituting the coefficient arrays to be determined into the three-dimensional elliptic equation respectively to obtain a plurality of first equations is skipped; otherwise, taking the coefficient array with the smallest fitting deviation as a target coefficient array, and extracting the posture of the steel pipe from the target coefficient array.
- 7. The method of determining the attitude of a steel pipe according to claim 6, wherein the three-dimensional elliptic equation is: in the formula, For the output of the equation, In order for the snack vector to be a vector, Is the direction vector of the major axis of the ellipse, Is the minor axis direction vector of the ellipse, Is the normal vector of the elliptical plane, Is the center of the ellipse, And The first symmetry axis, the second symmetry axis and the third symmetry axis are respectively the ellipsoids where the ellipses are located.
- 8. A steel pipe posture determining apparatus for realizing the steel pipe posture determining method according to any one of claims 1 to 7, comprising: The pipe end image acquisition module is used for acquiring a first pipe end image of the steel pipe; the edge extraction module is used for extracting edge characteristics of the first pipe end image in a differential and non-maximum value elimination mode to obtain a first edge image; The coordinate system conversion module is used for converting a plurality of edge pixel coordinates in the first edge map into a plurality of edge world coordinates according to an internal reference matrix describing the imaging characteristics of the camera and an external reference matrix describing the relative gesture of the camera and the world coordinate system; And And the steel tube attitude determination module is used for fitting the plurality of edge world coordinates through a three-dimensional elliptic equation to obtain the attitude of the steel tube.
- 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. 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
Steel pipe posture determining method and device, electronic equipment and storage medium Technical Field The present invention relates to the field of steel tube gesture positioning technologies, and in particular, to a method and apparatus for determining a steel tube gesture, an electronic device, and a storage medium. Background The polishing of the pipe end of the steel pipe is a key process in the manufacturing of the pipeline, and the core aims at removing burrs, oxide skin and groove processing residues of the pipe end, realizing end surface leveling and groove smoothness and ensuring 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 posture determining mode has the problem of low efficiency due to the fact that the steel pipe needs to rotate later and is produced in batches and in specifications. Based on the above, a steel pipe posture determining method needs to be developed and designed. Disclosure of Invention The embodiment of the invention provides a method and a device for determining the posture of a steel pipe, electronic equipment and a storage medium, which are used for solving the problem of low pipe end posture adjustment efficiency in the prior art. In a first aspect, an embodiment of the present invention provides a method for determining a posture of a steel pipe, including: acquiring a first pipe end image of a steel pipe; extracting edge characteristics of the first pipe end image in a differential and non-maximum value elimination mode to obtain a first edge image; According to an internal reference matrix describing imaging characteristics of the camera and an external reference matrix describing relative postures of the camera and a world coordinate system, converting a plurality of edge pixel coordinates in a first edge map into a plurality of edge world coordinates; Fitting the plurality of edge world coordinates through a three-dimensional elliptic equation to obtain the posture of the steel pipe. In one possible implementation manner, the extracting edge features of the first pipe end image by using the differential and non-maximum value elimination manner to obtain a first edge map includes: Acquiring a horizontal differential operator and a vertical differential operator; For each difference operator, carrying out dot product on the first pipe end image in a sliding mode to obtain a horizontal difference image and a vertical difference image; constructing a gradient map expressing the gradient direction and the gradient amplitude of the pixel according to the horizontal differential map and the vertical differential map; And processing the non-maximum value of the gradient map in a non-maximum value inhibition mode to obtain the first edge map. In one possible implementation manner, the constructing a gradient map expressing the gradient direction of the pixel and the gradient magnitude according to the horizontal difference map and the vertical difference map includes: for each pixel, calculating a gradient direction and a gradient amplitude according to a first formula, the horizontal differential graph and the vertical differential graph to obtain the first gradient direction and the first gradient amplitude, wherein the first formula is as follows: in the formula, For the first gradient magnitude value,In the direction of the first gradient,As the level difference value of the pixel,As the vertical differential value of the pixel,Is a rounding function; A gradient map is constructed from the plurality of first gradient directions and the plurality of first gradient magnitudes. In one possible implementation manner, the processing, by means of non-maximum suppression, the non-maximum value of the gradient map to obtain the first edge map includes: Acquiring a first neighborhood radius; For each pixel in the gradient map, the following steps are performed: extracting the gradient direction of the pixel; Extracting pixels in the gradient direction and the opposite gradient direction of the pixels in the radius of a first neighborhood of the pixels by taking the pixels as centers, and taking the pixels as neighborhood pixels; If the gradient amplitude of the pixel is larger than that of all the neighborhood pixels, adding the pixel value of the pixel into the first edge map; otherwise, the pixel val