CN114119456A - Automatic pipeline centering method based on machine vision - Google Patents
Automatic pipeline centering method based on machine vision Download PDFInfo
- Publication number
- CN114119456A CN114119456A CN202111035416.3A CN202111035416A CN114119456A CN 114119456 A CN114119456 A CN 114119456A CN 202111035416 A CN202111035416 A CN 202111035416A CN 114119456 A CN114119456 A CN 114119456A
- Authority
- CN
- China
- Prior art keywords
- pipeline
- image
- detected
- circle
- coordinate system
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
- 238000000034 method Methods 0.000 title claims abstract description 32
- 239000011159 matrix material Substances 0.000 claims description 23
- 239000013598 vector Substances 0.000 claims description 23
- 238000003384 imaging method Methods 0.000 claims description 15
- 238000001914 filtration Methods 0.000 claims description 11
- 230000007246 mechanism Effects 0.000 claims description 8
- 230000009466 transformation Effects 0.000 claims description 8
- 230000008569 process Effects 0.000 claims description 7
- 238000012545 processing Methods 0.000 claims description 7
- 238000000605 extraction Methods 0.000 claims description 6
- 230000002146 bilateral effect Effects 0.000 claims description 4
- 230000003287 optical effect Effects 0.000 claims description 4
- 230000011218 segmentation Effects 0.000 claims description 4
- 238000006073 displacement reaction Methods 0.000 claims description 3
- 238000003708 edge detection Methods 0.000 claims description 3
- 238000012216 screening Methods 0.000 claims description 3
- 230000001131 transforming effect Effects 0.000 claims description 3
- 238000010276 construction Methods 0.000 abstract description 5
- 230000008859 change Effects 0.000 abstract description 3
- 238000004364 calculation method Methods 0.000 description 5
- 238000003466 welding Methods 0.000 description 4
- 238000010586 diagram Methods 0.000 description 2
- 238000005259 measurement Methods 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 230000004308 accommodation Effects 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 230000007547 defect Effects 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 238000007781 pre-processing Methods 0.000 description 1
- 238000002360 preparation method Methods 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/0002—Inspection of images, e.g. flaw detection
- G06T7/0004—Industrial image inspection
-
- G—PHYSICS
- G01—MEASURING; TESTING
- G01B—MEASURING LENGTH, THICKNESS OR SIMILAR LINEAR DIMENSIONS; MEASURING ANGLES; MEASURING AREAS; MEASURING IRREGULARITIES OF SURFACES OR CONTOURS
- G01B11/00—Measuring arrangements characterised by the use of optical techniques
-
- G—PHYSICS
- G01—MEASURING; TESTING
- G01C—MEASURING DISTANCES, LEVELS OR BEARINGS; SURVEYING; NAVIGATION; GYROSCOPIC INSTRUMENTS; PHOTOGRAMMETRY OR VIDEOGRAMMETRY
- G01C1/00—Measuring angles
-
- G—PHYSICS
- G05—CONTROLLING; REGULATING
- G05D—SYSTEMS FOR CONTROLLING OR REGULATING NON-ELECTRIC VARIABLES
- G05D3/00—Control of position or direction
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/10—Segmentation; Edge detection
- G06T7/13—Edge detection
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/10—Segmentation; Edge detection
- G06T7/181—Segmentation; Edge detection involving edge growing; involving edge linking
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/60—Analysis of geometric attributes
- G06T7/66—Analysis of geometric attributes of image moments or centre of gravity
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/70—Determining position or orientation of objects or cameras
- G06T7/73—Determining position or orientation of objects or cameras using feature-based methods
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T2207/00—Indexing scheme for image analysis or image enhancement
- G06T2207/10—Image acquisition modality
- G06T2207/10004—Still image; Photographic image
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T2207/00—Indexing scheme for image analysis or image enhancement
- G06T2207/30—Subject of image; Context of image processing
- G06T2207/30108—Industrial image inspection
Landscapes
- Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Theoretical Computer Science (AREA)
- Quality & Reliability (AREA)
- Radar, Positioning & Navigation (AREA)
- Remote Sensing (AREA)
- Automation & Control Theory (AREA)
- Geometry (AREA)
- Image Processing (AREA)
Abstract
The invention discloses a machine vision-based automatic pipeline centering method, which comprises the following steps: step one, taking one of the two pipelines as a reference pipeline and taking the other pipeline as a pipeline to be detected, and collecting an image to be detected and a reference image; secondly, extracting a target ellipse and calculating a pose to respectively obtain a reference state pose and a to-be-detected state pose; comparing the reference state pose with the state pose to be detected, and calculating to obtain the relative pose of the pipeline to be detected relative to the reference pipeline; and step four, adjusting the reference pipeline to a reference state according to the relative pose and the relative pose, step five, judging whether the requirements are met, if so, adjusting the pipeline to be detected to a centering state, and if not, repeating the step one to the step five until the requirements are met, and adjusting the pipeline to be detected to the centering state. The method has good adaptability to the change of the pipe diameter, and has high construction efficiency and high precision.
Description
Technical Field
The invention relates to the field of centering in a pipeline butt welding process. More particularly, the invention relates to a method for automatically centering a pipeline based on machine vision.
Background
In the pipeline butt welding process, the ports of the two pipelines need to be aligned firstly, then the butt circumferential surfaces are welded, and the butt quality directly influences the subsequent welding quality and the pipeline safety. At present, a manual aligning method is mainly adopted in a pipeline construction site, and in order to ensure aligning quality, workers need to use tools including a level bar (for checking levelness), simple cushion blocks (for supporting a pipeline to enable the pipeline to be on the same straight line during straightening), crowbars (for prying the pipeline and adjusting the posture of the pipeline) and the like. In addition, the pipeline aligning device is used for assisting in completing pipeline aligning welding on a construction site, and although the labor intensity can be reduced to a certain degree and the aligning precision is guaranteed as a special pipeline construction device, the pipeline aligning device is poor in adaptability to pipe diameter size change, which is an obvious defect.
Disclosure of Invention
To achieve these objects and other advantages and in accordance with the purpose of the invention, as embodied and broadly described herein, there is provided a machine vision based pipe automatic centering method for aligning ports of two pipes, the ports of the pipes being inclined to form a single V-groove, the machine vision based pipe automatic centering method comprising the steps of:
step one, taking one of the two pipelines as a reference pipeline and the other pipeline as a pipeline to be detected, and acquiring an image of the pipeline to be detected by using image acquisition equipment to serve as an image to be detected; acquiring an image of a reference pipeline by using image acquisition equipment as a reference image;
respectively extracting target ellipses of the reference image and the image to be detected, obtaining target ellipses of the reference image and the image to be detected, and calculating positions of the target ellipses of the reference image and the image to be detected to respectively obtain a reference state position and a position of the state to be detected;
comparing the reference state pose with the state pose to be detected, and calculating to obtain the relative pose of the pipeline to be detected relative to the reference pipeline;
step four, adjusting the reference pipeline to a reference state according to the relative pose of the pipeline to be detected relative to the reference pipeline and the relative pose,
step five, judging whether the requirements are met,
if the requirement is met, adjusting the pipeline to be detected to be in a centering state,
and if the requirement is not met, repeating the first step to the fifth step until the requirement is met, and adjusting the pipeline to be detected to be in a centering state.
According to a preferred embodiment of the present invention, in the second step, target ellipse extraction is performed on the reference image and the image to be detected, respectively, where the target ellipse extraction includes the following steps:
and sequentially carrying out enhancement processing, filtering processing, edge detection, contour segmentation, co-circle contour connection, ellipse fitting and target ellipse identification on the image to finally obtain a target ellipse.
According to a preferred embodiment of the present invention, the image is enhanced by using a Gamma transform algorithm.
According to a preferred embodiment of the present invention, the filtering process employs a bilateral filtering algorithm.
According to a preferred embodiment of the present invention, the fitting ellipse and the target ellipse identification specifically include that n arc line segment sets are obtained by screening according to the profile attributes of the elliptical arcs, then the elliptical arc segments belonging to the same curve edge are divided into 1 group, fitting of elliptical parameters is performed by using the grouped arc segment combinations to obtain candidate ellipse sets, and finally a target circle is identified from the candidate ellipse sets.
According to a preferred embodiment of the present invention, in the second step, the pose calculation for calculating the pose of the target ellipse of the reference image and the to-be-detected image specifically includes:
A. the inner circle and the middle circle at the port of the pipeline are taken as 2 characteristic circles which are respectively a characteristic circle A and a characteristic circle B,
in the image acquisition equipment coordinate system Oc-XcYcZcNext, the center coordinates G (X, Y, Z) and the normal vector of the plane of the characteristic circle are setWherein l, m and n represent coordinate values of normal vector, and the pose parameter of the feature circle is represented by vector group [ X Y Z alpha beta ] beta]Representing, wherein alpha is a pitch angle of the characteristic circle, and beta is a yaw angle of the characteristic circle;
the values of α, β are calculated according to equation (1):
further, when l > 0, m > 0, α ═ arctan (m/l);
when l < 0, α ═ π + arctan (m/l);
when l is more than 0 and m is less than 0, alpha is 2 pi + arctan (m/l);
B. the projection of the characteristic circle on the camera imaging plane forms a projection ellipse, and the projection ellipse and the optical center O of the image acquisition equipmentcForming an elliptic cone, finding a plane in space, making the plane tangent with the conical surface of the elliptic cone into a circle with a known radius,
(1) in the image acquisition equipment coordinate system Oc-XcYcZcNext, the corresponding relation between the coordinates (x, y, z) of any point on the elliptic cone and the projection point (u, v) projected 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 imaging plane of the camera,
(2) finding the coordinate system O of the image acquisition devicec-XcYcZcThe origin of (a) is the vertex and passes through the characteristic cone equation of the projection ellipse on the camera imaging plane:
Ax2+By2+Cxy+Dxz+Eyz+Fz2=0 (3)
in the above formula, A ═ af2,B=bf2,C=cf2,D=df,E=ef,F=f,
Wherein, a, b, c, d, e are the coefficient of the projection ellipse respectively, f is the focus, can be extracted by the characteristic of projection ellipse, and the projection ellipse equation of the pipeline end face characteristic on the image is assumed as: au is2+buv+cv2+ du + ev + f is 0(2-1), and equation (2) and equation (2-1) are combined to obtain equation (3),
the characteristic elliptic cone equation formula (3) is rewritten into a matrix form as follows:
[xi yi zi]Q[xi yi zi]T=0 (4)
(3) finding a new coordinate system, and rotationally transforming the obtained characteristic cone elliptical cone into a standard elliptical cone, namely a coordinate system O of the image acquisition equipmentc-XcYcZcZ of (A)cThe axis rotation is aligned with the rotation axis of the elliptic cone, and a new coordinate system is aligned with the coordinate system O of the image acquisition equipmentc-XcYcZcA common origin point, wherein the new coordinate system obtained by transformation is taken as a standard coordinate system, and the coordinates (x ', y ', z ') of any point on the standard coordinate system and the coordinate system O of the point on the image acquisition equipmentc-XcYcZcThe following coordinates (x, y, z) satisfy:
[x y z]T=P[x′ y′ z′]T (6)
in the above formula, P is a rotation matrix, a transformation matrix, T is a matrix rank symbol,
substituting equation (6) into equation (4) to obtain the equation of the standard elliptic cone:
[x′ y′ z′]PTQP[x′ y′ z′]T=0 (7)
q is a 3 × 3 real symmetric matrix, so that P must be present-1QP=PTQP=diag(λ1,λ2,λ3) Wherein λ is1,λ2,λ3The eigenvalues of matrix Q, rotation matrix P,
the standard expression of the transformed elliptic cone is as follows:
λ1x′2+λ2y′2+λ3z′2=0 (8)
(4) finding out standard circle plane with radius of 1 as tangent plane after cutting standard elliptic cone in new coordinate system, finding out cutting plane with radius of R as characteristic circle, and providing two cutting planes meeting the said condition,
two groups of feasible solutions of characteristic circles in a new coordinate system are normal vectors and circle center coordinates of two circular screenshots obtained after cutting
(5) Converting the two groups of feasible solutions from the standard coordinate system to the coordinate system of the image acquisition equipment, and multiplying the result obtained in the step (4) by the rotation matrix P to obtain the spatial pose of the characteristic circle relative to the coordinate system of the image acquisition equipment
Satisfy the requirement ofWhere k is the ratio of two vectors, and substituting into formula (8) and formula (9) can solve the actual attitude parameters of two characteristic circles a or B, and represent poss ═ X, Y, Z, α, β with the vectors, where (X, Y, Z)TIs the position vector of the center of the feature circle in the coordinate system of the image acquisition equipment, alpha and beta are attitude angles of the feature circle relative to the coordinate system of the image acquisition equipment,
according to a preferred embodiment of the present invention, when the image acquisition device acquires an image of a pipe to be detected/a reference pipe, automatic exposure calculation needs to be performed on the image acquisition device, an image entropy weighted image gradient is used as an image information measurement index, a camera exposure parameter is adjusted by judging whether two image metrics of the image are optimal, when the two metrics reach a preset value, the image acquisition device is considered to obtain an optimal exposure parameter, and at this time, the image acquisition device can acquire an image with good exposure. The well-exposed image is sharp, non-blurred and low-noise.
According to a preferred embodiment of the invention, the pipe to be tested is adjusted to a centering state by using an automatic centering device,
according to a preferred embodiment of the invention, during the centering, the pipe to be tested and the reference pipe are placed on the V-shaped horizontal guide rail. The pitch angle adjustment of the reference pipeline is 0 degree.
Which comprises an image acquisition device, a centering actuating mechanism, a motion control system and an industrial personal computer,
the image acquisition equipment is responsible for acquiring images of the pipeline to be detected/the reference pipeline;
the industrial personal computer is electrically connected with the image acquisition equipment, receives image data of the image acquisition equipment, runs built-in control software in the industrial personal computer, calculates the relative position of the pipeline to be detected relative to the reference pipeline by the control software, sends a motion instruction according to the relative position of the pipeline to be detected relative to the reference pipeline,
and the motion control system receives a motion command of the industrial personal computer and further controls the centering mechanism to execute centering motion.
According to a preferred embodiment of the present invention, the centering actuator can achieve adjustment of the direction displacement amount and the deflection angle of the duct X, Y, Z.
The invention at least comprises the following beneficial effects: the method has good adaptability to the change of the pipe diameter, and has high construction efficiency and high precision. The invention adopts the machine vision technology to measure the pose of the pipeline, adjusts the position and the pose of the pipeline according to the pose parameters, and adjusts the central axes of the two pipelines to be on the same straight line.
Additional advantages, objects, and features of the invention will be set forth in part in the description which follows and in part will become apparent to those having ordinary skill in the art upon examination of the following or may be learned from practice of the invention.
Drawings
FIG. 1 is a schematic flow chart of an automatic pipeline centering method according to the present invention;
fig. 2 is a schematic structural diagram of a pipe to be detected or a reference pipe in the invention.
Fig. 3 is schematic diagrams of two poses of the characteristic circle in the invention.
FIG. 4 is a two pose solution for the feature circle in the present invention.
Fig. 5 is a schematic structural view of the automatic centering device of the present invention.
Detailed Description
The present invention is further described in detail below with reference to the attached drawings so that those skilled in the art can implement the invention by referring to the description text.
The following description is presented to disclose the invention so as to enable any person skilled in the art to practice the invention. The preferred embodiments in the following description are given by way of example only, and other obvious variations will occur to those skilled in the art. The basic principles of the invention, as defined in the following description, may be applied to other embodiments, variations, modifications, equivalents, and other technical solutions without departing from the spirit and scope of the invention.
It will be understood by those skilled in the art that in the present disclosure, the terms "longitudinal," "lateral," "upper," "lower," "front," "rear," "left," "right," "vertical," "horizontal," "top," "bottom," "inner," "outer," and the like are used in an orientation or positional relationship indicated in the drawings for ease of description and simplicity of description, and do not indicate or imply that the referenced devices or components must be constructed and operated in a particular orientation and thus are not to be considered limiting.
It is understood that the terms "a" and "an" should be interpreted as meaning that a number of one element or element is one in one embodiment, while a number of other elements is one in another embodiment, and the terms "a" and "an" should not be interpreted as limiting the number.
As shown in fig. 1 to 5, the present invention relates to a method for automatically centering a pipe based on machine vision, which is used for aligning ports of two pipes, wherein the ports of the pipes are inclined to form a single V-groove, and the method for automatically centering a pipe based on machine vision comprises the following steps:
step one, taking one of the two pipelines as a reference pipeline and the other pipeline as a pipeline to be detected, and acquiring an image of the pipeline to be detected by using image acquisition equipment to serve as an image to be detected; acquiring an image of a reference pipeline by using image acquisition equipment as a reference image;
respectively extracting target ellipses of the reference image and the image to be detected, obtaining target ellipses of the reference image and the image to be detected, and calculating positions of the target ellipses of the reference image and the image to be detected to respectively obtain a reference state position and a position of the state to be detected;
comparing the reference state pose with the state pose to be detected, and calculating to obtain the relative pose of the pipeline to be detected relative to the reference pipeline;
step four, adjusting the reference pipeline to a reference state according to the relative pose of the pipeline to be detected relative to the reference pipeline and the relative pose,
step five, judging whether the requirements are met,
if the requirement is met, adjusting the pipeline to be detected to be in a centering state,
and if the requirement is not met, repeating the first step to the fifth step until the requirement is met, and adjusting the pipeline to be detected to be in a centering state.
According to a preferred embodiment of the present invention, in the second step, target ellipse extraction is performed on the reference image and the image to be detected, respectively, where the target ellipse extraction includes the following steps:
and sequentially carrying out enhancement processing, filtering processing, edge detection, contour segmentation, co-circle contour connection, ellipse fitting and target ellipse identification on the image to finally obtain a target ellipse.
The Gamma transformation algorithm is adopted to enhance the image, so that the influence of uneven brightness of the image can be improved, and the contrast of the image is improved.
And filtering processing is carried out by adopting a bilateral filtering algorithm, image denoising is carried out, and the noise of the image can be removed on the basis of keeping the edge of the image by adopting the bilateral filtering algorithm. Image enhancement and image filtering are image preprocessing links. And detecting the imaged elliptical contour of the characteristic circle by using a Canny operator, and acquiring the sub-pixel coordinates of the contour point by using a polynomial fitting method. The contour segmentation is to segment the obtained image contour into straight lines and elliptical arcs. Connecting the co-circular profiles: the method comprises the steps of firstly screening n arc line segment sets according to the outline attributes of the elliptical arcs to obtain elliptical arc segment sets, then dividing elliptical arc segments belonging to the same curve edge into 1 group, utilizing the grouped arc segment combinations to perform fitting of elliptical parameters to obtain candidate elliptical sets, and finally identifying a target ellipse from the candidate elliptical sets.
In another embodiment, the pose calculation for the pose calculation of the target ellipses of the reference image and the to-be-detected image specifically includes:
A. the inner circle and the middle circle at the port of the pipeline are taken as 2 characteristic circles, namely a characteristic circle A1 and a characteristic circle B2, the port of the pipeline is inclined to form a single V-shaped groove 3,
in the image acquisition equipment coordinate system Oc-XcYcZcNext, the center coordinates G (X, Y, Z) of the circle and the normal vector of the plane 5 where the characteristic circle is located are setWherein l, m and n represent coordinate values of normal vector, and the pose parameter of the feature circle is represented by vector group [ X Y Z alpha beta ] beta]Representing, wherein alpha is a pitch angle of the characteristic circle, and beta is a yaw angle of the characteristic circle;
the values of α, β are calculated according to equation (1):
further, when l > 0, m > 0, α ═ arctan (m/l);
when l < 0, α ═ π + arctan (m/l);
when l is more than 0 and m is less than 0, alpha is 2 pi + arctan (m/l);
B. the projection of the characteristic circle on the camera imaging plane forms a projection ellipse, and the projection ellipse and the optical center O of the image acquisition equipmentcForming an elliptic cone, finding a plane in space, making the plane tangent with the conical surface of the elliptic cone into a circle with a known radius,
(1) in the image acquisition equipment coordinate system Oc-XcYcZcNext, the corresponding relationship between the coordinates (x, y, z) of any point on the elliptic cone and the projection point (u, v) projected on the camera imaging plane 4 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 4,
(2) finding the coordinate system O of the image acquisition devicec-XcYcZcThe origin of (a) is the vertex and passes through the characteristic cone equation of the projection ellipse on the camera imaging plane:
Ax2+By2+Cxy+Dxz+Eyz+Fz2=0 (3)
in the above formula, A ═ af2,B=bf2,C=cf2,D=df,E=ef,F=f,
Wherein, a, b, c, d, e are the coefficient of the projection ellipse respectively, f is the focus, can be extracted by the characteristic of projection ellipse, and the projection ellipse equation of the pipeline end face characteristic on the image is assumed as: au is2+buv+cv2+ du + ev + f is 0(2-1), and equation (2) and equation (2-1) are combined to obtain equation (3),
the characteristic elliptic cone equation formula (3) is rewritten into a matrix form as follows:
[xi yi zi]Q[xi yi zi]T=0 (4)
(3) finding a new coordinate system, and rotationally transforming the obtained characteristic cone elliptical cone into a standard elliptical cone, namely a coordinate system O of the image acquisition equipmentc-XcYcZcZ of (A)cThe axis rotation is aligned with the rotation axis of the elliptic cone, and a new coordinate system and image acquisition are realizedSet of equipment coordinates Oc-XcYcZcA common origin point, wherein the new coordinate system obtained by transformation is taken as a standard coordinate system, and the coordinates (x ', y ', z ') of any point on the standard coordinate system and the coordinate system O of the point on the image acquisition equipmentc-XcYcZcThe following coordinates (x, y, z) satisfy:
[x y z]T=P[x′ y′ z′]T (6)
in the above formula, P is a rotation matrix, a transformation matrix, T is a matrix rank symbol,
substituting equation (6) into equation (4) to obtain the equation of the standard elliptic cone:
[x′ y′ z′]PTQP[x′ y′ z′]T=0 (7)
q is a 3 × 3 real symmetric matrix, so that P must be present-1QP=PTQP=diag(λ1,λ2,λ3) Wherein λ1,λ2,λ3The eigenvalues of matrix Q, rotation matrix P,
the standard expression of the transformed elliptic cone is as follows:
λ1x′2+λ2y′2+λ3z′2=0 (8)
(4) finding out standard circle plane with radius of 1 as tangent plane after cutting standard elliptic cone in new coordinate system, finding out cutting plane with radius of R as characteristic circle, and setting two cutting planes in the condition as cutting plane A6 and cutting plane B7,
two groups of feasible solutions of characteristic circles in a new coordinate system are normal vectors and circle center coordinates of two circular screenshots obtained after cutting
(5) And (4) converting the two groups of feasible solutions from the standard coordinate system to the coordinate system of the image acquisition equipment, and multiplying the result obtained in the step (4) by the rotation matrix P to obtain the spatial pose of the characteristic circle relative to the coordinate system of the image acquisition equipment.
Setting the normal vectors of the planes of the characteristic circle A and the characteristic circle B asThe plane of the characteristic circle A is parallel to the plane of the characteristic circle B,
satisfy the requirement ofWhere k is the ratio of two vectors, and substituting into formula (8) and formula (9) can solve the actual attitude parameters of two characteristic circles a or B, and represent poss ═ X, Y, Z, α, β with the vectors, where (X, Y, Z)TIs the position vector of the center of the feature circle in the coordinate system of the image acquisition equipment, alpha and beta are attitude angles of the feature circle relative to the coordinate system of the image acquisition equipment,
the method for measuring the relative pose between the pipeline to be detected and the fixed reference pipeline comprises the following steps: 1) before centering, the image acquisition equipment shoots an image when a reference pipeline is in a reference state, the reference image is acquired when the end surface of the pipe orifice 1 is perpendicular to the optical axis of the industrial camera, the pipe orifice characteristic circle is located in the middle of the image, the pose parameter of the pipe orifice characteristic circle in the reference state is calculated to be used as a reference pose, then manual pose alignment is completed, the reference state pose alignment is equivalent to system calibration, and the relative pose relationship among the camera, the reference pipeline and the pipeline to be detected can be determined through the reference state pose alignment of the reference pipeline; 2) and shooting the pipe orifice image of the reference pipeline in the state to be detected, and calculating the pose parameter of the reference pipeline in the state to be detected. Because the pose parameters of the reference pipeline in the reference state and the to-be-detected state are solved and calculated in the same image acquisition equipment coordinate system, the pose variation of the to-be-detected state relative to the reference pose can be continuously solved.
According to a preferred embodiment of the present invention, when the image acquisition device acquires an image of a pipe to be detected/a reference pipe, automatic exposure calculation needs to be performed on the image acquisition device, an image entropy weighted image gradient is used as an image information measurement index, a camera exposure parameter is adjusted by judging whether two image metrics of the image are optimal, when the two metrics reach a preset value, the image acquisition device is considered to obtain an optimal exposure parameter, and at this time, the image acquisition device can acquire an image with good exposure.
According to a preferred embodiment of the present invention, a well-exposed image is a sharp, non-blurred, low-noise image.
According to a preferred embodiment of the invention, the pipeline to be detected is adjusted to be in a centering state by adopting an automatic centering device which comprises image acquisition equipment, a centering executing mechanism, a motion control system and an industrial personal computer,
the image acquisition equipment 12 is responsible for acquiring images of the pipeline to be detected/the reference pipeline;
the industrial personal computer is electrically connected with the image acquisition equipment 12, receives the image data of the image acquisition equipment 12, runs built-in control software in the industrial personal computer, calculates the relative position of the pipeline to be detected relative to the reference pipeline by the control software, sends a motion instruction according to the relative position of the pipeline to be detected relative to the reference pipeline,
and the motion control system receives a motion command of the industrial personal computer and further controls the centering mechanism to execute centering motion.
In another embodiment, the centering actuator can realize the adjustment of the direction displacement amount and the adjustment of the deflection angle of the pipeline X, Y, Z.
During the centering process, the pipe to be tested 19 and the reference pipe 11 are both placed on the V-shaped horizontal guide rail 18. The pitch angle adjustment of the reference pipeline is 0 degree.
Centering actuating mechanism includes base 20, sharp slip table 15, lift platform 14, rotary platform 13, V type horizontal guide 18, dog 9, extension rod 8 and fixing base 10, establish sharp slip table 15 on the base 20, set up lift platform 14 on sharp slip table 15, lift platform 14 is driven down along sharp slip table 15 lateral shifting at the motor, be provided with rotary platform 13 on lift platform 14, be provided with two horizontal guide 18 on rotary platform 13, two V type horizontal guide 18 longitudinal symmetry form wholly, form the accommodation space that supplies the pipeline to pass through between the two, dog 9 is installed to 8 front ends of extension rod, extension rod 8 places the V type horizontal guide upper surface in the top, fixing base 10 sets up on base 20, be used for placing benchmark pipeline 11 on fixing base 10, still set up on fixing base 10 image acquisition equipment 12.
The specific centering process is as follows:
preparation before centering: the pipeline 6 to be detected is placed in the accommodating space between the two V-shaped horizontal guide rails 18, the cylindrical head screw 17 penetrates through the V-shaped horizontal guide rail 18 above the accommodating space to abut against the surface of the pipeline 19 to be detected, so that the pipeline 19 to be detected is fixed, the extension rod 8 is moved, and the stop block 9 faces downwards to control the extending distance of the pipeline 6 to be detected.
The reference pipeline 11 is fixedly placed on the fixed seat 10, the image acquisition equipment 12 is also arranged on the fixed seat 10,
in the centering process: the relative position and posture of the pipeline to be detected relative to the reference pipeline are calculated by control software built in the industrial personal computer, the industrial personal computer sends a motion instruction according to the relative position and posture of the pipeline to be detected relative to the reference pipeline, a motion control system receives the motion instruction of the industrial personal computer and then controls the centering mechanism to perform centering motion, namely controls the lifting platform 14 to lift up and down, the lifting platform 14 moves transversely along the linear sliding table 15, the horizontal guide rail 18 rotates along with the rotating platform 13, and then the pipeline to be detected 19 is controlled to move up and down, move horizontally and rotate, and centering with the reference pipeline 11 is achieved.
While embodiments of the invention have been described above, it is not limited to the applications set forth in the description and the embodiments, which are fully applicable in various fields of endeavor to which the invention pertains, and further modifications may readily be made by those skilled in the art, it being understood that the invention is not limited to the details shown and described herein without departing from the general concept defined by the appended claims and their equivalents.
Claims (10)
1. A machine vision-based automatic pipeline centering method is used for aligning ports of two pipelines, and the ports of the pipelines are inclined to form a single V-shaped groove, and is characterized by comprising the following steps:
step one, taking one of the two pipelines as a reference pipeline and the other pipeline as a pipeline to be detected, and acquiring an image of the pipeline to be detected by using image acquisition equipment to serve as an image to be detected; acquiring an image of a reference pipeline by using image acquisition equipment as a reference image;
respectively extracting target ellipses of the reference image and the image to be detected, obtaining target ellipses of the reference image and the image to be detected, and calculating positions of the target ellipses of the reference image and the image to be detected to respectively obtain a reference state position and a position of the state to be detected;
comparing the reference state pose with the state pose to be detected, and calculating to obtain the relative pose of the pipeline to be detected relative to the reference pipeline;
step four, adjusting the reference pipeline to a reference state according to the relative pose of the pipeline to be detected relative to the reference pipeline and the relative pose,
step five, judging whether the requirements are met,
if the requirement is met, adjusting the pipeline to be detected to be in a centering state,
and if the requirement is not met, repeating the first step to the fifth step until the requirement is met, and adjusting the pipeline to be detected to be in a centering state.
2. The automatic pipeline centering method based on machine vision according to claim 1, wherein in the second step, target ellipse extraction is respectively performed on the reference image and the image to be detected, wherein the target ellipse extraction comprises the following steps:
and sequentially carrying out enhancement processing, filtering processing, edge detection, contour segmentation, co-circle contour connection, ellipse fitting and target ellipse identification on the image to finally obtain a target ellipse.
3. The method of claim 2, wherein the image is enhanced by a Gamma transformation algorithm.
4. The method of claim 2, wherein the filtering process employs a bilateral filtering algorithm.
5. The automatic pipeline centering method based on machine vision as claimed in claim 2, wherein the fitting ellipse and target ellipse identification specifically includes that n arc line segment sets are obtained through screening according to the outline attributes of the ellipse arcs, then the ellipse arc segments belonging to the same curve edge are divided into 1 group, fitting of ellipse parameters is performed by using the grouped arc segment combinations to obtain candidate ellipse sets, and finally the target ellipse is identified from the candidate ellipse sets.
6. The method of claim 1, wherein the second step of calculating the pose of the target ellipse of the reference image or the image to be detected includes:
A. the inner circle and the middle circle at the port of the pipeline are taken as 2 characteristic circles which are respectively a characteristic circle A and a characteristic circle B,
in the image acquisition equipment coordinate system Oc-XcYcZcNext, the center coordinates G (X, Y, Z) and the normal vector of the plane of the characteristic circle are setWherein l, m and n represent coordinate values of normal vector, and the pose parameter of the feature circle is represented by vector group [ X Y Z alpha beta ] beta]Representing, wherein alpha is a pitch angle of the characteristic circle, and beta is a yaw angle of the characteristic circle;
the values of α, β are calculated according to equation (1):
further, when l > 0, m > 0, α ═ arctan (m/l);
when l < 0, α ═ π + arctan (m/l);
when l is more than 0 and m is less than 0, alpha is 2 pi + arctan (m/l);
B. the projection of the characteristic circle on the camera imaging plane forms a projection ellipse, and the projection ellipse and the optical center O of the image acquisition equipmentcForming an elliptic cone, finding a plane in space, making the plane tangent with the conical surface of the elliptic cone into a circle with a known radius,
(1) in the image acquisition equipment coordinate system Oc-XcYcZcNext, the corresponding relation between the coordinates (x, y, z) of any point on the elliptic cone and the projection point (u, v) projected 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 imaging plane of the camera,
(2) finding the coordinate system O of the image acquisition devicec-XcYcZcThe origin of (a) is the vertex and passes through the characteristic cone equation of the projection ellipse on the camera imaging plane:
Ax2+By2+Cxy+Dxz+Eyz+Fz2=0 (3)
in the above formula, A ═ af2,B=bf2,C=cf2,D=df,E=ef,F=f,
Wherein, a, b, c, d, e are the coefficient of the projection ellipse respectively, f is the focus, can be extracted by the characteristic of projection ellipse, and the projection ellipse equation of the pipeline end face characteristic on the image is assumed as: au is2+buv+cv2+du+ev+f=0(2-1) The formula (3) can be obtained by simultaneously establishing the formula (2) and the formula (2-1),
the characteristic elliptic cone equation formula (3) is rewritten into a matrix form as follows:
[xi yi zi]Q[xi yi zi]T=0 (4)
(3) finding a new coordinate system, and rotationally transforming the obtained characteristic cone elliptical cone into a standard elliptical cone, namely a coordinate system O of the image acquisition equipmentc-XcYcZcZ of (A)cThe axis rotation is aligned with the rotation axis of the elliptic cone, and a new coordinate system is aligned with the coordinate system O of the image acquisition equipmentc-XcYcZcA common origin point, wherein the new coordinate system obtained by transformation is taken as a standard coordinate system, and the coordinates (x ', y ', z ') of any point on the standard coordinate system and the coordinate system O of the point on the image acquisition equipmentc-XcYcZcThe following coordinates (x, y, z) satisfy:
[x y z]T=P[x′ y′ z′]T (6)
in the above formula, P is a rotation transformation matrix, T is a matrix rank symbol,
substituting equation (6) into equation (4) to obtain the equation of the standard elliptic cone:
[x′ y′ z′]PTQP[x′ y′ z′]T=0 (7)
q is a 3 × 3 real symmetric matrix, so that P must be present-1QP=PTQP=diag(λ1,λ2,λ3) Wherein λ is1,λ2,λ3The eigenvalues of matrix Q, rotation matrix P,
the standard expression of the transformed elliptic cone is as follows:
λ1x′2+λ2y′2+λ3z′2=0 (8)
(4) finding out standard circle plane with radius of 1 as tangent plane after cutting standard elliptic cone in new coordinate system, finding out cutting plane with radius of R as characteristic circle, and providing two cutting planes meeting the said condition,
two groups of feasible solutions of characteristic circles in a new coordinate system are normal vectors and circle center coordinates of two circular screenshots obtained after cutting
(5) And (4) converting the two groups of feasible solutions from the standard coordinate system to the coordinate system of the image acquisition equipment, and multiplying the result obtained in the step (4) by the rotation matrix P to obtain the spatial pose of the characteristic circle relative to the coordinate system of the image acquisition equipment.
Setting the normal vectors of the planes of the characteristic circle A and the characteristic circle B asThe plane of the characteristic circle A is parallel to the plane of the characteristic circle B,
satisfy the requirement ofWhere k is the ratio of two vectors, and substituting into formula (8) and formula (9) can solve the actual attitude parameters of two characteristic circles a or B, and represent poss ═ X, Y, Z, α, β with the vectors, where (X, Y, Z)TIs the position vector of the center of the feature circle in the coordinate system of the image acquisition equipment, and alpha and beta are attitude angles of the feature circle relative to the coordinate system of the image acquisition equipment.
7. The automatic pipeline centering method based on machine vision according to any one of claims 1 to 6, characterized in that the pipeline to be detected is adjusted to a centering state by adopting an automatic centering device which comprises an image acquisition device, a centering execution mechanism, a motion control system and an industrial personal computer,
the image acquisition equipment is responsible for acquiring images of the pipeline to be detected/the reference pipeline;
the industrial personal computer is electrically connected with the image acquisition equipment, receives image data of the image acquisition equipment, runs built-in control software in the industrial personal computer, calculates the relative position of the pipeline to be detected relative to the reference pipeline by the control software, sends a motion instruction according to the relative position of the pipeline to be detected relative to the reference pipeline,
and the motion control system receives a motion command of the industrial personal computer and further controls the centering mechanism to execute centering motion.
8. The machine-vision-based pipe automatic centering method according to claim 7, wherein during centering, the pipe to be tested and the reference pipe are both placed on the V-shaped horizontal guide rail.
9. The machine-vision-based pipe automatic centering method of claim 8, wherein the pitch angle adjustment amount of the reference pipe is 0 °.
10. The method of claim 8, wherein the centering actuator is capable of adjusting the direction displacement and the deflection angle of the pipeline X, Y, Z.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202111035416.3A CN114119456B (en) | 2021-09-02 | 2021-09-02 | Automatic pipeline centering method based on machine vision |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202111035416.3A CN114119456B (en) | 2021-09-02 | 2021-09-02 | Automatic pipeline centering method based on machine vision |
Publications (2)
Publication Number | Publication Date |
---|---|
CN114119456A true CN114119456A (en) | 2022-03-01 |
CN114119456B CN114119456B (en) | 2024-08-23 |
Family
ID=80441251
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202111035416.3A Active CN114119456B (en) | 2021-09-02 | 2021-09-02 | Automatic pipeline centering method based on machine vision |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN114119456B (en) |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114674249A (en) * | 2022-03-28 | 2022-06-28 | 上海大学 | Visual measurement guiding device, method and system for barrel nesting assembly centering |
CN114888559A (en) * | 2022-05-09 | 2022-08-12 | 中煤科工集团重庆研究院有限公司 | Pipeline center alignment method for auxiliary installation machinery of mining pipeline |
CN115379129A (en) * | 2022-08-19 | 2022-11-22 | 广州虎牙信息科技有限公司 | Exposure processing method, device, equipment and readable storage medium |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109685758A (en) * | 2018-10-29 | 2019-04-26 | 中国化学工程第六建设有限公司 | Weld seam vision positioning method based on multi-template matching |
CN111121655A (en) * | 2019-12-18 | 2020-05-08 | 浙江大学 | Visual detection method for pose and aperture of coplanar workpiece with equal large hole patterns |
US20200311416A1 (en) * | 2019-03-29 | 2020-10-01 | Huazhong University Of Science And Technology | Pose recognition method, device and system for an object of interest to human eyes |
CN112595244A (en) * | 2020-12-02 | 2021-04-02 | 常州信息职业技术学院 | Pipeline quality detection device and method based on laser and industrial camera |
-
2021
- 2021-09-02 CN CN202111035416.3A patent/CN114119456B/en active Active
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109685758A (en) * | 2018-10-29 | 2019-04-26 | 中国化学工程第六建设有限公司 | Weld seam vision positioning method based on multi-template matching |
US20200311416A1 (en) * | 2019-03-29 | 2020-10-01 | Huazhong University Of Science And Technology | Pose recognition method, device and system for an object of interest to human eyes |
CN111121655A (en) * | 2019-12-18 | 2020-05-08 | 浙江大学 | Visual detection method for pose and aperture of coplanar workpiece with equal large hole patterns |
CN112595244A (en) * | 2020-12-02 | 2021-04-02 | 常州信息职业技术学院 | Pipeline quality detection device and method based on laser and industrial camera |
Non-Patent Citations (1)
Title |
---|
魏振忠;赵征;张广军;: "空间圆姿态识别二义性的角度约束消除", 光学精密工程, no. 03, 15 March 2010 (2010-03-15) * |
Cited By (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114674249A (en) * | 2022-03-28 | 2022-06-28 | 上海大学 | Visual measurement guiding device, method and system for barrel nesting assembly centering |
CN114674249B (en) * | 2022-03-28 | 2023-02-07 | 上海大学 | Visual measurement guiding device, method and system for barrel nesting assembly centering |
WO2023185550A1 (en) * | 2022-03-28 | 2023-10-05 | 上海大学绍兴研究院 | Visual measurement guiding device, method and system for cylinder nested assembly centering |
CN114888559A (en) * | 2022-05-09 | 2022-08-12 | 中煤科工集团重庆研究院有限公司 | Pipeline center alignment method for auxiliary installation machinery of mining pipeline |
CN115379129A (en) * | 2022-08-19 | 2022-11-22 | 广州虎牙信息科技有限公司 | Exposure processing method, device, equipment and readable storage medium |
Also Published As
Publication number | Publication date |
---|---|
CN114119456B (en) | 2024-08-23 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN114119456A (en) | Automatic pipeline centering method based on machine vision | |
CN110421562B (en) | Mechanical arm calibration system and calibration method based on four-eye stereoscopic vision | |
CN111775146B (en) | Visual alignment method under industrial mechanical arm multi-station operation | |
US9091528B2 (en) | System and method for object measurement | |
CN104266608B (en) | Field calibration device for visual sensor and calibration method | |
CN105352975B (en) | A kind of bridge cable appearance detecting method | |
CN108833912A (en) | A kind of measurement method and system of video camera machine core optical axis center and field angle | |
CN114674249B (en) | Visual measurement guiding device, method and system for barrel nesting assembly centering | |
CN106056603A (en) | Stereoscopic vision-based welding execution parameter on-line detection method | |
CN106996748A (en) | Wheel diameter measuring method based on binocular vision | |
EP3774106B1 (en) | Method and apparatus for controlling a process for curving elongated pieces and roller curving machine | |
TWI493153B (en) | Non-contact measurement device and method for object space information and the method thereof for computing the path from capturing the image | |
CN113146172A (en) | Multi-vision-based detection and assembly system and method | |
CN113516716B (en) | Monocular vision pose measuring and adjusting method and system | |
CN115880296B (en) | Machine vision-based prefabricated part quality detection method and device | |
CN106289678B (en) | A kind of bent detection device of cylindrical body abnormity drum and recognition methods | |
JP7353757B2 (en) | Methods for measuring artifacts | |
CN109447971A (en) | A kind of cycloid gear molded line error is accurately extracted and crucial accuracy of form and position rapid analysis method | |
CN104966302B (en) | A kind of detection localization method of any angle laser cross | |
CN116402792A (en) | Space hole site butt joint method based on three-dimensional point cloud | |
CN115014217A (en) | Pipe online detection method based on laser ranging | |
CN113066063B (en) | Optical fiber to-be-aligned end image processing method and optical fiber self-adaptive alignment method | |
CN114113115A (en) | High-precision automatic positioning method for micro-defects on surface of large-diameter element | |
CN109773589A (en) | Method and device, the equipment of on-line measurement and processing guiding are carried out to workpiece surface | |
Fan et al. | An initial point alignment method of narrow weld using laser vision sensor |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |