Calibration method and device for SCARA robot end camera

By calculating the affine transformation matrix and rotation center coordinates, automatic calibration of the SCARA robot end camera is achieved, which solves the problems of low calibration accuracy and high hardware cost in the existing technology, and improves calibration efficiency and accuracy.

CN115100295BActive Publication Date: 2025-04-22SHENZHEN VISION DRAGON INTELLIGENT SENSOR CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210787294.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-07-04
Publication Date
2025-04-22
Estimated Expiration
2042-07-04

AI Technical Summary

Technical Problem

The calibration algorithm of existing SCARA robot end cameras requires the use of calibration blocks, and there are certain errors in calibration accuracy, and a specific calibration board and calibration tool are required, which increases hardware cost and installation time.

Method used

By controlling the SCARA robot to move the camera to take a picture of Mark points, record the camera's image coordinates and robot world coordinates, calculate the affine transformation matrix, use this matrix to convert the camera calibration coordinate system, calculate the coordinates of the rotation center, and realize the calibration of the camera's world coordinate system.

Benefits of technology

No specific calibration boards and calibration tools are required to reduce hardware costs and installation time, improve calibration accuracy, realize automatic calibration, and reduce the impact of human factors on calibration accuracy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115100295B_ABST
    Figure CN115100295B_ABST
Patent Text Reader

Abstract

The present invention provides a calibration method and device for a terminal camera of a SCARA robot, the method comprising: using product features as Mark points, the SCARA robot moves to drive the camera to take pictures, respectively recording the multi-point camera image coordinates and the SCARA robot world coordinates, performing calibration operations on the camera image coordinates and the SCARA robot world coordinates to obtain a camera calibration coordinate system, and then performing rotation center calibration; taking pictures of the Mark points again with the camera posture unchanged, recording the first point camera calibration coordinates and the SCARA robot world coordinates, rotating the SCARA robot rotation axis, at this time the camera posture also rotates together, the camera takes pictures, recording the second point camera calibration coordinates and the SCARA robot world coordinates, and obtaining the position of the SCARA robot rotation center in the camera calibration coordinate system through two-point calculation, thereby calculating the camera world coordinate system. The beneficial effects of the present invention are: no specific calibration tool is required, and the calibration accuracy is high.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to a camera calibration method and device, and in particular to a SCARA robot terminal camera calibration method and device. Background Art

[0002] In the SCARA robot vision system, the camera is the robot's eye, used to locate the target product features, calculate the target product's position in the robot coordinate system, and guide the robot to perform operations such as grabbing, placing, and trajectory guidance. There are many ways to fix the camera, and the following four methods are common: the first one: the camera is installed in a fixed position upward; the second one: the camera is installed in a fixed position downward; the third one: fixed on the second arm of the SCARA robot; the fourth one: fixed on the end of the SCARA robot. Different installation methods can achieve different functions of the camera.

[0003] In the visual guidance of SCARA robots, the core principle of this technology is the calibration between the camera coordinate system and the SCARA robot coordinate system. The camera coordinate system is mainly divided into three coordinate systems, namely the camera image coordinate system, the camera calibration coordinate system, and the camera world coordinate system, while the SCARA robot coordinate system is mainly the robot world coordinate system. The main purpose of the camera and SCARA robot calibration is to unify the camera world coordinate system and the SCARA robot world coordinate system.

[0004] The existing calibration algorithm of the SCARA robot's end camera requires the use of a calibration block with multiple mark points on it. The camera obtains the image coordinates of multiple mark points on the calibration plate, and then needs to install a needle tip, that is, a calibration tool, on the SCARA robot flange. The mark points on the calibration tool are aligned in turn, and the world coordinates of the SCARA robot are recorded. Finally, the camera image coordinates and the SCARA robot world coordinates are calibrated to obtain the camera world coordinate system.

[0005] In the prior art, the relative relationship calibration between the SCARA robot coordinate system and the camera calibration coordinate system requires the calibration tool to be installed on the robot flange for calibration, and there is a certain error in the calibration accuracy. Summary of the invention

[0006] The technical problem to be solved by the present invention is to provide a calibration method and device for a SCARA robot terminal camera.

[0007] In order to solve the above technical problems, the technical solution adopted by the present invention is: a calibration method for a SCARA robot end camera, comprising the steps of:

