A pipeline automatic alignment method based on machine vision

Automatically aligning pipe ports through machine vision technology solves the problems of insufficient manual matching accuracy and poor adaptability in the existing technology, achieves efficient and precise pipe alignment, and improves welding quality and construction efficiency.

CN114119456BActive Publication Date: 2024-08-23THE SIXTH CONSTR CO LTD OF CHINA NAT CHEM ENG +1
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202111035416.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-09-02
Publication Date
2024-08-23
Estimated Expiration
2041-09-02

AI Technical Summary

Technical Problem

In the existing pipeline joint welding process, the manual joint method has insufficient accuracy and poor adaptability, and the existing specialized equipment has poor adaptability to changes in pipe diameter, which affects the welding quality and construction efficiency.

Method used

An automatic alignment method based on machine vision is used to collect pipeline images through image acquisition equipment, extract the target ellipse, calculate pose parameters, adjust the pipeline position and attitude, and achieve precise alignment of pipeline ports.

Benefits of technology

It improves the adaptability to changes in pipe diameter, improves construction efficiency and accuracy, ensures that the central axes of the two pipes are aligned in the same straight line, and improves the welding quality.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114119456B
    Figure CN114119456B
Patent Text Reader

Abstract

The invention discloses a pipeline automatic centering method based on machine vision, comprising: step 1, taking one of the two pipelines as a reference pipeline and the other as a pipeline to be detected, collecting an image to be detected and a reference image; step 2, extracting a target ellipse and calculating a posture, respectively obtaining a reference state posture and a test state posture; step 3, comparing the reference state posture and the test state posture, and calculating the relative posture of the pipeline to be detected relative to the reference pipeline; step 4, adjusting the reference pipeline to the reference state according to the relative posture, step 5, judging whether the requirements are met, if the requirements are met, adjusting the pipeline to be detected to the centering state, if the requirements are not met, repeating the steps 1 to 5 until the requirements are met, and adjusting the pipeline to be detected to the centering state. The method of the invention has good adaptability to changes in pipe diameter, high construction efficiency and high precision.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of centering in the process of pipe butt welding, and more specifically, to a method for automatic pipe centering based on machine vision. Background Art

[0002] During the process of pipe butt welding, the ports of the two pipes need to be aligned first, and then the butt welding can be performed. The quality of the butt welding directly affects the subsequent welding quality and pipeline safety. At present, the pipeline construction site mainly adopts the method of manual butt welding. To ensure the quality of butt welding, workers need to use some tools including spirit level (to check the horizontality), some simple pads (used to pad the pipes to make them in the same straight line when straightening), crowbars (used to pry the pipes and adjust the pipe posture), etc. In addition, the construction site also uses pipe butt welding devices to assist in the completion of pipe butt welding. As a specialized pipeline construction device, although it can reduce labor intensity to a certain extent and ensure the accuracy of butt welding, the butt welding device has poor adaptability to changes in pipe diameter, which is its obvious shortcoming. Summary of the invention

[0003] In order to achieve these purposes and other advantages according to the present invention, a method for automatic pipe centering based on machine vision is provided, which is used to align the ports of two pipes, and the ports of the pipes are tilted to form a single V-shaped groove. The method for automatic pipe centering based on machine vision includes the following steps:

[0004] Step 1: One of the two pipelines is used as a reference pipeline, and the other pipeline is used as a pipeline to be detected. An image acquisition device is used to acquire an image of the pipeline to be detected as an image to be detected; and an image acquisition device is used to acquire an image of the reference pipeline as a reference image;

[0005] Step 2: extract the target ellipse from the reference image and the image to be detected respectively, and obtain the target ellipse of the reference image and the image to be detected, and calculate the pose of the target ellipse of the reference image and the image to be detected, and obtain the reference state pose and the state pose to be tested respectively;

[0006] Step 3: Compare the reference state posture with the state posture to be tested, and calculate the relative posture of the pipeline to be tested relative to the reference pipeline;

[0007] Step 4: According to the relative posture of the pipeline to be inspected relative to the reference pipeline, adjust the reference pipeline to the reference state according to the relative posture.

[0008] Step 5: Determine whether the requirements are met.

[0009] If the requirements are met, adjust the pipeline to be inspected to the centering state.

[0010] If the requirements are not met, repeat steps 1 to 5 until the requirements are met, and then adjust the pipeline to be inspected to a centered state.

[0011] According to a preferred embodiment of the present invention, in step 2, target ellipse extraction is performed on the reference image and the image to be detected respectively, wherein the target ellipse extraction includes the following steps:

