High-precision detection and positioning method for pipe end of catheter

文档序号:9397 发布日期:2021-09-17 浏览:32次 中文

1. A high-precision detection and positioning method for end faces of a conduit is characterized by comprising the following steps:

step 1: performing multi-view visual calibration on an industrial camera to obtain internal parameters and external parameters of the camera;

step 2: synchronously triggering a camera 1 and a camera 2 to acquire 2 original conduit end face images respectively;

and step 3: respectively carrying out sub-pixel precision processing on the two images, and respectively obtaining edge coordinates of a projection ellipse of the end face of the conduit;

and 4, step 4: according to the internal and external parameters of the camera, epipolar constraint and sequence consistency rules, finding out a corresponding matching point of the edge coordinate of the end face projection ellipse of one of the conduits in the other image;

and 5: reconstructing three-dimensional space coordinate point clouds of all matching points by using the calibrated space position relation between binocular vision and a stereoscopic vision three-dimensional measurement model;

step 6: removing outliers from the three-dimensional space coordinate point cloud of the matching points by using a Randac algorithm, and using the remaining points as initial values of a point cloud fitting circle;

and 7: establishing an objective function of the point cloud fitting circle, wherein the objective function comprises: the distance between all points on the point cloud and a plane formed by the point cloud fitting circle and the distance between all points on the point cloud and the point cloud fitting circle center;

and 8: carrying out linearization processing on a target function of the point cloud fitting circle;

and step 9: and calculating a fitting space circle with the objective function being zero by using a least square method to serve as the positioning of the end surface of the conduit.

2. The method for detecting and positioning the pipe end of the catheter in high precision according to claim 1, wherein the internal parameters are a transformation matrix from an industrial camera coordinate system to an image coordinate system, the external parameters are a transformation matrix from a camera coordinate system to a world coordinate system, and the world coordinate system is used for the subsequent actual control point coordinate output.

3. The method for detecting and positioning the end of a catheter tube with high precision as claimed in claim 2, wherein the internal parameters of each industrial camera are calibrated by using a two-dimensional flexible target.

4. The method for detecting and positioning the end of a catheter tube with high precision as claimed in claim 2, wherein the external parameters are realized by a rotation matrix R and a translation matrix T.

5. The method for detecting and positioning the end of a catheter with high precision as claimed in claim 2, wherein the catheter is placed on a backlight plate, and the images taken by the camera 1 and the camera 2 are the same end face image of the catheter under different view angles.

6. The method for detecting and positioning the end of a conduit pipe with high precision according to claim 1, wherein the stereoscopic three-dimensional model comprises:

the stereoscopic vision three-dimensional model is represented as follows:

wherein (x)i,yi,zi) For the reconstructed three-dimensional spatial coordinate point pi(X) of (C)1i,Y1i) For an image edge point l under the camera 1iCoordinate (x)2i,y2i) For an image edge point q under camera 2iCoordinate, fm、fnFocal ratio of camera 1 and camera 2, transformation matrix R between camera 1 and camera 2, respectively12Is composed of

Thus (r)1,r2,r3,r7,r8,r9,t1,t2,t3) For transforming the matrix R12The parameter value of (2).

7. The method for detecting and positioning the end of a catheter tube with high precision as claimed in claim 1, wherein the center of the point cloud is the centroid of all points on the point cloud, the radius of the circle is the average distance from all points on the point cloud to the centroid, and the normal vector of the plane where the circle is fitted is obtained by fitting the normal vector of the plane to all points on the point cloud.

8. The method for detecting and positioning the end of a catheter tube with high precision according to claim 1, wherein the objective function f is as follows:

wherein n is the number of points contained in the point cloud, (a)0,b0,c0,d0) Is the normal vector of the plane of the fitted circle, (x)0,y0,z0) Is the centroid of all points in the point cloud, (x)i,yi,zi) Is any point on the point cloud. r is0Is the radius of the fitted circle.

Background