[0008] S10, control the SCARA robot to move the camera to take pictures of the Mark points, record the image coordinates of the multi-point camera and the SCARA robot world coordinate system respectively, and calculate the affine transformation matrix;

[0009] S20, the camera posture remains unchanged, the camera is controlled to take a picture of the Mark point, the first image coordinates of the Mark point camera are recorded, and the first image coordinates of the Mark point camera are affine transformed by using an affine transformation matrix to obtain the first calibration coordinates of the Mark point camera;

[0010] S30, after controlling the SCARA robot to drive the camera to rotate by a preset angle, control the camera to take a picture of the Mark point, record the second image coordinates of the Mark point camera, and use the affine transformation matrix to perform affine transformation on the second image coordinates of the Mark point camera to obtain the second calibration coordinates of the Mark point camera;

[0011] S40, according to the preset angle driven by the SCARA robot to rotate the camera and the second calibration coordinate, calculate the coordinates of the Mark point in the camera calibration coordinate system at the preset rotation angle, and record it as the third calibration coordinate;

[0012] S50, calculating the origin coordinates of the rotated camera calibration coordinate system on the original camera calibration coordinate system according to the first calibration coordinates and the third calibration coordinates;

[0013] S60, calculating the coordinates of the rotation center according to the preset rotation angle, the origin coordinates of the camera calibration coordinate system and the origin coordinates of the rotated camera calibration coordinate system to calculate the camera world coordinate system.

[0014] Furthermore, in step S10, the calculated affine transformation matrix is:

[0015] W = P*Tw; where W is the SCARA robot coordinate system, P is the camera image coordinate system, and Tw is the affine transformation matrix;

[0016]

[0017] Among them, Sx is the scale in the X direction, Sy is the scale in the Y direction, phi is the rotation angle, Theta is the tilt angle, Tx is the offset in the X direction, and Ty is the offset in the Y direction;

[0018]

[0019] Where x is the camera calibration coordinate X, y is the camera calibration coordinate Y, x' is the camera image coordinate X, and y' is the camera image coordinate Y.

[0020] Furthermore, in step S40, the calculation formula of the third calibration coordinate is:

[0021] Xc3=(Xc2-Yc2*tan(R))*cos(R)=Xc2*cos(R)-Yc2*sin(R);

[0022] Yc3=(Yc2+Xc2*tan(R))*cos(R)=Yc2*cos(R)+Xc2*sin(R);

[0023] Among them, (Xc3, Yc3) represents the third calibration coordinate, (Xc2, Yc2) represents the second calibration coordinate, and R represents the rotation angle.

[0024] Further, in step S50, the coordinates of the origin of the rotated camera calibration coordinate system on the original camera calibration coordinate system are calculated using the following formula:

[0025] Xo2=Xc3-Xc1;

[0026] Yo2=Yc3-Yc1;

[0027] Among them, (Xc1, Yc1) represents the first calibration coordinates, and (Xc3, Yc3) represents the third calibration coordinates.

[0028] Furthermore, in step S60, the coordinate calculation formula of the rotation center is:

[0029] Xo2-X rotation = (0-X rotation)*cos(R)-(0-Y rotation)*sin(R)

[0030] Yo2-Y rotation = (0-X rotation)*sin(R)+(0-Y rotation)*cos(R)

[0031] Among them, (X rotation, Y rotation) represents the coordinates of the rotation center, O1(0,0) represents the origin coordinates of the camera calibration coordinate system, O2(Xo2, Yo2) represents the origin coordinates of the camera calibration coordinate system after rotation, and R is the rotation angle.

[0032] The present invention also provides a calibration device for a SCARA robot end camera, comprising:

[0033] The affine transformation matrix calculation module is used to control the SCARA robot to move the camera to take pictures of the Mark points, record the image coordinates of the multi-point camera and the SCARA robot world coordinate system, and calculate the affine transformation matrix;

[0034] The first calibration coordinate calculation module is used to control the camera to take pictures of the Mark point while keeping the camera posture unchanged, record the first image coordinates of the Mark point camera, and perform affine transformation on the first image coordinates of the Mark point camera using an affine transformation matrix to obtain the first calibration coordinates of the Mark point camera;

[0035] The second calibration coordinate calculation module is used to control the SCARA robot to drive the camera to rotate a preset angle, control the camera to take a picture of the Mark point, record the second image coordinates of the Mark point camera, and use the affine transformation matrix to perform affine transformation on the second image coordinates of the Mark point camera to obtain the second calibration coordinates of the Mark point camera;

[0036] The third calibration coordinate calculation module is used to calculate the coordinates of the Mark point in the camera calibration coordinate system at the preset rotation angle according to the preset rotation angle of the camera driven by the SCARA robot and the second calibration coordinate, which is recorded as the third calibration coordinate;

[0037] A rotation origin coordinate calculation module, used to calculate the origin coordinates of the rotated camera calibration coordinate system on the original camera calibration coordinate system according to the first calibration coordinates and the third calibration coordinates;

[0038] The rotation center calculation module is used to calculate the coordinates of the rotation center to calculate the camera world coordinate system according to the preset rotation angle, the origin coordinates of the camera calibration coordinate system and the origin coordinates of the rotated camera calibration coordinate system.

[0039] Furthermore, in the affine transformation matrix calculation module, the calculated affine transformation matrix is:

[0040] W = P*Tw; where W is the SCARA robot coordinate system, P is the camera image coordinate system, and Tw is the affine transformation matrix;

[0041]

[0042] Among them, Sx is the scale in the X direction, Sy is the scale in the Y direction, phi is the rotation angle, Theta is the tilt angle, Tx is the offset in the X direction, and Ty is the offset in the Y direction;

[0043]

[0044] Where x is the camera calibration coordinate X, y is the camera calibration coordinate Y, x' is the camera image coordinate X, and y' is the camera image coordinate Y.

[0045] Furthermore, in the third calibration coordinate calculation module, the calculation formula of the third calibration coordinate is:

[0046] Xc3=(Xc2-Yc2*tan(R))*cos(R)=Xc2*cos(R)-Yc2*sin(R);

[0047] Yc3=(Yc2+Xc2*tan(R))*cos(R)=Yc2*cos(R)+Xc2*sin(R);

[0048] Among them, (Xc3, Yc3) represents the third calibration coordinate, (Xc2, Yc2) represents the second calibration coordinate, and R represents the rotation angle.

[0049] Furthermore, in the rotation origin coordinate calculation module, the origin coordinates of the rotated camera calibration coordinate system on the original camera calibration coordinate system are calculated using the following calculation formula:

[0050] Xo2=Xc3-Xc1;

[0051] Yo2=Yc3-Yc1;

[0052] Among them, (Xc1, Yc1) represents the first calibration coordinates, and (Xc3, Yc3) represents the third calibration coordinates.

[0053] Furthermore, in the rotation center calculation module, the coordinate calculation formula of the rotation center is:

[0054] Xo2-X rotation = (0-X rotation)*cos(R)-(0-Y rotation)*sin(R)

[0055] Yo2-Y rotation = (0-X rotation)*sin(R)+(0-Y rotation)*cos(R)

[0056] Among them, (X rotation, Y rotation) represents the coordinates of the rotation center, O1(0,0) represents the origin coordinates of the camera calibration coordinate system, O2(Xo2, Yo2) represents the origin coordinates of the camera calibration coordinate system after rotation, and R is the rotation angle.

[0057] The beneficial effects of the present invention are as follows: the difficulty of the calibration method of the SCARA robot terminal camera lies in the calibration of the rotation center. After the rotation axis of the SCARA robot rotates, the camera posture changes, and the camera calibration coordinate system also changes. The position of the SCARA robot rotation center in the camera calibration coordinate system can be calculated through the process of this scheme. Compared with the existing calibration algorithm of the SCARA robot terminal camera, the advantages of the present invention are as follows: no specific calibration plate is required, which reduces the hardware cost of the visual system; no robot needle, that is, calibration tool, is required to be made, which reduces the hardware cost of the mechanism and saves installation time; there is no need to use the human eye to judge whether the mark point on the calibration plate is aligned, which reduces the loss of calibration accuracy; since there is no human factor involved in the calibration process, automatic calibration can be achieved. BRIEF DESCRIPTION OF THE DRAWINGS

[0058] The specific structure of the present invention is described in detail below in conjunction with the accompanying drawings.

[0059] Figure 1 This is a flow chart of a calibration method for a SCARA robot end camera according to an embodiment of the present invention;

