CN-116934866-B - Camera calibration method of robot
Abstract
The application discloses a camera calibration method of a robot, when the robot performs camera internal and external parameter calibration, the camera internal parameter is optimized through the image of the calibration plate of the calibration jig, the accuracy of the camera is improved, and then the camera external parameter is calibrated through the pose of the camera relative to each calibration plate obtained according to the image of the calibration plate of the same calibration jig and the pose of the calibration plate of the calibration jig relative to the center point of the calibration jig, so that the robot can finish the calibration of the camera internal parameter and the camera external parameter through the same calibration jig in one camera calibration operation, the time for calibrating the camera internal parameter and the camera external parameter is shortened, the mass production efficiency of the robot is improved, the calibration jig and the robot do not need to be moved, and the practicability is higher.
Inventors
- LAI QINWEI
Assignees
- 珠海一微半导体股份有限公司
Dates
- Publication Date
- 20260505
- Application Date
- 20230707
Claims (8)
- 1. A camera calibration method for a robot, the method comprising the steps of: s1, a robot acquires an image of a calibration plate of a calibration jig through a camera, and then identifies a calibration point from the image of the calibration plate; S2, calibrating internal parameters of the cameras and acquiring the pose of the cameras relative to each calibration plate by the robot according to the positions of the calibration points on the calibration plate and the positions of the calibration points in the images; S3, calibrating external parameters of the cameras by the robot through the pose of the calibration plate of the calibration jig relative to the center point of the calibration jig and the pose of the cameras relative to each calibration plate; In step S2, the robot calibrates internal parameters of the camera and obtains the pose of the camera relative to each calibration plate according to the position of the calibration point on the calibration plate and the position of the calibration point in the image, including the following steps: the robot obtains physical coordinates of a calibration point on a physical coordinate system of the calibration plate and pixel coordinates of the calibration point in the image on the image; The robot projects the calibration points on the calibration plates into the images of the calibration plates according to the initial pose of each calibration plate relative to the center point of the robot and the initial internal reference of the camera to obtain projection coordinates of the calibration points of the calibration plates; The robot calculates the Euclidean distance between the projection coordinates of the calibration point of the calibration plate and the pixel coordinates of the calibration point in the image corresponding to the calibration point according to the Euclidean distance formula; and optimizing the internal parameters of the camera by the robot according to the acquired Euclidean distance through an iterative formula of a Gaussian Newton method to obtain the optimal internal parameters of the camera and the pose of the camera relative to each calibration plate.
- 2. The method for calibrating a camera of a robot according to claim 1, wherein in step S1, the robot acquires an image having a plurality of calibration plates through the camera, comprising the steps of: The robot moves into a calibration jig formed by a plurality of calibration plates, and then the center point of the robot coincides with the center point of the calibration jig; The robot makes the camera vertically upwards, then obtains the image that has all calibration boards of calibration tool through the camera.
- 3. The method for calibrating a camera of a robot according to claim 2, wherein in step S1, the robot identifies a calibration point from an image of a calibration plate, comprising the steps of: The robot detects a quadrilateral black area in the image of the calibration plate; the robot connects the detected quadrilateral black areas in a clockwise direction; the robot acquires an inner quadrangle of a black area of the quadrangle; The robot uses four endpoints of the inner quadrangle as calibration points of the calibration plate through angular point detection; The calibration plate is a checkerboard calibration plate, and four sides of the inner quadrangle are respectively connected with the black areas of the quadrangle.
- 4. The camera calibration method of the robot according to claim 3, wherein when the robot optimizes the internal parameters of the camera through an iterative formula of a gauss newton method, and a minimum euclidean distance is obtained in a calculation process, the pose of each calibration plate corresponding to the minimum euclidean distance and the central point of the robot and the internal parameters of the camera are used as the optimal internal parameters of the camera and the pose of the camera relative to each calibration plate.
- 5. A camera calibration method for a robot according to claim 3, wherein the robot acquires an initial pose of the calibration plate relative to a center point of the robot, comprising the steps of: The robot passes through the corner point of the upper left corner of the calibration plate and makes a vertical line perpendicular to the calibration plate; the robot takes an included angle between a vertical line vertical to the calibration plate and the advancing direction of the robot as an included angle between the calibration plate and the robot; The robot obtains the distance between the center point of the robot and the corner point of the upper left corner of the calibration plate; and the robot combines according to the included angle between the calibration plate and the robot and the distance between the center point of the robot and the corner point of the upper left corner of the calibration plate to obtain the initial pose of the calibration plate relative to the center point of the robot.
- 6. A camera calibration method for a robot according to claim 3, wherein the robot obtains physical coordinates of the calibration point on a physical coordinate system of the calibration plate, comprising the steps of: the robot takes the corner point of the upper left corner of each calibration plate as an origin, and two sides of the calibration plate connected with the corner point of the upper left corner are respectively an X axis and a Y axis to construct a physical coordinate system; And the robot acquires the coordinates of the calibration point on the physical coordinate system according to the position of the calibration point on the calibration plate.
- 7. The method for calibrating a camera of a robot according to claim 6, wherein in step S3, the robot calibrates the external parameters of the camera by the pose of the calibration plate of the calibration jig with respect to the center point of the calibration jig and the pose of the camera with respect to each calibration plate, comprising the steps of: The robot obtains a rotation matrix of the position and the posture of a calibration plate of the calibration jig relative to the center point of the calibration jig; the robot obtains a rotation matrix of the pose of the camera relative to one of the calibration plates; and converting the rotation matrix of the pose of the calibration plate of the calibration jig relative to the central point of the calibration jig and the rotation matrix of the pose of the camera relative to one of the calibration plates by the robot according to an Euler formula to obtain an external parameter matrix of the camera.
- 8. The camera calibration method of the robot according to claim 7, wherein the robot obtains the pose of the calibration plate of the calibration jig relative to the center point of the calibration jig before the camera calibration, and the method comprises the following steps: The robot enables the calibration plates to be in the shooting range of the camera, then moves to different preset positions to obtain images of a plurality of calibration plates, and obtains IMU data during movement; The robot identifies a calibration point from the acquired image of the calibration plate, and then calculates the pose of the camera relative to the calibration plate at different preset positions by adopting a nonlinear optimization algorithm according to the identified calibration point; according to IMU data and the pose of the camera relative to the calibration plate at different preset positions, the robot calculates the pose of the camera relative to the central point of the robot by adopting a nonlinear optimization algorithm; The robot moves into a calibration jig formed by a plurality of calibration plates, and then the position of the center point of the current robot is set as the center point of the calibration jig; the robot makes the camera vertically upwards, then obtains images of all calibration plates with the calibration jig through the camera, and identifies the calibration points from the images of the calibration plates; the robot obtains the pose of the camera relative to each calibration plate according to the positions of the calibration points on the calibration plate and the positions of the calibration points in the image; and the robot acquires the pose of the calibration plate of the calibration jig relative to the center point of the calibration jig in a matrix transformation mode according to the pose of the camera relative to each calibration plate and the pose of the camera relative to the center point of the robot.
Description
Camera calibration method of robot Technical Field The invention relates to the technical field of cameras, in particular to a camera calibration method of a robot. Background In the fields of computer vision and graphics, external parameter calibration is required to be carried out on a camera for security monitoring, interactive somatosensory games, automatic driving, environment 3D modeling and other application scenes, so that the mapping of the position relation between a real physical space and the view field of the camera is realized. For example, for a robot, a camera is an important device for the robot to acquire external information, and in order for the robot to acquire an accurate position of the external information based on its own coordinate system, the camera needs to be calibrated with internal and external parameters. At present, when the internal and external parameters of the camera of the robot are calibrated, different calibration jigs are required to be replaced to calibrate the internal parameters and the external parameters of the camera separately, so that the speeds of calibrating the external parameters and the internal parameters of the camera of the robot are reduced. Disclosure of Invention In order to solve the problems, the invention provides a camera calibration method of a robot. The specific technical scheme of the invention is as follows: A camera calibration method of a robot comprises the following steps of S1, enabling the robot to obtain images of calibration plates of a calibration jig through the camera, then identifying calibration points from the images of the calibration plates, S2, calibrating internal parameters of the camera and obtaining pose of the camera relative to each calibration plate according to positions of the calibration points on the calibration plates and positions of the calibration points in the images on the images, and S3, calibrating external parameters of the camera through pose of the calibration plates of the calibration jig relative to center points of the calibration jig and pose of the camera relative to each calibration plate. Further, in the step S1, the robot acquires images with a plurality of calibration plates through the camera, and the method comprises the steps of moving the robot into a calibration jig formed by the plurality of calibration plates, enabling the center point of the robot to coincide with the center point of the calibration jig, enabling the camera to vertically upwards, and acquiring the images with all the calibration plates of the calibration jig through the camera. Further, in step S1, the robot identifies a calibration point from an image of the calibration plate, and the method comprises the steps of detecting a black area of a quadrangle in the image of the calibration plate by the robot, connecting the detected black area of the quadrangle by the robot in a clockwise direction, acquiring an inner quadrangle of the black area of the quadrangle by the robot, and taking four endpoints of the inner quadrangle as the calibration point of the calibration plate by the robot through angular point detection, wherein the calibration plate is a checkerboard calibration plate, and four sides of the inner quadrangle are respectively connected with the black area of the quadrangle. Further, in step S2, the robot calibrates internal parameters of the camera and obtains the pose of the camera relative to each calibration plate according to the position of the calibration point on the calibration plate and the position of the calibration point in the image, and the method comprises the following steps that the robot obtains the physical coordinates of the calibration point on the physical coordinate system of the calibration plate and the pixel coordinates of the calibration point in the image, the robot projects the calibration point on the calibration plate to the image of the calibration plate according to the initial pose of each calibration plate relative to the central point of the robot and the initial internal parameters of the camera to obtain the projection coordinates of the calibration point of the calibration plate, the robot calculates the Euclidean distance between the projection coordinates of the calibration point of the calibration plate and the pixel coordinates of the calibration point in the image corresponding to the calibration point according to the Euclidean distance, and the robot optimizes the internal parameters of the camera relative to each calibration plate through the iteration formula of the Gaussian Newton method according to the obtained Euclidean distance to obtain the optimal camera internal parameters and the pose of the camera relative to each calibration plate. Further, when the robot optimizes the internal parameters of the camera through the iterative formula of the Gauss Newton method and obtains the minimum Euclidean distance in the calculation process, the pose of each cali