The conduit end refers to the center point of the end face of the pipeline. Before the pipeline is assembled, the relative position precision of the central point of the end face of the pipeline is the key for ensuring the accurate installation of the pipeline. However, the pipe can be elastically deformed during the bending process of the pipe bender, so that the positions and distances of the end points at the two ends of the pipe are changed, and the assembly is affected, so that the pipe end of the pipe needs to be measured with high precision to ensure stress-free assembly.

At present, the measurement mode of the formed bent pipe is mainly contact type, such as a mode-dependent method, a three-coordinate measuring machine, an articulated coordinate measuring machine and the like, and the methods have the defects that the manufacturing of a comparison device is difficult, damage or deformation is easily caused, the efficiency is low, the subjective judgment of an operator is excessively relied, a three-dimensional model cannot be reconstructed, no positioning reference exists and the like. Therefore, how to effectively shorten the development time, reduce the development cost and improve the product quality is the main purpose of fast processing and manufacturing the bent pipe.

The traditional method for fitting the tail end profile is to perform ellipse fitting on the projection of the tail end of the conduit, and when the pipe diameter is small, the projection of the tail end of the pipeline cannot fit the ellipse, which brings large positioning errors.

In the 'multi-vision-based pipeline endpoint coordinate measurement method research', the sun peng et al uses projection gradient to combine a fitted contour with an endpoint positioning method of a central line to calculate the catheter endpoints at different angles, but the calculated endpoint precision is poor.

Disclosure of Invention

Aiming at the defects in the prior art, the technical problem to be solved by the invention is to provide the high-precision detection method for the end of the conduit.

The technical scheme adopted by the invention for realizing the purpose is as follows: the high-precision detection and positioning method for the end face of the conduit comprises the following steps:

step 1: performing multi-view visual calibration on an industrial camera to obtain internal parameters and external parameters of the camera;

step 2: synchronously triggering a camera 1 and a camera 2 to acquire 2 original conduit end face images respectively;

and step 3: respectively carrying out sub-pixel precision processing on the two images, and respectively obtaining edge coordinates of a projection ellipse of the end face of the conduit;

and 4, step 4: according to the internal and external parameters of the camera, epipolar constraint and sequence consistency rules, finding out a corresponding matching point of the edge coordinate of the end face projection ellipse of one of the conduits in the other image;

and 5: reconstructing three-dimensional space coordinate point clouds of all matching points by using the calibrated space position relation between binocular vision and a stereoscopic vision three-dimensional measurement model;

step 6: removing outliers from the three-dimensional space coordinate point cloud of the matching points by using a Randac algorithm, and using the remaining points as initial values of a point cloud fitting circle;

and 7: establishing an objective function of the point cloud fitting circle, wherein the objective function comprises: the distance between all points on the point cloud and a plane formed by the point cloud fitting circle and the distance between all points on the point cloud and the point cloud fitting circle center;

and 8: carrying out linearization processing on a target function of the point cloud fitting circle;

and step 9: and calculating a fitting space circle with the objective function being zero by using a least square method to serve as the positioning of the end surface of the conduit.

The internal parameters are transformation matrixes from an industrial camera coordinate system to an image coordinate system, the external parameters are transformation matrixes from the camera coordinate system to a world coordinate system, and the world coordinate system is used for outputting the coordinates of the subsequent actual control points.

The internal parameters of each industrial camera are calibrated by adopting a two-dimensional flexible target.

The external parameters are realized by a rotation matrix R and a translation matrix T.

The catheter is placed on a backlight plate, and images shot by the camera 1 and the camera 2 are the same end face image of the catheter under different visual angles.

The stereoscopic vision three-dimensional model comprises:

the stereoscopic vision three-dimensional model is represented as follows:

wherein (x)i,yi,zi) For the reconstructed three-dimensional spatial coordinate point pi(X) of (C)1i,Y1i) For an image edge point l under the camera 1iCoordinate (x)2i,y2i) For an image edge point q under camera 2iCoordinate, fm、fnFocal ratio of camera 1 and camera 2, transformation matrix R between camera 1 and camera 2, respectively12Is composed of