[0060] Figure 2It is a block diagram of a calibration device for a SCARA robot end camera according to an embodiment of the present invention;

[0061] Figure 3 A conversion relationship diagram of a coordinate system of an embodiment of the present invention;

[0062] Figure 4 A schematic block diagram of a computer device according to an embodiment of the present invention. DETAILED DESCRIPTION

[0063] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0064] It should be understood that when used in this specification and the appended claims, the terms "include" and "comprises" indicate the presence of described features, integers, steps, operations, elements and / or components, but do not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or combinations thereof.

[0065] It should also be understood that the terms used in this specification of the present invention are only for the purpose of describing specific embodiments and are not intended to limit the present invention. As used in the specification of the present invention and the appended claims, unless the context clearly indicates otherwise, the singular forms "a", "an" and "the" are intended to include plural forms.

[0066] It should be further understood that the term "and / or" used in the present description and the appended claims refers to any and all possible combinations of one or more of the associated listed items, and includes these combinations.

[0067] The first embodiment of the present invention is: a calibration method for a SCARA robot end camera, comprising the steps of:

[0068] S10, control the SCARA robot to move the camera to take pictures of the Mark point, record the image coordinates (Xpi, Ypi) of the multi-point camera and the SCARA robot world coordinate system (Xwi, Ywi), and calculate the affine transformation matrix Tw; wherein the shape contour features of the currently produced product are used as the Mark point;

[0069] Furthermore, in step S10, the calculated affine transformation matrix is:

[0070] W = P*Tw; where W is the SCARA robot coordinate system, P is the camera image coordinate system, and Tw is the affine transformation matrix;

[0071]

[0072] Among them, Sx is the scale in the X direction, Sy is the scale in the Y direction, phi is the rotation angle, Theta is the tilt angle, Tx is the offset in the X direction, and Ty is the offset in the Y direction;

[0073]

[0074] Where x is the camera calibration coordinate X, y is the camera calibration coordinate Y, x' is the camera image coordinate X, and y' is the camera image coordinate Y.

[0075] S20, the camera posture remains unchanged, the camera is controlled to take a picture of the Mark point, the first image coordinates P1 (Xp1, Yp1) of the Mark point camera are recorded, and the first image coordinates P1 (Xp1, Yp1) of the Mark point camera are affine transformed by using the affine transformation matrix Tw to obtain the first calibration coordinates Pc1 (Xc1, Yc1) of the Mark point camera;

[0076] S30, after controlling the SCARA robot to drive the camera to rotate by a preset angle R, control the camera to take a picture of the Mark point, record the second image coordinates P2 (Xp2, Yp2) of the Mark point camera, and use the affine transformation matrix Tw to perform affine transformation on the second image coordinates P2 (Xp2, Yp2) of the Mark point camera to obtain the second calibration coordinates Pc2 (Xc2, Yc2) of the Mark point camera;

[0077] S40, according to the preset angle driven by the SCARA robot to rotate the camera and the second calibration coordinate, calculate the coordinates of the Mark point in the camera calibration coordinate system at the preset rotation angle, and record it as the third calibration coordinate;

[0078] like Figure 3 As shown, the coordinate system XwOwYw is the SCARA robot world coordinate system, the coordinate system X1O1Y1 is the camera calibration coordinate system, the coordinate system X2O2Y2 is the camera calibration coordinate system after rotation, and the coordinate system X3O3Y3 is the coordinate system X2O2Y2 after rotation by an angle of -R.

[0079] Furthermore, in step S40, the calculation formula of the third calibration coordinate is:

[0080] Xc3=(Xc2-Yc2*tan(R))*cos(R)=Xc2*cos(R)-Yc2*sin(R);

[0081] Yc3=(Yc2+Xc2*tan(R))*cos(R)=Yc2*cos(R)+Xc2*sin(R);

[0082] Among them, (Xc3, Yc3) represents the third calibration coordinate, (Xc2, Yc2) represents the second calibration coordinate, and R represents the rotation angle.

[0083] S50, calculating the coordinates (Xo2, Yo2) of the origin O2 of the rotated camera calibration coordinate system X2O2Y2 in the coordinate system X1O1Y1 according to the first calibration coordinates and the third calibration coordinates;

[0084] Further, in step S50, the coordinates of the origin of the rotated camera calibration coordinate system on the original camera calibration coordinate system are calculated using the following formula:

[0085] Xo2=Xc3-Xc1;

[0086] Yo2=Yc3-Yc1;

[0087] Among them, (Xc1, Yc1) represents the first calibration coordinates, and (Xc3, Yc3) represents the third calibration coordinates.

[0088] S60, according to the preset rotation angle R, the origin coordinates O1 (0, 0) of the camera calibration coordinate system and the origin coordinates O2 (Xo2, Yo2) of the rotated camera calibration coordinate system, calculate the coordinates of the rotation center (X rotation, Y rotation) to calculate the camera world coordinate system.

[0089] Furthermore, in step S60, the coordinate calculation formula of the rotation center is:

[0090] Xo2-X rotation = (0-X rotation)*cos(R)-(0-Y rotation)*sin(R)

[0091] Yo2-Y rotation = (0-X rotation)*sin(R)+(0-Y rotation)*cos(R)

[0092] Among them, (X rotation, Y rotation) represents the coordinates of the rotation center, O1(0,0) represents the origin coordinates of the camera calibration coordinate system, O2(Xo2, Yo2) represents the origin coordinates of the camera calibration coordinate system after rotation, and R is the rotation angle.

[0093] The beneficial effects of this embodiment are: the difficulty of the calibration method of the SCARA robot terminal camera lies in the calibration of the rotation center. After the rotation axis of the SCARA robot rotates, the camera posture changes, and the camera calibration coordinate system also changes. The process of this solution can calculate the position of the SCARA robot rotation center in the camera calibration coordinate system. Compared with the existing calibration algorithm of the SCARA robot terminal camera, the advantages are: no specific calibration plate is required, which reduces the hardware cost of the visual system; no robot needle, that is, calibration tool, is required, which reduces the hardware cost of the mechanism and saves installation time; there is no need to use the human eye to judge whether the calibration plate mark point is aligned, which reduces the loss of calibration accuracy; because there is no human factor involved in the calibration process, automatic calibration can be achieved. This solution uses the characteristics of the product itself for calibration, which is simple to operate, has high calibration accuracy, high calibration efficiency, saves costs, and improves calibration accuracy.

[0094] like Figure 2 As shown, another embodiment of the present invention is a calibration device for a SCARA robot end camera, comprising:

[0095] The affine transformation matrix calculation module 10 is used to control the SCARA robot to move the camera to take pictures of the Mark points, respectively record the image coordinates of the multi-point camera and the SCARA robot world coordinate system, and calculate the affine transformation matrix;

[0096] The first calibration coordinate calculation module 20 is used to control the camera to take pictures of the Mark point while keeping the camera posture unchanged, record the first image coordinates of the Mark point camera, and perform affine transformation on the first image coordinates of the Mark point camera using an affine transformation matrix to obtain the first calibration coordinates of the Mark point camera;

[0097] The second calibration coordinate calculation module 30 is used to control the SCARA robot to drive the camera to rotate a preset angle, control the camera to take a picture of the Mark point, record the second image coordinates of the Mark point camera, and use the affine transformation matrix to perform affine transformation on the second image coordinates of the Mark point camera to obtain the second calibration coordinates of the Mark point camera;

[0098] The third calibration coordinate calculation module 40 is used to calculate the coordinates of the Mark point in the camera calibration coordinate system at the preset rotation angle according to the preset rotation angle of the camera driven by the SCARA robot and the second calibration coordinate, which is recorded as the third calibration coordinate;

[0099] A rotation origin coordinate calculation module 50, used to calculate the origin coordinates of the rotated camera calibration coordinate system on the original camera calibration coordinate system according to the first calibration coordinates and the third calibration coordinates;

[0100] The rotation center calculation module 60 is used to calculate the coordinates of the rotation center to calculate the camera world coordinate system according to the preset rotation angle, the origin coordinates of the camera calibration coordinate system and the origin coordinates of the rotated camera calibration coordinate system.

[0101] Furthermore, in the affine transformation matrix calculation module 10, the calculated affine transformation matrix is:

[0102] W = P*Tw; where W is the SCARA robot coordinate system, P is the camera image coordinate system, and Tw is the affine transformation matrix;

[0103]

[0104] Among them, Sx is the scale in the X direction, Sy is the scale in the Y direction, phi is the rotation angle, Theta is the tilt angle, Tx is the offset in the X direction, and Ty is the offset in the Y direction;