[0012] The image is enhanced, filtered, edge detected, contour segmented, connected with common circular contours, fitted ellipse, and identified as a target ellipse, and finally the target ellipse is obtained.

[0013] According to a preferred embodiment of the present invention, the image is enhanced using a Gamma transformation algorithm.

[0014] According to a preferred embodiment of the present invention, the filtering process adopts a bilateral filtering algorithm.

[0015] According to a preferred embodiment of the present invention, the fitting ellipse and target ellipse identification specifically include: first, screening according to the contour attributes of the elliptical arc to obtain a set of n arc segments, then dividing the elliptical arc segments belonging to the same curve edge into a group, using the grouped arc segment combinations to fit the ellipse parameters to obtain a candidate ellipse set, and finally identifying the target ellipse from the candidate ellipse set.

[0016] According to a preferred embodiment of the present invention, in step 2, the pose calculation of the target ellipse of the reference image and the image to be detected specifically includes:

[0017] A. Take the inner circle and middle circle at the end of the pipe as two characteristic circles, namely characteristic circle A and characteristic circle B.

[0018] In the image acquisition device coordinate system O c -X c Y c Z c Next, set the center coordinates G(X, Y, Z), the normal vector of the plane where the characteristic circle is located Among them, l, m, and n represent the coordinate values ​​of the normal vector, and the pose parameters of the characteristic circle are represented by the vector group [XYZ αβ], where α is the pitch angle of the characteristic circle and β is the yaw angle of the characteristic circle;

[0019] The values ​​of α and β are calculated according to formula (1):

[0020]

[0021] Further, when l>0, m>0, α=arctan(m / l);

[0022] When l<0, α=π+arctan(m / l);

[0023] When l>0, m<0, α=2π+arctan(m / l);

[0024] B. The projection of the characteristic circle on the camera imaging plane forms a projection ellipse, which is parallel to the optical center O of the image acquisition device. c Form an elliptical cone, find a plane in space so that it can be tangent to the cone surface of the elliptical cone to form a circle with a known radius.

[0025] (1) In the image acquisition device coordinate system O c -X c Y c Z c The corresponding relationship between the coordinates (x, y, z) of any point on the elliptical cone and its projection point (u, v) on the camera imaging plane after imaging is:

[0026]

[0027] In the above formula, f is the focal length of the image acquisition device, g represents the projection ellipse of the characteristic circle projected on the camera imaging plane,

[0028] (2) Find the coordinate system O of the image acquisition device c -X c Y c Z c The characteristic cone equation with the origin as the vertex and passing through the projection ellipse on the camera imaging plane is:

[0029] Ax 2 +By 2 +Cxy+Dxz+Eyz+Fz 2 =0 (3)

[0030] In the above formula, A = af 2 , B=bf 2 , C = cf 2 , D = df, E = ef, F = f,

[0031] Among them, a, b, c, d, e are the coefficients of the projection ellipse, and f is the focal length, which can be obtained by extracting the features of the projection ellipse. Assume that the projection ellipse equation of the pipe end face feature on the image is: au 2 +buv+cv 2 +du+ev+f=0(2-1), combining formula (2) and formula (2-1), we can get formula (3),

[0032] The characteristic elliptical cone equation (3) is rewritten into a matrix form:

[0033] [xi y i z i ]Q[x i y i z i ] T =0 (4)

[0034]

[0035] (3) Find a new coordinate system to transform the obtained characteristic cone elliptical cone into a standard elliptical cone, that is, the image acquisition device coordinate system O c -X c Y c Z c Z c The axis rotation is aligned with the rotation axis of the elliptical cone, and the new coordinate system is aligned with the image acquisition device coordinate system O c -X c Y c Z c The new coordinate system obtained by transformation is used as the standard coordinate system. The coordinates (x′, y′, z′) of any point on the standard coordinate system are the same as the coordinates of the point in the image acquisition device coordinate system O. c -X c Y c Z c The coordinates (x, y, z) below satisfy:

[0036] [xyz] T =P[x′ y′ z′] T (6)

[0037] In the above formula, P is the rotation matrix, the transformation matrix, T is the matrix rank symbol,

[0038] Substituting formula (6) into formula (4), the equation of the standard elliptical cone is:

[0039] [x′ y′ z′]P T QP[x′ y′ z′] T =0 (7)