Thus (r)1,r2,r3,r7,r8,r9,t1,t2,t3) For transforming the matrix R12The parameter value of (2).

The center of the point cloud is the centroid of all points on the point cloud, the radius of the circle is the average distance from all points on the point cloud to the centroid, and the normal vector of the plane where the fitting circle is located is obtained by fitting the normal vector of the plane with all points on the point cloud.

The objective function f is as follows:

wherein n is the number of points contained in the point cloud, (a)0,b0,c0,d0) Is the normal vector of the plane of the fitted circle, (x)0,y0,z0) Is the centroid of all points in the point cloud, (x)i,yi,zi) Is any point on the point cloud. r is0Is the radius of the fitted circle.

The invention has the following beneficial effects and advantages:

1. the high-precision detection method for the pipe end of the catheter can effectively reconstruct the three-dimensional coordinates of the central point of the pipe end.

2. The high-precision detection method for the end of the conduit pipe has high measurement precision and can provide effective guarantee for the stress-free assembly of the conduit pipe.

3. The high-precision detection method for the pipe end of the conduit has high measurement efficiency and lays a solid foundation for the digital manufacturing of the conduit.

Drawings

FIG. 1 is a schematic diagram of a hardware apparatus for the method of the present invention;

FIG. 2 is a flow chart of the method of the present invention;

FIG. 3(a) is a left circle edge coordinate point in the image of the camera 1 according to the method of the present invention;

FIG. 3(b) is a right circular edge coordinate point in the image of the camera 2 according to the method of the present invention;

FIG. 4 is a three-dimensional coordinate point cloud of edge matching points reconstructed by the method of the present invention.

Detailed Description

The present invention will be described in further detail with reference to the accompanying drawings and examples.

Referring to fig. 1, the hardware set of the method of the present invention comprises: the device comprises a backlight plate, a conduit to be detected, four industrial cameras and a computer serving as a controller. The positioning matching detection of one end face projection ellipse of the conduit can be detected by combining the industrial cameras two by two, the computer is provided with programs for each step of method detection, the positioning matching detection result of the two end face projection ellipses of the conduit which are finally detected by the computer is matched with the computer and output to the upper computer, and the upper computer can control the actuator to assemble the conduit on the pre-connecting device according to the positioning matching detection result of the two end face projection ellipses of the conduit, so that the conduit assembly is realized.

Referring to the attached drawings 2, 3(a), 3(b) and 4, the method for detecting the end of the catheter with high precision comprises the following specific steps:

step 1: and performing multi-view visual calibration on the four industrial cameras to obtain internal parameters of all the cameras and a conversion matrix from a coordinate system of all the cameras to a world coordinate system, namely external parameters.

The intrinsic parameters represent a transformation matrix from the industrial camera coordinate system to the image coordinate system; the distortion degree of each lens is different, including radial distortion and eccentric distortion; and calibrating the internal parameters of each industrial camera by using the two-dimensional flexible target.

The extrinsic parameters represent a transformation matrix from the industrial camera coordinate system to the world coordinate system, which is achieved by a rotation matrix R and a translation matrix T. The world coordinate system is used for the actual control point coordinate output later.

Step 2: synchronously triggering two industrial cameras, namely a camera 1 and a camera 2, to acquire two original catheter images placed on a backlight plate;

and step 3: respectively solving the edge image coordinates of the two original conduit images after the sub-pixel precision processing of the conduit end face projection ellipse;

and 4, step 4: establishing a corresponding matching point relation of a sub-pixel precision edge coordinate of a projection ellipse of one conduit end face in another image by means of internal and external parameters, epipolar constraint and sequence consistency of a camera;

define the two-dimensional edge coordinate point L (L) of the image under the camera 11,l2,...ln) Finding out the corresponding two-dimensional edge coordinate point Q (Q) of the image under the camera 2 according to the internal and external parameters, epipolar constraint and sequence consistency principles of the camera1,q2,...qn)。