[0105]

[0106] Where x is the camera calibration coordinate X, y is the camera calibration coordinate Y, x' is the camera image coordinate X, and y' is the camera image coordinate Y.

[0107] Furthermore, in the third calibration coordinate calculation module 40, the calculation formula of the third calibration coordinate is:

[0108] Xc3=(Xc2-Yc2*tan(R))*cos(R)=Xc2*cos(R)-Yc2*sin(R);

[0109] Yc3=(Yc2+Xc2*tan(R))*cos(R)=Yc2*cos(R)+Xc2*sin(R);

[0110] Among them, (Xc3, Yc3) represents the third calibration coordinate, (Xc2, Yc2) represents the second calibration coordinate, and R represents the rotation angle.

[0111] Furthermore, in the rotation origin coordinate calculation module 50, the origin coordinates of the rotated camera calibration coordinate system on the original camera calibration coordinate system are calculated using the following formula:

[0112] Xo2=Xc3-Xc1;

[0113] Yo2=Yc3-Yc1;

[0114] Among them, (Xc1, Yc1) represents the first calibration coordinates, and (Xc3, Yc3) represents the third calibration coordinates.

[0115] Furthermore, in the rotation center calculation module 60, the coordinate calculation formula of the rotation center is:

[0116] Xo2-X rotation = (0-X rotation)*cos(R)-(0-Y rotation)*sin(R)

[0117] Yo2-Y rotation = (0-X rotation)*sin(R)+(0-Y rotation)*cos(R)

[0118] Among them, (X rotation, Y rotation) represents the coordinates of the rotation center, O1(0,0) represents the origin coordinates of the camera calibration coordinate system, O2(Xo2, Yo2) represents the origin coordinates of the camera calibration coordinate system after rotation, and R is the rotation angle.

[0119] It should be noted that technicians in the relevant field can clearly understand that the specific implementation process of the calibration device of the above-mentioned SCARA robot end camera can refer to the corresponding description in the aforementioned method embodiment, and for the convenience and conciseness of the description, it will not be repeated here.

[0120] The calibration device of the SCARA robot end camera can be implemented in the form of a computer program. Figure 4 Runs on the computer device shown.

[0121] See also Figure 4 , Figure 4 5 is a schematic block diagram of a computer device provided in an embodiment of the present application. The computer device 500 may be a terminal or a server, wherein the terminal may be an electronic device with communication functions such as a smart phone, a tablet computer, a laptop computer, a desktop computer, a personal digital assistant, and a wearable device. The server may be an independent server or a server cluster composed of multiple servers.

[0122] See also Figure 4 The computer device 500 includes a processor 502 , a memory and a network interface 505 connected via a system bus 501 , wherein the memory may include a non-volatile storage medium 503 and an internal memory 504 .

[0123] The non-volatile storage medium 503 can store an operating system 5031 and a computer program 5032. The computer program 5032 includes program instructions, and when the program instructions are executed, the processor 502 can execute a calibration method for a SCARA robot end camera.

[0124] The processor 502 is used to provide computing and control capabilities to support the operation of the entire computer device 500 .

[0125] The internal memory 504 provides an environment for the operation of the computer program 5032 in the non-volatile storage medium 503. When the computer program 5032 is executed by the processor 502, the processor 502 can execute a calibration method for the end camera of a SCARA robot.

[0126] The network interface 505 is used to communicate with other devices over the network. Figure 4 The structure shown in the figure is merely a block diagram of a portion of the structure related to the solution of the present application, and does not constitute a limitation on the computer device 500 to which the solution of the present application is applied. The specific computer device 500 may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0127] The processor 502 is used to run a computer program 5032 stored in the memory to implement the calibration method of the SCARA robot end camera as described above.

[0128] It should be understood that in the embodiment of the present application, the processor 502 may be a central processing unit (CPU), and the processor 502 may also be other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. Among them, the general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.

[0129] It can be understood by those skilled in the art that all or part of the processes in the method for implementing the above embodiment can be completed by instructing the relevant hardware through a computer program. The computer program includes program instructions, and the computer program can be stored in a storage medium, which is a computer-readable storage medium. The program instructions are executed by at least one processor in the computer system to implement the process steps of the embodiment of the above method.

