Public-view-free multi-camera positioning large workpiece and industrial robot position compensation method

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

1. A public-view-free multi-camera positioning large workpiece and industrial robot position compensation method is characterized in that: the method comprises the following specific steps:

s1, building an implementation platform, and installing the target at the tail end of the robot (1);

s2, moving the target to the center of the visual field of the main camera (2.1) and acquiring an image 1;

s3, the robot (1) moves to the center of the visual field of the camera (2.2) along the y direction only, the moving distance is d, and an image 2 is acquired;

s4, calculating the position relation matrix of the slave camera (2.2) relative to the master camera (2.1);

s5, calibrating the hand and the eye of the main camera (2.1);

s6, calculating a rotation center;

s7, the main camera (2.1) captures an image, and a feature point P0 is identified, wherein the feature point is at a position P0 under a robot coordinate system, and P0 is t P0;

s8, capturing an image from the camera (2.2), and identifying a feature point as P1, wherein the feature point is at a position P1 under a robot coordinate system, and P1 is t matrix P1;

s9, judging whether the position is used as a standard position:

a: if yes, saving P0 as standard0, P1 as standard1, and recording the current position as standard2 by the robot;

b: if not, entering the next step;

s10, calculating an offset angle theta:

theta=arctan2(p1.y–p0.y,p1.x–p0.x)-arctan2(standard1.y–standard0.y,standard1.x–standard0.x);

s11, calculating offset:

point_result=[[cos(theta),sin(theta),(1-cos(theta))*center[0]–sin(theta)*center[1]],[-sin(theta),cos(theta),sin(theta)*center[0]+(1–cos(theta))*center[1]];

dx=point_result.x-standard0.x;dy=point_result.y-standard0.y

s12, compensating dx, dy and theta by the robot on a standard position standard 2;

s13, judging whether to continue, if so, returning to the step S7, and sequentially executing the steps S7 to S12; if not, the process is terminated.

2. The common-view-free multi-camera positioning large workpiece and industrial robot position compensation method according to claim 1, characterized in that: the building platform of the step S1 is specifically that the first light source (2.3) and the second light source (2.4) are respectively installed in the middle of the visual fields of the main camera (2.1) and the slave camera (2.2), and the main camera (2.1) and the slave camera (2.2) are installed on the visual installation support (2).

3. The common-view-free multi-camera positioning large workpiece and industrial robot position compensation method according to claim 1, characterized in that: the specific steps in step S4 are as follows:

a. calculating the positions c0_ points of the five circle center coordinates in the image 1 in the camera coordinate system; calculating the positions c1_ points of the five circle center coordinates in the image 2 in the camera coordinate system;

b. according to the homography matrix transformation, solving a conversion matrix h of c0_ points and c1_ points;

c. calculating the pixel size according to the real size between c0_ points and five points;

d. under a camera pixel coordinate system, the coordinate of a central point of a visual field is p, and dst _ p is obtained after homography change:

dst_p=h*p;

e. the distance between the view center point of the master camera (2.1) and the view center point of the slave camera (2.2) is as follows:

distance=d-(dst_p[0]–p[0])*pixel_size

f. calculating a positional relationship matrix of the slave camera (2.2) with respect to the master camera (2.1):

matrix=h;matrix[0][2]-=distance/pixel_size。

4. the common-view-free multi-camera positioning large workpiece and industrial robot position compensation method according to claim 1, characterized in that: the specific steps of step S5 are as follows:

a. taking down the target, and sucking the workpiece by a gripper (1.1);

b. moving the feature point to the center p _ center of the field of view of the primary camera (2.1);

c. reading the current position p _ r of the robot (1); acquiring a current image and detecting that the position of the characteristic point is p _ c;

d. taking the p _ center as the field child center, walking 8 points, and returning to step S5 c to record the corresponding position point when walking one point;

e. and (3) setting the nine positions of the robot (1) as P _ R and the corresponding characteristic positions as P _ C, and obtaining a position relation matrix t of the pixel coordinate system of the main camera (2.1) and the robot coordinate system according to a least square method.

5. The common-view-free multi-camera positioning large workpiece and industrial robot position compensation method according to claim 1, characterized in that: the specific steps of step S6 are as follows:

a. the robot (1) rotates by an angle every time, and ensures that the characteristic point captures an image in a camera visual field to obtain a characteristic point position as data _ p; iteration is carried out for 9 times; recording the position of the nine points as DATA _ p;

b. obtaining the position of the 9 point in the robot coordinate system as DATA _ P according to the matrix t and the DATA _ P in the step S5;

c. and fitting the circle center according to a least square method to obtain a rotation center.

Background

The document "a solving method for the position relation of cameras without a common view field" discloses a method for calibrating a multi-camera system. On the basis of a two-dimensional target calibration method, the thesis provides a solving method of a position relation of a camera without a common view field based on a two-axis turntable. Specifically, a system to be calibrated is fixed on a rotary table, and the relative relation between a target coordinate system and a rotary table coordinate system is determined by the rotation of the rotary table; enabling the two-dimensional target to sequentially enter the view field of each camera by rotating the rotary table so as to respectively determine the position of each camera in the target coordinate system after rotation, and recording the rotating angle; and finally, solving the relative position between the cameras by combining the relation between the target coordinate system and the turntable coordinate system. The method needs a two-axis turntable, and is complex in structure, time-consuming in installation, high in cost, large in occupied area and low in reusability.

Disclosure of Invention

In order to solve the problems, the invention provides a common-view-free multi-camera positioning large workpiece and an industrial robot position compensation method.

A public-view-free multi-camera positioning large workpiece and industrial robot position compensation method comprises the following specific steps:

s1, building an implementation platform, and installing the target at the tail end of the robot;

s2, moving the target to the center of the main camera view to acquire an image 1;

s3, the robot moves to the center of the camera view field along the y direction only, the moving distance is d, and an image 2 is acquired;

s4, calculating the position relation matrix of the slave camera relative to the master camera;

s5, calibrating the hand eye of the main camera;

s6, calculating a rotation center;

s7, the main camera captures images, and a feature point P0 is identified, wherein the position P0 and P0 of the feature point in the robot coordinate system are t P0;

s8, capturing an image from the camera, identifying a feature point as P1, and identifying the position P1 of the feature point in the robot coordinate system, wherein the position P1 is t matrix P1;

s9, judging whether the position is used as a standard position:

a: if yes, saving P0 as standard0, P1 as standard1, and recording the current position as standard2 by the robot;

b: if not, entering the next step;

s10, calculating an offset angle theta:

theta=arctan2(p1.y–p0.y,p1.x–p0.x)-arctan2(standard1.y–standard0.y,standard1.x–standard0.x);

s11, calculating offset:

point_result=[[cos(theta),sin(theta),(1-cos(theta))*center[0]–sin(theta)*center[1]],[-sin(theta),cos(theta),sin(theta)*center[0]+(1–cos(theta))*center[1]];

dx=point_result.x-standard0.x;dy=point_result.y-standard0.y

s12, compensating dx, dy and theta by the robot on a standard position standard 2;

s13, judging whether to continue, if so, returning to the step S7, and sequentially executing the steps S7 to S12; if not, the process is terminated.

The building platform of the step S1 is specifically that the first light source and the second light source are respectively installed in the middle of the visual fields of the master camera and the slave camera, and the master camera and the slave camera are installed on the visual installation support.

The specific steps in step S4 are as follows:

a. calculating the positions c0_ points of the five circle center coordinates in the image 1 in the camera coordinate system; calculating the positions c1_ points of the five circle center coordinates in the image 2 in the camera coordinate system;

b. according to the homography matrix transformation, solving a conversion matrix h of c0_ points and c1_ points;

c. calculating the pixel size according to the real size between c0_ points and five points;

d. under a camera pixel coordinate system, the coordinate of a central point of a visual field is p, and dst _ p is obtained after homography change:

dst_p=h*p;

e. the distance between the main camera view center point and the slave camera view center point is as follows:

distance=d-(dst_p[0]–p[0])*pixel_size

f. calculating the position relation matrix of the slave camera relative to the master camera:

matrix=h;matrix[0][2]-=distance/pixel_size。

the specific steps of step S5 are as follows:

a. taking down the target, and sucking the workpiece by a gripper;

b. moving the feature point to the main camera view center p _ center;

c. reading a current robot position p _ r; acquiring a current image and detecting that the position of the characteristic point is p _ c;

d. taking the p _ center as the field child center, walking 8 points, and returning to step S5 c to record the corresponding position point when walking one point;

e. and the nine-point position of the robot is set as P _ R, the corresponding characteristic point position is set as P _ C, and a position relation matrix t of a pixel coordinate system of the main camera and a robot coordinate system is obtained according to a least square method.

The specific steps of step S6 are as follows:

a. the robot rotates by an angle every time, and ensures that the characteristic point captures an image in the visual field of the camera to obtain the characteristic point position as data _ p; iteration is carried out for 9 times; recording the position of the nine points as DATA _ p;

b. obtaining the position of the 9 point in the robot coordinate system as DATA _ P according to the matrix t and the DATA _ P in the step S5;

c. and fitting the circle center according to a least square method to obtain a rotation center.

The invention has the beneficial effects that: aiming at solving the problem of the position relation of the non-common-view multi-camera, a simple and easy-to-operate method is provided, and a compensation method is provided for positioning a large-size workpiece by a machine; the method has low hardware cost, and only one target is needed; complex equipment installation is not needed, and the operation is simple; the method is not limited to the application of the scene, and can be used when the non-common view of a plurality of cameras needs to calculate the mutual position relation.

Drawings

The invention is further illustrated with reference to the following figures and examples.

FIG. 1 is a front view schematic of the present invention;

FIG. 2 is a schematic diagram of the structure of a target of the present invention;

FIG. 3 is a schematic view of a small workpiece structure according to the present invention;

FIG. 4 is a schematic view of a large workpiece structure according to the present invention;

FIG. 5 is a schematic view of the flow structure of the present invention.

Detailed Description

In order to make the technical means, the creation characteristics, the achievement purposes and the effects of the invention easy to understand, the invention is further explained below.

As shown in fig. 1 to 5, a common-view-free multi-camera positioning large workpiece and industrial robot position compensation method includes the following steps:

s1, building an implementation platform, and installing the target at the tail end of the robot 1;

s2, moving the target to the center of the view field of the main camera 2.1 to acquire an image 1;

s3, the robot 1 moves to the center of the view of the camera 2.2 along the y direction only, the moving distance is d, and an image 2 is acquired;

s4, calculating a position relation matrix of the slave camera 2.2 relative to the master camera 2.1;

s5, calibrating the hand eye of the main camera;

s6, calculating a rotation center;

s7, the main camera 2.1 captures an image, and identifies a feature point P0, where the feature point is at a position P0 in the robot coordinate system, and P0 is t × P0;

s8, capturing an image from the camera 2.2, and identifying a feature point as P1, where the feature point is at a position P1 in the robot coordinate system, and P1 is t matrix P1;

s9, judging whether the position is used as a standard position:

a: if yes, saving P0 as standard0, P1 as standard1, and recording the current position as standard2 by the robot;

b: if not, entering the next step;

s10, calculating an offset angle theta:

theta=arctan2(p1.y–p0.y,p1.x–p0.x)-arctan2(standard1.y–standard0.y,standard1.x–standard0.x);

s11, calculating offset:

point_result=[[cos(theta),sin(theta),(1-cos(theta))*center[0]–sin(theta)*center[1]],[-sin(theta),cos(theta),sin(theta)*center[0]+(1–cos(theta))*center[1]];

dx=point_result.x-standard0.x;dy=point_result.y-standard0.y

s12, compensating dx, dy and theta by the robot on a standard position standard 2;

s13, judging whether to continue, if so, returning to the step S7, and sequentially executing the steps S7 to S12; if not, the process is terminated.

Aiming at solving the problem of the position relation of the non-common-view multi-camera, a simple and easy-to-operate method is provided, and a compensation method is provided for positioning a large-size workpiece by a machine; the method has low hardware cost, and only one target is needed; complex equipment installation is not needed, and the operation is simple; the method is not limited to the application of the scene, and can be used when the non-common view of a plurality of cameras needs to calculate the mutual position relation.

The building platform of step S1 is specifically that the first light source 2.3 and the second light source 2.4 are respectively installed in the middle of the visual fields of the master camera 2.1 and the slave camera 2.2, and the master camera 2.1 and the slave camera 2.2 are installed on the visual installation support 2.

The method only needs to install the cameras on a beam made of aluminum profiles, moves the targets into the view fields of the cameras respectively by using the robot 1, records the moving distance of the robot 1, calculates the position relation of the two cameras by identifying the targets and combining the moving distance of the robot 1, and obtains the hand-eye calibration result by using a nine-point calibration method. The rotation center is fitted according to a least square method, a complex mechanism is not needed, extra floor space is not needed, and the operation is simple; only one target needs to be purchased, so that the cost is low; the reusability notice.

The specific steps in step S4 are as follows:

a. calculating the positions c0_ points of the five circle center coordinates in the image 1 in the camera coordinate system; calculating the positions c1_ points of the five circle center coordinates in the image 2 in the camera coordinate system;

b. according to the homography matrix transformation, solving a conversion matrix h of c0_ points and c1_ points;

c. calculating the pixel size according to the real size between c0_ points and five points;

d. under a camera pixel coordinate system, the coordinate of a central point of a visual field is p, and dst _ p is obtained after homography change:

dst_p=h*p;

e. the distance between the center point of the view of the master camera 2.1 and the center point of the view of the slave camera 2.2 is:

distance=d-(dst_p[0]–p[0])*pixel_size

f. the position relationship matrix of the slave camera 2.2 relative to the master camera 2.1 is calculated:

matrix=h;matrix[0][2]-=distance/pixel_size。

and calculating the position relation between the slave camera 2.2 and the master camera 2.1, and performing hand-eye calibration on the master camera 2.1 and the robot 1, so that the positions of the feature points in the master camera 2.1 and the slave camera 2.2 in the robot coordinate system can be calculated, and all the positions are unified in the robot coordinate system, thereby calculating the offset position and the offset angle of the workpiece and the standard workpiece.

The specific steps of step S5 are as follows:

a. taking down the target, and sucking the workpiece by a gripper 1.1;

b. moving the feature point to the main camera 2.1 view center p _ center;

c. reading the current position p _ r of the robot 1; acquiring a current image and detecting that the position of the characteristic point is p _ c;

d. taking the p _ center as the field child center, walking 8 points, and returning to step S5 c to record the corresponding position point when walking one point;

e. the nine-point position of the robot 1 is set as P _ R, the corresponding characteristic point position is set as P _ C, and a position relation matrix t of a pixel coordinate system of the main camera 2.1 and a robot coordinate system is obtained according to a least square method.

The position relation between the cameras is determined according to the homography matrix relation and the moving distance compensation by solving the position relation between the slave camera 2.2 and the master camera 2.1,

the specific steps of step S6 are as follows:

a. the robot 1 rotates by an angle every time, and ensures that the characteristic point captures an image in a camera visual field to obtain the characteristic point position as data _ p; iteration is carried out for 9 times; recording the position of the nine points as DATA _ p;

b. obtaining the position of the 9 point in the robot coordinate system as DATA _ P according to the matrix t and the DATA _ P in the step S5;

c. and fitting the circle center according to a least square method to obtain a rotation center.

And calibrating the hands and eyes of the main camera 2.1, and determining the position relation between the main camera 2.1 and the robot 1 according to a nine-point method and a least square method.

And solving the rotation center, namely solving the position of the rotation center according to the circle center fitted by a least square method.

And solving the offset, and determining the interpolation of the current value and the standard position as the offset.

The foregoing shows and describes the general principles, essential features, and advantages of the invention. It will be understood by those skilled in the art that the present invention is not limited to the embodiments described above, which are merely illustrative of the principles of the invention, but that various changes and modifications may be made without departing from the spirit and scope of the invention, which fall within the scope of the invention as claimed. The scope of the invention is defined by the appended claims and equivalents thereof.

完整详细技术资料下载
上一篇:石墨接头机器人自动装卡簧、装栓机
下一篇:网络化机器人协同控制方法、装置、设备及存储介质

网友询问留言

已有0条留言

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

精彩留言,会给你点赞!