Disclosure of Invention
The invention provides a pipeline coarse positioning method based on vision and laser ranging, and aims to realize pipeline coarse positioning.
The invention is realized in this way, a pipeline rough positioning method based on vision and laser ranging, the method specifically includes the following steps:
s1, collecting sampling points in the straight pipe fitting of the pipeline, and reading pixel coordinates of the sampling points;
s2, determining the direction of each sampling point in the camera coordinate system;
s3, moving the coordinate origin of the laser ranging sensor to the coordinate origin of the camera, sequentially pointing the laser ranging sensor to the direction of each sampling point in the camera coordinate system, and reading the ranging value of the laser ranging sensor, namely the distance from each sampling point to the camera coordinate system origin;
s4, determining coordinates of each sampling point in a camera coordinate system based on the ranging values of each acquisition point;
s5, calculating coordinates of the intersection point of the straight pipe fittings in the pipeline under a camera coordinate system, determining the position and the posture of the pipeline under the camera coordinate system, and converting the position and the posture of the pipeline under the camera coordinate system into an appointed coordinate system to realize coarse positioning of the pipeline.
Further, the method for determining the sampling point specifically includes:
shooting a pipeline image by a camera, carrying out binarization processing on the pipeline image by a self-adaptive binarization method, and extracting a pipe fitting area;
performing morphological processing and image thinning processing on the binary image of the pipe fitting to obtain an axis image of the pipe fitting;
performing linear fitting on the axis image to obtain a linear section l where the axis of the pipe fitting is located1,l2,…lnDividing each straight line segment into 3 equal parts, and selecting 2 middle division points as data acquisition points p1a,p1b,p2a,p2b,…pna,pnb。
The invention is realized in such a way that the pipeline coarse positioning system based on vision and laser ranging comprises:
the 2D camera and the laser ranging sensor are arranged on the mobile robot and are in communication connection with the positioning unit;
the 2D camera is used for shooting images of a pipeline, and the pipeline consists of straight pipe fittings;
and sending the shot image to a positioning unit, and realizing the rough positioning of the pipeline in the pipeline rough positioning method based on vision and laser ranging by the positioning unit.
The invention can quickly measure the coordinates of points on the pipe fitting under a camera coordinate system by combining the 2d camera and the laser ranging sensor, and calculate the coordinates of the node of the pipe fitting according to the coordinates of the points on the pipe fitting, thereby calculating the position and the posture of the pipe fitting and the position and the posture of each measuring straight section, realizing the coarse positioning of the pipe fitting and providing support for the quantitative parameter measurement of the pipe fitting.
Detailed Description
The following detailed description of the embodiments of the present invention will be given in order to provide those skilled in the art with a more complete, accurate and thorough understanding of the inventive concept and technical solutions of the present invention.
In the course of rough positioning in the pipeline measurement process, coordinates of points on the pipeline under a camera coordinate system are calculated through vision and laser ranging, the positions of key nodes of the pipeline are calculated through the coordinates, so that the positions and postures of the pipeline under the camera coordinate system are calculated, finally the positions and postures of the pipeline under the camera coordinate system are converted into an appointed coordinate system through coordinate conversion, rough positioning of the pipeline is achieved, and the postures can be understood as the rotation angle or the trend of a pipe fitting. The principle of coarse positioning in the pipeline measurement process is shown in the following figure;
FIG. 1 is a pixel coordinate system
And image coordinate system
The relationship between,(u
0,v
0) Is an image coordinate system
Is a calibration value, and a pixel coordinate system O of the photographed image
(u,v)Conversion to image coordinate system
Thus, the method is known;
wherein, (x, y) represents coordinates under an image coordinate system, and (u, v) represents pixel coordinates under a pixel coordinate system, which can be obtained;
FIG. 2 is a camera coordinate system OcAnd an image coordinate system (x, y), the image coordinate system is converted into a camera coordinate system;
(Xc,Yc,Zc) Representing camera coordinates in a camera coordinate system, available;
wherein f is the focal length of the camera and can be known by combining the above coordinate system conversion relation;
obtaining;
it can be seen from the above formula that given the pixel coordinates in an image, the X in the camera coordinate system can be calculated
cCoordinate sum Z
cRatio of coordinates and Y
cCoordinate sum Z
cRatio of coordinates, i.e. x
z=X
c/Z
c,y
z=Y
c/Z
cWherein [ x ]
z,y
z,1]
TIs the direction of a specified point in the image in the camera coordinate system, [ X ]
c,y
c,Z
c]
TDirection in camera coordinate system and [ x ]
z,y
z,1]
TSimilarly, it is desirable to obtain the coordinates of a point in the image in the camera coordinate system from the pixel coordinates of the point, and to know the Z of the point in the camera coordinate system
cCoordinates, or the distance required from the point to the origin of the camera coordinate system, i.e.
The distance is measured in the present invention using laser ranging techniques.
The specific measurement mode is that the measurement origin of the laser ranging sensor is arranged at the origin of the camera coordinate system, and when the laser of the laser ranging sensor points to the pixel direction of the image, the ranging reading of the laser ranging sensor is the distance from one point in the image to the origin of the camera coordinate system.
Obtaining;
thus, the relation between the image pixel coordinates and the reading of the laser ranging sensor to the camera coordinate system is established, and the coordinates of one point in the image on the camera coordinate system can be calculated.
Fig. 3 is a flowchart of a pipeline coarse positioning method based on vision and laser ranging according to an embodiment of the present invention, where the method specifically includes the following steps:
s1, collecting sampling points p in n straight-section pipe fittings of pipeline1a,p1b,p2a,p2b,…pna,pnbReading the pixel coordinates (u, v) of the sampling point;
the pipeline in the invention is composed of n straight-section pipe fittings, mainly refers to oil-gas pipelines of automobiles and airplanes, the purpose of the positioning of the pipe fittings is to provide the position and the posture of the pipe fittings for the accurate measurement of pipe fitting parameters, the posture of the pipe fittings can be roughly restricted during the measurement, therefore, the posture of the pipe fittings during the measurement can be adjusted to avoid the mutual shielding among the straight-section pipe fittings, and the trend of the pipe fittings is shown in figure 4.
Firstly, shooting a pipeline image by using a 2D camera, carrying out binarization processing on the pipeline image by using a self-adaptive binarization method, extracting a pipe fitting area, carrying out morphological processing and image thinning processing on the binarization image of the pipe fitting to obtain an axis image of the pipe fitting, and then carrying out linear fitting on the axis image to obtain a linear segment l where the axis of the pipe fitting is located1,l2,…lnDividing each straight line segment into 3 equal parts, and selecting 2 middle division points as data acquisition points p1a,p1b,p2a,p2b,…pna,pnbAnd obtaining the pixel coordinates of the data acquisition points.
S2, calculating the direction of each sampling point in the camera coordinate system;
s3, moving the coordinate origin of the laser ranging sensor to the coordinate origin of the camera according to the position relation between the calibrated camera and the laser ranging sensor, sequentially pointing the laser ranging sensor to the direction of each sampling point in the camera coordinate system, and reading the ranging value d of the laser ranging sensor1a,d1b,d2a,d2b,…,dna,dnbThe distance from each sampling point to the origin of the camera coordinate system;
s4, determining coordinates of each sampling point in a camera coordinate system based on the ranging values of each acquisition point;
s5, calculating coordinates of the straight pipe intersection point under a camera coordinate system, determining the position and the posture of the pipeline under the camera coordinate system, and converting the position and the posture of the pipeline under the camera coordinate system into a specified coordinate system to realize coarse positioning of the pipeline.
The invention provides a pipeline coarse positioning system based on vision and laser ranging, which comprises:
the 2D camera and the laser ranging sensor are arranged on the mobile robot and are in communication connection with the positioning unit;
the 2D camera is used for shooting images of a pipeline, and the pipeline consists of straight pipe fittings; and sending the shot image to a positioning unit, determining the direction of each sampling point under a camera coordinate system by the positioning unit based on the image, controlling a laser ranging sensor to align each sampling point for ranging, calculating the coordinate of the corresponding sampling point under the camera coordinate system based on the ranging value, and further realizing the coarse positioning of the pipeline.
The invention has been described above with reference to the accompanying drawings, it is obvious that the invention is not limited to the specific implementation in the above-described manner, and it is within the scope of the invention to apply the inventive concept and solution to other applications without substantial modification.