[0040] Q is a 3×3 real symmetric matrix, so there must be P -1 QP=P T QP = diag (λ1, λ2, λ3), where λ1, λ2, λ3 are the eigenvalues ​​of the matrix Q, the rotation matrix P,

[0041] The standard expression of the transformed elliptical cone is:

[0042] λ1x′ 2 +λ2y′ 2 +λ3z′ 2=0 (8)

[0043] (4) In the new coordinate system, find that the section after cutting the standard elliptical cone is a standard circular plane with a radius of 1, and find that the section is a cutting plane with a radius of the characteristic circle and a radius of R. There are two cutting planes that meet this condition.

[0044] The normal vectors and center coordinates of the two circular sections obtained after cutting are two sets of feasible solutions of the characteristic circle in the new coordinate system.

[0045]

[0046]

[0047] (5) Convert the two feasible solutions from the standard coordinate system to the image acquisition device coordinate system, and multiply the result obtained in step (4) by the rotation matrix P to obtain the spatial position of the characteristic circle relative to the image acquisition device coordinate system.

[0048] satisfy Where k refers to the ratio of the two vectors. Substituting into formula (8) and formula (9) can solve the actual posture parameters of the two characteristic circles A or B, which can be expressed as vector POSE = (X, Y, Z, α, β), where (X, Y, Z) T is the position vector of the center of the characteristic circle in the image acquisition device coordinate system, α, β are the attitude angles of the characteristic circle relative to the image acquisition device coordinate system,

[0049] According to a preferred embodiment of the present invention, when the image acquisition device acquires the image of the pipeline to be inspected / reference pipeline, it is necessary to perform automatic exposure calculation on the image acquisition device, use the image entropy weighted image gradient as the image information measurement index, and adjust the camera exposure parameters by judging whether the two measurement values ​​of the image are optimal. When the two measurement values ​​reach the preset values, it is considered that the image acquisition device has obtained the optimal exposure parameters, and the image acquisition device can acquire a well-exposed image. A well-exposed image is one with sharp edges, no blur, and low noise.

[0050] According to a preferred embodiment of the present invention, the adjusting of the pipeline to be inspected to a centered state adopts an automatic centering device.

[0051] According to a preferred embodiment of the present invention, during the centering process, the pipeline to be tested and the reference pipeline are both placed on a V-shaped horizontal guide rail. The pitch angle adjustment amount of the reference pipeline is 0°.

[0052] It includes image acquisition equipment, centering actuator, motion control system, industrial computer,

[0053] Image acquisition equipment, responsible for acquiring images of the pipeline to be inspected / reference pipeline;

[0054] The industrial computer is electrically connected to the image acquisition device, receives image data from the image acquisition device, runs built-in control software in the industrial computer, and the control software calculates the relative position of the pipeline to be detected relative to the reference pipeline. The industrial computer sends a motion instruction according to the relative position of the pipeline to be detected relative to the reference pipeline.

[0055] The motion control system receives the motion command from the industrial computer and then controls the centering mechanism to perform the centering motion.

[0056] According to a preferred embodiment of the present invention, the centering actuator can adjust the displacement of the pipeline in the X, Y, and Z directions and the deflection angle.

[0057] The invention has at least the following beneficial effects: the method of the invention has good adaptability to changes in pipe diameter, high construction efficiency and high precision. The invention uses machine vision technology to measure the position and posture of the pipeline, adjusts the position and posture of the pipeline according to the position and posture parameters, and adjusts the central axes of the two pipelines to be on the same straight line.

[0058] Other advantages, objectives and features of the present invention will be embodied in part through the following description, and in part will be understood by those skilled in the art through study and practice of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS

[0059] Figure 1 It is a schematic diagram of the process of the automatic pipeline centering method of the present invention;

[0060] Figure 2 It is a schematic diagram of the structure of the pipeline to be detected or the reference pipeline in the present invention.

[0061] Figure 3 Schematic diagrams of two positions and postures of the characteristic circle in the present invention.

[0062] Figure 4 These are two posture solutions of the characteristic circle in the present invention.

[0063] Figure 5 It is a structural schematic diagram of the automatic centering device in the present invention. DETAILED DESCRIPTION

[0064] The present invention is further described in detail below in conjunction with the accompanying drawings so that those skilled in the art can implement the invention with reference to the description.

[0065] The following description is used to disclose the present invention so that those skilled in the art can implement the present invention. The preferred embodiments described below are only examples, and those skilled in the art can think of other obvious variations. The basic principles of the present invention defined in the following description can be applied to other embodiments, variations, improvements, equivalents, and other technical solutions that do not deviate from the spirit and scope of the present invention.

