A non-transitory computer-readable medium having instructions stored thereon that, when executed by a control circuit of a robot control system, causes the control circuit to perform camera calibration by:
- generating a movement command for outputting to a communication interface of the robot control system, wherein the communication interface is configured to communicate with a robot having a base and a robot arm with a calibration pattern disposed thereon, and with a camera having a camera field of view;
- outputting the movement command to the communication interface, wherein the communication interface is configured to communicate the movement command to the robot to cause the robot arm to move the calibration pattern to at least one location in the camera field of view;
- receiving a calibration image from the communication interface, wherein the communication interface is configured to receive the calibration image from the camera, the calibration image being an image of the calibration pattern at the at least one location in the camera field of view, and wherein the calibration pattern includes a plurality of pattern elements having respective defined pattern element locations in a pattern coordinate system, wherein the pattern coordinate system is a coordinate system defined with respect to a location and orientation of the calibration pattern;
- determining a plurality of image pattern element locations from the calibration image, wherein the plurality of image pattern element locations indicate respective locations at which the plurality of pattern elements appear in the calibration image;
- determining a first estimate of a first intrinsic camera parameter based on the plurality of image pattern element locations and based on the defined pattern element locations;
- determining after the first estimate of the first intrinsic camera parameter has been determined, a first estimate of a second intrinsic camera parameter based on the first estimate of the first intrinsic camera parameter and based on the plurality of image pattern element locations;
- determining a second estimate of the first intrinsic camera parameter and a second estimate of the second intrinsic camera parameter based on the first estimate of the second intrinsic camera parameter, and based on the plurality of image pattern element locations and the defined pattern element locations;
- and
- determining, based on the second estimate of the first intrinsic camera parameter and the second estimate of the second intrinsic camera parameter, an estimate of a transformation function that describes a relationship between a camera coordinate system and a world coordinate system, wherein the camera coordinate system is a coordinate system defined with respect to a location and orientation of the camera that the communication interface is configured to communicate with, and the world coordinate system is a coordinate system defined with respect to a location that is stationary relative to the base of the robot that the communication interface is configured to communicate with,
- wherein the instructions, when executed by the control circuit, further cause the control circuit, after the camera calibration is performed, to receive a subsequent image from the communication interface, wherein the communication interface is configured to receive the subsequent image from the camera, and wherein the instructions, when executed by the control circuit, further cause the control circuit to control placement of the robot arm of the robot that the communication interface is configured to communicate with by outputting to the robot a subsequent movement command that is based on the subsequent image and based on the estimate of the transformation function.