And 5: reconstructing a three-dimensional space coordinate point cloud P (P) of all matching points by means of a stereoscopic vision three-dimensional measurement model by utilizing the calibrated spatial position relationship between binocular vision (namely, a transformation matrix among an industrial camera coordinate system, an image coordinate system and a world coordinate system)1,p2,…pn);

The stereoscopic vision three-dimensional model is represented as follows:

wherein (x)i,yi,zi) For the reconstructed three-dimensional spatial coordinate point pi(X) of (C)1i,Y1i) For an image edge point l under the camera 1iCoordinate (x)2i,y2i) For an image edge point q under camera 2iCoordinate, fm、fnFocal ratio of camera 1 and camera 2, transformation matrix R between camera 1 and camera 2, respectively12Is composed of

Thus (r)1,r2,r3,r7,r8,r9,t1,t2,t3) For transforming the matrix R12The parameter value of (2).

Step 6: removing outliers from the three-dimensional space coordinate point cloud of the matching points by using a Ranpac algorithm, and establishing an initial value of a point cloud fitting circle by using the remaining points, wherein the center of the circle is the centroid of all the points on the point cloud, the radius of the circle is the average distance from all the points on the point cloud to the centroid, and the normal vector of the plane where the fitting circle is located is obtained by the normal vector of the fitting plane of all the points on the point cloud;

and 7: establishing a target function of a point cloud fitting circle, wherein the target function is composed of two parts, the first part is the distance between all points on the point cloud and a plane formed by the point cloud fitting circle, the second part is the distance between all points on the point cloud and the center of the point cloud fitting circle, and the target function f is as follows:

wherein n is the number of points contained in the point cloud, (a)0,b0,c0,d0) Is the normal vector of the plane of the fitted circle, (x)0,y0,z0) Is the centroid of all points in the point cloud, (x)i,yi,zi) Is any point on the point cloud. r is0Is the radius of the fitted circle.

And 8: linearize f to obtain

Wherein

(ii) an objective function f vs. x0Make a derivation

② objective function f to y0Make a derivation

③ target function f to z0Make a derivation

Fourthly, the objective function f is to r0Make a derivation

Fifthly, the objective function f is to a0Make a derivation

Sixthly, the target function f is to b0Make a derivation

Seventhly, the target functions f to c0Make a derivation

R objective function f to d0Make a derivation

And step 9: to make the objective function f equal to 0, let

-f0=Α1x02y03z04a05b06c07d08r0

By least square method, it can be converted into MX ═ B

Wherein

X=[x0,y0,z0,a0,b0,c0,r0]T

B=[f01,f02,…,f0m]T

Wherein, each row of the matrix M is a partial derivative value obtained by each point of the point cloud to each variable; t is a transposed symbol; the anisotropic quantity of matrix B is respectively obtained by the variables of each point of the point cloud0. The final spatial circular parameter value X can be obtained.

And step 10, performing the same operation according to the step 2 to the step 9 by using the industrial camera 3 and the industrial camera 4 to obtain the pipe end circular parameter value at the other end of the catheter.

And 11, assembling the catheter and performing other operations by using the obtained pipe end circle parameters at the two ends of the catheter.

The program steps are loaded on an on-site computer, four industrial cameras are arranged on the site to acquire images and send the images to the on-site computer, and the images are processed according to the steps, so that the actual space point cloud circular parameter values of the pipe ends on the two sides of the cut surface of the conduit can be acquired. The coordinate values of the final space circle are transmitted to a robot or other equipment for other operations.

The method adopts the step that the vs2010 is tested in a Win7 system, the space circle measurement precision can reach 0.05mm, and the repetition precision can reach 0.01 mm. The measuring accuracy is high, and is efficient, has stronger stability.

While the foregoing is directed to the preferred embodiment of the present invention, it will be understood by those skilled in the art that various changes and modifications may be made without departing from the spirit and scope of the invention as defined in the appended claims.

完整详细技术资料下载
上一篇:石墨接头机器人自动装卡簧、装栓机
下一篇:一种ADAS单目相机的标定方法

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!