[0130] Therefore, the present invention also provides a storage medium. The storage medium may be a computer-readable storage medium. The storage medium stores a computer program, wherein the computer program includes program instructions. When the program instructions are executed by a processor, the processor executes the calibration method of the SCARA robot end camera as described above.

[0131] The storage medium may be a USB flash drive, a mobile hard disk, a read-only memory (ROM), a magnetic disk, or an optical disk, etc., which are computer-readable storage media that can store program codes.

[0132] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in terms of function in the above description. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.

[0133] In the several embodiments provided by the present invention, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of each unit is only a logical function division, and there may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed.

[0134] The steps in the method of the embodiment of the present invention can be adjusted in order, combined and deleted according to actual needs. The units in the device of the embodiment of the present invention can be combined, divided and deleted according to actual needs. In addition, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.

[0135] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a storage medium. Based on this understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, terminal, or network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention.

[0136] The above is only a specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any technician familiar with the technical field can easily think of various equivalent modifications or replacements within the technical scope disclosed by the present invention, and these modifications or replacements should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention shall be based on the protection scope of the claims.

Claims

1. A calibration method for a SCARA robot end camera, characterized in that: Including steps, S10, control the SCARA robot to move the camera to take pictures of the Mark points, record the image coordinates of the multi-point camera and the SCARA robot world coordinate system respectively, and calculate the affine transformation matrix; S20, the camera posture remains unchanged, the camera is controlled to take a picture of the Mark point, the first image coordinates of the Mark point camera are recorded, and the first image coordinates of the Mark point camera are affine transformed by using an affine transformation matrix to obtain the first calibration coordinates of the Mark point camera; S30, after controlling the SCARA robot to drive the camera to rotate by a preset angle, control the camera to take a picture of the Mark point, record the second image coordinates of the Mark point camera, and use the affine transformation matrix to perform affine transformation on the second image coordinates of the Mark point camera to obtain the second calibration coordinates of the Mark point camera; S40, according to the preset angle driven by the SCARA robot to rotate the camera and the second calibration coordinate, calculate the coordinates of the Mark point in the camera calibration coordinate system at the preset rotation angle, and record it as the third calibration coordinate; S50, calculating the origin coordinates of the rotated camera calibration coordinate system on the original camera calibration coordinate system according to the first calibration coordinates and the third calibration coordinates; S60, calculating the coordinates of the rotation center to calculate the camera world coordinate system according to the preset rotation angle, the origin coordinates of the camera calibration coordinate system and the origin coordinates of the camera calibration coordinate system after rotation; In step S10, the calculated affine transformation matrix is, W=P *Tw; where W is the SCARA robot coordinate system, P is the camera image coordinate system, and Tw is the affine transformation matrix; ; Among them, Sx is the scale in the X direction, Sy is the scale in the Y direction, phi is the rotation angle, Theta is the tilt angle, Tx is the offset in the X direction, and Ty is the offset in the Y direction; ; Where x is the camera calibration coordinate X, y is the camera calibration coordinate Y, x' is the camera image coordinate X, and y' is the camera image coordinate Y.

2. The calibration method of the SCARA robot end camera according to claim 1, characterized in that: In step S40, the calculation formula of the third calibration coordinate is: Xc3=(Xc2-Yc2*tan(R))*cos(R)=Xc2*cos(R)-Yc2*sin(R); Yc3=(Yc2+Xc2*tan(R))*cos(R)=Yc2*cos(R)+Xc2*sin(R); Wherein, (Xc3, Yc3) represents the third calibration coordinate, (Xc2, Yc2) represents the second calibration coordinate, and R represents the rotation angle.

3. The calibration method of the SCARA robot end camera as claimed in claim 2, characterized in that: In step S50, the coordinates of the origin of the rotated camera calibration coordinate system on the original camera calibration coordinate system are calculated using the following formula: Xo2=Xc3-Xc1; Yo2=Yc3-Yc1; Wherein, (Xc1, Yc1) represents the first calibration coordinate, and (Xc3, Yc3) represents the third calibration coordinate.

4. The calibration method of the SCARA robot end camera as claimed in claim 3, characterized in that: In step S60, the coordinate calculation formula of the rotation center is: Xo2-X rotation = (0-X rotation)*cos(R)-(0-Y rotation)*sin(R); Yo2-Y rotation = (0-X rotation)*sin(R)+(0-Y rotation)*cos(R); Among them, (X rotation, Y rotation) represents the coordinates of the rotation center, O1(0,0) represents the origin coordinates of the camera calibration coordinate system, O2 (Xo2, Yo2) represents the origin coordinates of the camera calibration coordinate system after rotation, and R is the rotation angle.