[0066] Those skilled in the art should understand that, in the disclosure of the present invention, the orientation or position relationship indicated by the terms "longitudinal", "lateral", "up", "down", "front", "back", "left", "right", "vertical", "horizontal", "top", "bottom", "inside", "outside", etc. are based on the orientation or position relationship shown in the drawings, which are only for the convenience of describing the present invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, be constructed and operate in a specific orientation. Therefore, the above terms should not be understood as limiting the present invention.

[0067] It is to be understood that the term "one" should be understood as "at least one" or "one or more", that is, in one embodiment, the number of an element may be one, while in another embodiment, the number of the element may be multiple, and the term "one" should not be understood as a limitation on the quantity.

[0068] like Figure 1-5 As shown, a pipeline automatic centering method based on machine vision of the present invention is used to align the ports of two pipelines, and the ports of the pipelines are tilted to form a single V-shaped groove. The pipeline automatic centering method based on machine vision includes the following steps:

[0069] Step 1: One of the two pipelines is used as a reference pipeline, and the other pipeline is used as a pipeline to be detected. An image acquisition device is used to acquire an image of the pipeline to be detected as an image to be detected; and an image acquisition device is used to acquire an image of the reference pipeline as a reference image;

[0070] Step 2: extract the target ellipse from the reference image and the image to be detected respectively, and obtain the target ellipse of the reference image and the image to be detected, and calculate the pose of the target ellipse of the reference image and the image to be detected, and obtain the reference state pose and the state pose to be tested respectively;

[0071] Step 3: Compare the reference state posture with the state posture to be tested, and calculate the relative posture of the pipeline to be tested relative to the reference pipeline;

[0072] Step 4: According to the relative posture of the pipeline to be inspected relative to the reference pipeline, adjust the reference pipeline to the reference state according to the relative posture.

[0073] Step 5: Determine whether the requirements are met.

[0074] If the requirements are met, adjust the pipeline to be inspected to the centering state.

[0075] If the requirements are not met, repeat steps 1 to 5 until the requirements are met, and then adjust the pipeline to be inspected to a centered state.

[0076] According to a preferred embodiment of the present invention, in step 2, target ellipse extraction is performed on the reference image and the image to be detected respectively, wherein the target ellipse extraction includes the following steps:

[0077] The image is enhanced, filtered, edge detected, contour segmented, connected with common circular contours, fitted ellipse, and identified as a target ellipse, and finally the target ellipse is obtained.

[0078] Using the Gamma transformation algorithm to enhance the image can improve the impact of uneven image brightness and increase image contrast.

[0079] The bilateral filtering algorithm is used for filtering and image denoising. The bilateral filtering algorithm can remove the noise of the image while maintaining the edge of the image. Image enhancement and image filtering are image preprocessing steps. The Canny operator is used to detect the ellipse contour after the characteristic circle is imaged, and the sub-pixel coordinates of the contour points are obtained by polynomial fitting. Contour segmentation is to divide the obtained image contour into straight lines and elliptical arcs. Co-circular contour connection: first, a set of n arc segments is obtained according to the contour attributes of the elliptical arc, and then the elliptical arc segments belonging to the same curve edge are divided into 1 group, and the grouped arc segment combination is used to fit the ellipse parameters to obtain a candidate ellipse set, and finally the target ellipse is identified from the candidate ellipse set.

[0080] In another embodiment, the pose calculation in the pose calculation of the reference image and the target ellipse of the image to be detected specifically includes:

[0081] A. The inner circle and middle circle of the pipe port are used as two characteristic circles, namely characteristic circle A 1 and characteristic circle B 2. The pipe port is tilted to form a single V-shaped groove 3.

[0082] In the image acquisition device coordinate system O c -X c Y c Z c Next, set the center coordinates G (X, Y, Z), the normal vector of the plane 5 where the characteristic circle is located Among them, l, m, and n represent the coordinate values ​​of the normal vector, and the pose parameters of the characteristic circle are represented by the vector group [XYZ αβ], where α is the pitch angle of the characteristic circle and β is the yaw angle of the characteristic circle;

[0083] The values ​​of α and β are calculated according to formula (1):

[0084]

[0085] Further, when l>0, m>0, α=arctan(m / l);

[0086] When l<0, α=π+arctan(m / l);

[0087] When l>0, m<0, α=2π+arctan(m / l);

