CN-116912325-B - Camera external parameter calibration method based on calibration jig, chip and robot
Abstract
The invention discloses a camera external parameter calibration method based on a calibration jig, a chip and a robot, wherein the robot acquires the pose of a calibration plate of the calibration jig relative to the center point of the calibration jig in advance; the robot obtains the external parameters of the robot according to the image of the calibration plate and the pose of the calibration plate of the calibration jig relative to the central point of the calibration jig, the calibration jig is not required to be set, the time for the robot to calibrate the external parameters of the camera is shortened, and the efficiency of calibrating the external parameters of the camera is improved.
Inventors
- LAI QINWEI
Assignees
- 珠海一微半导体股份有限公司
Dates
- Publication Date
- 20260505
- Application Date
- 20230707
Claims (9)
- 1. The camera external parameter calibration method based on the calibration jig is characterized by comprising the following steps of: s1, a robot acquires the pose of a calibration plate of a calibration jig relative to the center point of the calibration jig in advance; S2, the robot moves into the calibration jig, then an image of a calibration plate of the calibration jig is obtained through a camera, and a calibration point is identified from the image of the calibration plate; S3, 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; s4, 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 S3, the robot 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 on 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 camera external parameter calibration method based on the calibration jig according to claim 1, wherein in step S1, the robot obtains in advance the pose of the calibration plate of the calibration jig relative to the center point of the calibration jig, 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.
- 3. The camera external parameter calibration method based on the calibration jig according to claim 2, wherein in the step S2, the robot moves into the calibration jig, then the image of the calibration plate of the calibration jig is obtained through the camera, and the method comprises the following steps that the robot moves into the 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.
- 4. The camera external parameter calibration method based on the calibration jig according to claim 3, wherein in step S2, the robot identifies a calibration point from an image of the 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.
- 5. The camera external reference calibration method based on the calibration jig according to claim 4, wherein when the robot optimizes the internal reference 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 reference of the camera are used as the optimal camera internal reference and the pose of the camera relative to each calibration plate.
- 6. The camera external parameter calibration method based on the calibration jig according to claim 4, wherein the robot obtains physical coordinates of the calibration point on a physical coordinate system of the calibration plate, and the method comprises the following steps: 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 camera external parameter calibration method based on the calibration jig according to claim 4, wherein the robot calibrates the external parameters of the camera by the pose of the calibration plate of the calibration jig relative to the center point of the calibration jig and the pose of the camera relative to each calibration plate, comprising the following steps: 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. A chip for storing a program, characterized in that the program is configured to execute the camera external parameter calibration method based on the calibration jig according to any one of claims 1 to 7.
- 9. A mobile robot comprising a master control chip, wherein the master control chip is the chip of claim 8.
Description
Camera external parameter calibration method based on calibration jig, chip and robot Technical Field The invention relates to the technical field of robots, in particular to a camera external parameter calibration method based on a calibration jig, a chip and 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 external parameters. At present, when the same calibration jig is adopted to calibrate cameras of different robots, a user needs to adjust the calibration jig according to the conditions of the robots, so that more time is consumed for calibrating the robots. Disclosure of Invention In order to solve the problems, the invention provides a camera external parameter calibration method, a chip and a robot based on a calibration jig. The specific technical scheme of the invention is as follows: A camera external parameter calibration method based on a calibration jig comprises the following steps of S1, a robot pre-obtaining the pose of a calibration plate of the calibration jig relative to the center point of the calibration jig, S2, moving the robot into the calibration jig, then obtaining an image of the calibration plate of the calibration jig through the camera, identifying the calibration point from the image of the calibration plate, S3, obtaining 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 S4, calibrating the external parameter of the camera 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 camera relative to each calibration plate. Further, in step S1, the robot obtains the pose of the calibration plate of the calibration jig relative to the center point of the calibration jig in advance, the robot enables the calibration plate to be in the shooting range of the camera, then moves to different preset positions to obtain images of a plurality of calibration plates, IMU data are obtained during movement, the robot identifies the calibration points from the obtained images of the calibration plates, then calculates the pose of the camera relative to the calibration plate at different preset positions according to the identified calibration points by adopting a nonlinear optimization algorithm, calculates the pose of the camera relative to the center point of the robot according to IMU data and the pose of the camera relative to the calibration plate at different preset positions, the robot moves to the calibration jig formed by a plurality of calibration plates, then positions of the center point of the current robot are set as the center point of the calibration jig, the robot enables the camera to obtain images of all the calibration plates of the calibration jig, and the calibration points of the calibration jig are identified from the identified calibration points, the pose of the camera relative to the center point of the camera is obtained by adopting a mode that the pose of the camera relative to the center point of the calibration plate of the robot, and the pose of the camera relative to the calibration plate of the camera is obtained by adopting the mode of the camera relative to the pose of the camera relative to the center point of the calibration plate. Further, in the step S2, the robot moves into the calibration jig, then the camera acquires images of the calibration plates of the calibration jig, and the method comprises the steps of moving the robot into the calibration jig formed by a plurality of calibration plates, then enabling the center point of the robot to coincide with the center point of the calibration jig, enabling the camera to vertically upwards, and then acquiring the images of all the calibration plates with the calibration jig through the camera. Further, in step S2, the robot identifies a calibration point from an image of the calibration plate, and the method comprises the steps that the robot detects a black area of a quadrilateral in the image of the calibration plate, the robot connects the detected black area of the quadrilateral in a clockwise direction, the robot obtains an inner quadrilateral of the black area of the quadrilateral, the robot takes four endpoints of the inner quadrilateral as the calibration point of the calibrat