5. A calibration device for a SCARA robot end camera, characterized in that: include, The affine transformation matrix calculation module is used to control the SCARA robot to move the camera to take pictures of the Mark points, record the image coordinates of the multi-point camera and the SCARA robot world coordinate system, and calculate the affine transformation matrix; The first calibration coordinate calculation module is used to control the camera to take pictures of the Mark point while keeping the camera posture unchanged, record the first image coordinates of the Mark point camera, and perform affine transformation on the first image coordinates of the Mark point camera using an affine transformation matrix to obtain the first calibration coordinates of the Mark point camera; The second calibration coordinate calculation module is used to control the SCARA robot to drive the camera to rotate a preset angle, control the camera to take a picture of the Mark point, record the second image coordinates of the Mark point camera, and use the affine transformation matrix to perform affine transformation on the second image coordinates of the Mark point camera to obtain the second calibration coordinates of the Mark point camera; The third calibration coordinate calculation module is used to calculate the coordinates of the Mark point in the camera calibration coordinate system at the preset rotation angle according to the preset rotation angle of the camera driven by the SCARA robot and the second calibration coordinate, which is recorded as the third calibration coordinate; A rotation origin coordinate calculation module, used to calculate the origin coordinates of the rotated camera calibration coordinate system on the original camera calibration coordinate system according to the first calibration coordinates and the third calibration coordinates; A rotation center calculation module, used to calculate the coordinates of the rotation center to calculate the camera world coordinate system according to the preset rotation angle, the origin coordinates of the camera calibration coordinate system and the origin coordinates of the rotated camera calibration coordinate system; In the affine transformation matrix calculation module, the calculated affine transformation matrix is: W=P *Tw; where W is the SCARA robot coordinate system, P is the camera image coordinate system, and Tw is the affine transformation matrix; ; Among them, Sx is the scale in the X direction, Sy is the scale in the Y direction, phi is the rotation angle, Theta is the tilt angle, Tx is the offset in the X direction, and Ty is the offset in the Y direction; ; Where x is the camera calibration coordinate X, y is the camera calibration coordinate Y, x' is the camera image coordinate X, and y' is the camera image coordinate Y.

6. The calibration device for the SCARA robot end camera as claimed in claim 5, characterized in that: In the third calibration coordinate calculation module, the calculation formula of the third calibration coordinate is: Xc3=(Xc2-Yc2*tan(R))*cos(R)=Xc2*cos(R)-Yc2*sin(R); Yc3=(Yc2+Xc2*tan(R))*cos(R)=Yc2*cos(R)+Xc2*sin(R); Wherein, (Xc3, Yc3) represents the third calibration coordinate, (Xc2, Yc2) represents the second calibration coordinate, and R represents the rotation angle.

7. The calibration device for the SCARA robot end camera according to claim 6, characterized in that: In the rotation origin coordinate calculation module, the origin coordinates of the rotated camera calibration coordinate system on the original camera calibration coordinate system are calculated, and the calculation formula is: Xo2=Xc3-Xc1; Yo2=Yc3-Yc1; Wherein, (Xc1, Yc1) represents the first calibration coordinate, and (Xc3, Yc3) represents the third calibration coordinate.

8. The calibration device for the SCARA robot end camera according to claim 7, characterized in that: In the rotation center calculation module, the coordinate calculation formula of the rotation center is: Xo2-X rotation = (0-X rotation)*cos(R)-(0-Y rotation)*sin(R); Yo2-Y rotation = (0-X rotation)*sin(R)+(0-Y rotation)*cos(R); Among them, (X rotation, Y rotation) represents the coordinates of the rotation center, O1(0,0) represents the origin coordinates of the camera calibration coordinate system, O2 (Xo2, Yo2) represents the origin coordinates of the camera calibration coordinate system after rotation, and R is the rotation angle.

Citation Information

Patent Citations

  • PCB board positioning method based on SCARA robot

    CN105451461A

  • High-precision method for hand-eye calibration of fixed camera vision system of SCARA mechanical arm

    CN109159114A