[0088] B. The projection of the characteristic circle on the camera imaging plane forms a projection ellipse, which is parallel to the optical center O of the image acquisition device. c Form an elliptical cone, find a plane in space so that it can be tangent to the cone surface of the elliptical cone to form a circle with a known radius.

[0089] (1) In the image acquisition device coordinate system O c -X c Y c Z c The corresponding relationship between the coordinates (x, y, z) of any point on the elliptical cone and its projection point (u, v) on the camera imaging plane 4 after imaging is:

[0090]

[0091] In the above formula, f is the focal length of the image acquisition device, g represents the projection ellipse of the characteristic circle projected on the camera imaging plane 4,

[0092] (2) Find the coordinate system O of the image acquisition device c -X c Y c Z c The characteristic cone equation with the origin as the vertex and passing through the projection ellipse on the camera imaging plane is:

[0093] Ax 2 +By 2 +Cxy+Dxz+Eyz+Fz 2 =0 (3)

[0094] In the above formula, A = af 2 , B=bf 2 , C = cf 2 , D = df, E = ef, F = f,

[0095] Among them, a, b, c, d, e are the coefficients of the projection ellipse, and f is the focal length, which can be obtained by extracting the features of the projection ellipse. Assume that the projection ellipse equation of the pipe end face feature on the image is: au 2 +buv+cv 2 +du+ev+f=0(2-1), combining formula (2) and formula (2-1), we can get formula (3),

[0096] The characteristic elliptical cone equation (3) is rewritten into a matrix form:

[0097] [xi y i z i ]Q[x i y i z i ] T =0 (4)

[0098]

[0099] (3) Find a new coordinate system to transform the obtained characteristic cone elliptical cone into a standard elliptical cone, that is, the image acquisition device coordinate system O c -X c Y c Z c Z c The axis rotation is aligned with the rotation axis of the elliptical cone, and the new coordinate system is aligned with the image acquisition device coordinate system O c -X c Y c Z c The new coordinate system obtained by transformation is used as the standard coordinate system. The coordinates (x′, y′, z′) of any point on the standard coordinate system are the same as the coordinates of the point in the image acquisition device coordinate system O. c -X c Y c Z c The coordinates (x, y, z) below satisfy:

[0100] [xyz] T =P[x′ y′ z′] T (6)

[0101] In the above formula, P is the rotation matrix, the transformation matrix, T is the matrix rank symbol,

[0102] Substituting formula (6) into formula (4), the equation of the standard elliptical cone is:

[0103] [x′ y′ z′]P T QP[x′ y′ z′] T =0 (7)

[0104] Q is a 3×3 real symmetric matrix, so there must be P -1 QP=P T QP = diag (λ1, λ2, λ3) where λ1, λ2, λ3 are the eigenvalues ​​of the matrix Q, the rotation matrix P,

[0105] The standard expression of the transformed elliptical cone is:

[0106] λ1x′ 2 +λ2y′ 2 +λ3z′ 2=0 (8)

[0107] (4) In the new coordinate system, find that the cutting plane after cutting the standard elliptical cone is a standard circular plane with a radius of 1, and find that the cutting plane is a cutting plane with a radius of the characteristic circle and a radius of R. There are two cutting planes that meet this condition, namely cutting plane A 6 and cutting plane B 7.

[0108] The normal vectors and center coordinates of the two circular sections obtained after cutting are two sets of feasible solutions of the characteristic circle in the new coordinate system.

[0109]

[0110]

[0111] (5) The two sets of feasible solutions are transformed from the standard coordinate system to the image acquisition device coordinate system. The result obtained in step (4) is multiplied by the rotation matrix P to obtain the spatial position of the characteristic circle relative to the image acquisition device coordinate system.

[0112] Set the normal vectors of the planes where the characteristic circles A and B are located to be The plane where the characteristic circle A lies is parallel to the plane where the characteristic circle B lies.

[0113] satisfy Where k refers to the ratio of the two vectors. Substituting into formula (8) and formula (9) can solve the actual posture parameters of the two characteristic circles A or B, which can be expressed as vector POSE = (X, Y, Z, α, β), where (X, Y, Z) T is the position vector of the center of the characteristic circle in the image acquisition device coordinate system, α, β are the attitude angles of the characteristic circle relative to the image acquisition device coordinate system,

[0114] The relative posture measurement method between the pipeline to be inspected and the fixed reference pipeline is as follows: 1) Before centering, the image acquisition device takes an image of the reference pipeline in the reference state. The reference image is acquired when the end face of the pipe mouth 1 is perpendicular to the optical axis of the industrial camera, and the pipe mouth characteristic circle is located in the middle of the image. The posture parameters of the pipe mouth characteristic circle in the reference state are calculated as the reference posture, and then the posture adjustment and centering are completed manually. The reference state posture adjustment and centering is equivalent to system calibration. Through the reference state posture adjustment and centering of the reference pipeline, the relative posture relationship among the camera, the reference state of the reference pipeline, and the pipeline to be inspected can be determined; 2) Take an image of the pipe mouth of the reference pipeline in the state to be inspected, and calculate the posture parameters of the reference pipeline in the state to be inspected. Since the posture parameters of the reference pipeline in the reference state and the state to be inspected are calculated in the same image acquisition device coordinate system, the posture change of the state to be inspected relative to the reference posture can be further solved.

[0115] According to a preferred embodiment of the present invention, when the image acquisition device acquires images of the pipeline to be inspected / reference pipeline, it is necessary to perform automatic exposure calculation on the image acquisition device, use the image entropy weighted image gradient as the image information measurement index, and adjust the camera exposure parameters by judging whether the two measurement values ​​of the image are optimal. When the two measurement values ​​reach the preset values, it is considered that the image acquisition device has obtained the optimal exposure parameters. At this time, the image acquisition device can acquire a well-exposed image.

[0116] According to a preferred embodiment of the present invention, a well-exposed image has sharp edges, is not blurred, and has low noise.

[0117] According to a preferred embodiment of the present invention, the adjustment of the pipeline to be inspected to the centered state adopts an automatic centering device, which includes an image acquisition device, a centering actuator, a motion control system, and an industrial computer.

[0118] An image acquisition device 12 is responsible for acquiring images of the pipeline to be inspected / reference pipeline;

[0119] The industrial computer is electrically connected to the image acquisition device 12, receives the image data of the image acquisition device 12, runs built-in control software in the industrial computer, and the control software calculates the relative position of the pipeline to be detected relative to the reference pipeline. The industrial computer sends a motion instruction according to the relative position of the pipeline to be detected relative to the reference pipeline.

[0120] The motion control system receives the motion command from the industrial computer and then controls the centering mechanism to perform the centering motion.

[0121] In another implementation scheme, the centering actuator can adjust the displacement of the pipeline in the X, Y, and Z directions and the deflection angle.

[0122] During the centering process, the pipeline to be tested 19 and the reference pipeline 11 are both placed on the V-shaped horizontal guide rail 18. The pitch angle adjustment amount of the reference pipeline is 0°.

[0123] The centering actuator includes a base 20, a linear slide 15, a lifting platform 14, a rotating platform 13, a V-shaped horizontal guide rail 18, a stopper 9, an extension rod 8 and a fixed seat 10. The base 20 is provided with a linear slide 15, and the linear slide 15 is provided with a lifting platform 14. The lifting platform 14 moves laterally along the linear slide 15 driven by a motor. The lifting platform 13 is provided on the lifting platform 14, and the rotating platform 13 is provided with two horizontal guide rails 18. The two V-shaped horizontal guide rails 18 are symmetrically formed as a whole, and a holding space for the pipeline to pass through is formed therebetween. A stopper 9 is installed at the front end of the extension rod 8, and the extension rod 8 is placed on the upper surface of the V-shaped horizontal guide rail. The fixed seat 10 is provided on the base 20, and the fixed seat 10 is used to place the reference pipeline 11. The image acquisition device 12 is also provided on the fixed seat 10.

[0124] The specific alignment process is as follows:

[0125] Preparation before centering: Place the pipe 6 to be tested in the accommodation space between the two V-shaped horizontal guide rails 18, and use a cylindrical head screw 17 to pass through the upper V-shaped horizontal guide rail 18 and abut against the surface of the pipe 19 to be tested, so as to fix the pipe 19 to be tested, and move the extension rod 8 with the stopper 9 facing downward to control the extension distance of the pipe 6 to be tested.

[0126] The reference pipe 11 is fixed on the fixing base 10, and the fixing base 10 is also provided with the image acquisition device 12.

[0127] During the centering process: the control software built into the industrial computer calculates the relative position of the pipeline to be tested relative to the reference pipeline, and the industrial computer sends motion instructions according to the relative position of the pipeline to be tested relative to the reference pipeline. The motion control system receives the motion instructions of the industrial computer and then controls the centering mechanism to perform the centering movement, that is, controls the lifting platform 14 to move up and down, the lifting platform 14 moves laterally along the linear slide 15, and the horizontal guide rail 18 rotates with the rotating platform 13, thereby controlling the pipeline to be tested 19 to move up and down, move horizontally and rotate, and realize its centering with the reference pipeline 11.

[0128] Although the embodiments of the present invention have been disclosed as above, they are not limited to the applications listed in the specification and the implementation modes, and they can be fully applied to various fields suitable for the present invention. For those familiar with the art, additional modifications can be easily implemented. Therefore, without departing from the general concept defined by the claims and the scope of equivalents, the present invention is not limited to the specific details and the illustrations shown and described herein.

Claims

1. A method for automatic pipe centering based on machine vision, used to align the ports of two pipes, where the ports of the pipes are inclined to form a single V-shaped groove, characterized in that: The automatic pipeline centering method based on machine vision comprises the following steps: Step 1: One of the two pipelines is used as a reference pipeline, and the other pipeline is used as a pipeline to be detected. An image acquisition device is used to acquire an image of the pipeline to be detected as an image to be detected; and an image acquisition device is used to acquire an image of the reference pipeline as a reference image; Step 2: extract the target ellipse from the reference image and the image to be detected respectively, and obtain the target ellipse of the reference image and the image to be detected, and calculate the pose of the target ellipse of the reference image and the image to be detected, and obtain the reference state pose and the state pose to be tested respectively; Step 3: Compare the reference state posture with the state posture to be tested, and calculate the relative posture of the pipeline to be tested relative to the reference pipeline; Step 4: According to the relative posture of the pipeline to be inspected relative to the reference pipeline, adjust the reference pipeline to the reference state according to the relative posture. Step 5: Determine whether the requirements are met. If the requirements are met, adjust the pipeline to be inspected to the centering state. If the requirements are not met, repeat steps 1 to 5 until the requirements are met, and then adjust the pipeline to be inspected to a centered state; In the step 2, target ellipse extraction is performed on the reference image and the image to be detected respectively, wherein the target ellipse extraction includes the following steps: The image is enhanced, filtered, edge detected, contour segmented, connected with common circular contours, fitted ellipse, and identified as a target ellipse, and finally the target ellipse is obtained; The image is enhanced using the Gamma transformation algorithm; The filtering process adopts a bilateral filtering algorithm; The fitting ellipse and target ellipse identification specifically include: firstly, screening to obtain a set of n arc segments according to the contour attributes of the ellipse arc, then dividing the ellipse arc segments belonging to the same curve edge into one group, fitting the ellipse parameters by using the grouped arc segment combination to obtain a set of candidate ellipses, and finally identifying the target ellipse from the set of candidate ellipses; In the step 2, the pose calculation of the target ellipse of the reference image and the image to be detected is specifically performed as follows: A. Take the inner circle and middle circle at the end of the pipe as two characteristic circles, namely characteristic circle A and characteristic circle B. In the image acquisition device coordinate system O c -X c Y c Z c Next, set the center coordinates G(X,Y,Z) and the normal vector of the plane where the characteristic circle is located. Among them, l, m, and n represent the coordinate values ​​of the normal vector, and the pose parameters of the characteristic circle are represented by the vector group [XYZ α β], where α is the pitch angle of the characteristic circle and β is the yaw angle of the characteristic circle; The values ​​of α and β are calculated according to formula (1): Furthermore, when l>0, m>0, α=arctan(m / l); When l<0, α=π+arctan(m / l); When l>0, m<0, α=2π+arctan(m / l); B. The projection of the characteristic circle on the camera imaging plane forms a projection ellipse, which is parallel to the optical center O of the image acquisition device. c Form an elliptical cone, find a plane in space so that it can be tangent to the cone surface of the elliptical cone to form a circle with a known radius. (1) In the image acquisition device coordinate system O c -X c Y c Z c The corresponding relationship between the coordinates (x, y, z) of any point on the elliptical cone and its projection point (u, v) on the camera imaging plane after imaging is: In the above formula, f is the focal length of the image acquisition device, g represents the projection ellipse of the characteristic circle projected on the camera imaging plane, (2) Find the coordinate system O of the image acquisition device c -X c Y c Z c The characteristic cone equation with the origin as the vertex and passing through the projection ellipse on the camera imaging plane is: Ax 2 +By 2 +Cxy+Dxz+Eyz+Fz 2 =0 (3) In the above formula, A = af 2 , B=bf 2 , C = cf 2 , D=df,E=ef,F=f, Among them, a, b, c, d, and e are the coefficients of the projection ellipse, and f is the focal length, which can be obtained by extracting the features of the projection ellipse. Assume that the projection ellipse equation of the pipe end face feature on the image is: au 2 +buv+cv 2 +du+ev+f=0(2-1), combining formula (2) and formula (2-1), we can get formula (3), The characteristic elliptical cone equation (3) is rewritten into a matrix form: [x i y i z i ]Q[x i y i z i ] T =0 (4) (3) Find a new coordinate system to transform the obtained characteristic cone elliptical cone into a standard elliptical cone, that is, the image acquisition device coordinate system O c -X c Y c Z c Z c The axis rotation is aligned with the rotation axis of the elliptical cone, and the new coordinate system is aligned with the image acquisition device coordinate system O c -X c Y c Z c The new coordinate system obtained by transformation is used as the standard coordinate system. The coordinates (x′, y′, z′) of any point in the standard coordinate system are the same as the coordinates of the point in the image acquisition device coordinate system O. c -X c Y c Z c The coordinates (x, y, z) below satisfy: [x y z] T =P[x′ y′ z′] T (6) In the above formula, P is the rotation transformation matrix, T is the matrix rank symbol, Substituting formula (6) into formula (4), the equation of the standard elliptical cone is: [x′ y′ z′]P T QP[x′ y′ z′] T =0 (7) Q is a 3×3 real symmetric matrix, so there must be P -1 QP=P T QP=diag(λ1,λ2,λ3), where λ1,λ2,λ3 are the eigenvalues ​​of the matrix Q, the rotation matrix P, The standard expression of the transformed elliptical cone is: λ1x′ 2 +λ2y′ 2 +λ3z′ 2 =0 (8) (4) In the new coordinate system, find that the section after cutting the standard elliptical cone is a standard circular plane with a radius of 1, and find that the section is a cutting plane with a radius of the characteristic circle and a radius of R. There are two cutting planes that meet this condition. The normal vectors and center coordinates of the two circular sections obtained after cutting are two sets of feasible solutions of the characteristic circle in the new coordinate system. (5) The two sets of feasible solutions are transformed from the standard coordinate system to the image acquisition device coordinate system. The result obtained in step (4) is multiplied by the rotation matrix P to obtain the spatial position of the characteristic circle relative to the image acquisition device coordinate system: Set the normal vectors of the planes where the characteristic circles A and B are located to be The plane where the characteristic circle A lies is parallel to the plane where the characteristic circle B lies. satisfy Where k refers to the ratio of the two vectors. Substituting into formula (9) and formula (10) can solve the actual posture parameters of the two characteristic circles A or B, which can be expressed as vector POSE = (X, Y, Z, α, β), where (X, Y, Z) T is the position vector of the center of the characteristic circle in the image acquisition device coordinate system, and α, β are the attitude angles of the characteristic circle relative to the image acquisition device coordinate system.

2. The automatic pipeline alignment method based on machine vision according to claim 1 is characterized in that: The automatic centering device is used to adjust the pipeline to be inspected to the centering state, which includes an image acquisition device, a centering actuator, a motion control system, and an industrial computer. Image acquisition equipment, responsible for acquiring images of the pipeline to be inspected / reference pipeline; The industrial computer is electrically connected to the image acquisition device, receives image data from the image acquisition device, runs built-in control software in the industrial computer, and the control software calculates the relative position of the pipeline to be detected relative to the reference pipeline. The industrial computer sends a motion instruction according to the relative position of the pipeline to be detected relative to the reference pipeline. The motion control system receives the motion command from the industrial computer and then controls the centering mechanism to perform the centering motion.

3. The automatic pipeline centering method based on machine vision according to claim 2 is characterized in that: During the alignment process, the pipe to be tested and the reference pipe are placed on V-shaped horizontal guide rails.

4. The automatic pipeline centering method based on machine vision according to claim 3 is characterized in that: The pitch adjustment of the reference pipe is 0°.

5. The automatic pipeline centering method based on machine vision according to claim 3 is characterized in that: The centering actuator can adjust the displacement of the pipeline in the X, Y and Z directions and the deflection angle.

Citation Information

Patent Citations

  • A weld joint visual positioning method based on multi-template matching

    CN109685758A

  • Visual detection method for poses and apertures of coplanar equal-size multi-pore workpieces

    CN111121655A

  • Pipeline quality detection device based on laser and industrial camera and method thereof

    CN112595244A

  • Pose recognition method, device and system for an object of interest to human eyes

    US20200311416A1