MATLAB Computer Vision Toolbox Camera Calibration Notes P. McGill 26Oct21 * According to page 13-15 of the Computer Vision Toolbox User's Guide, the algorithm assigns the long side of the checkerboard pattern to the x direction and the short side to the y direction. Positive values are to the right for x and down for y. Z positive is away from the camera. * The origin of the pattern is the inside corner (i.e. not the three on the outside edges) of the black square that is leftmost in x and highest in y (i.e. x = 0, y = 0) * The coordinate system for the camera is the same but the origin is the optical center of the camera, i.e. x = 0 and y = 0 is the center pixel of the image, where x positive is right and y positive is down. * The camera extrinsic parameters describe the location and orientation of the target origin with respect to the camera origin using translation and rotation vectors. * The translation vector lists the x, y, and z offset in millimeters of the target origin from the camera origin. For x and y, these are the distances from the center pixel of the image. For z, it's the distance of the target origin from the pinhole camera's pinhole according to page 8 of the camera calibration book chapter published by Zhang. --- The following 3 paragraphs may be incorrect! * The rotation vector lists the rotation of the target in radians about the x, y, and z axes. According to other MATLAB documentation at https://www.mathworks.com/help/lidar/ug/lidar-coordinate-systems.html "The yaw, pitch, and roll angles of sensors follow an ISO convention. These angles are clockwise-positive when looking in the positive direction of the z-, y-, and x-axes, respectively." * The z rotation is the how far the target x and y axes are rotated relative to the camera x and y. Since the camera is x positive right and y positive down, and the target was mounted to the handle with x positive up and y positive right, all the cal images have about -90 degrees of rotation for the 21Jun21 images. * The target x and y rotation are relative to their z-rotated positions, so for our 21Jun21 images, a positive x rotation will move the left side of the target towards the camera and the right side away. --- End of possibly incorrect section * According to Appendix A of "Camera Calibration" by Carlo Tomasi (https://courses.cs.duke.edu/fall16/cps274/notes/calibration.pdf), the rotation vector is a shorthand notation for the rotation matrix. It condenses the 9 elements of a rotation matrix down to 3 elements. Those 3 elements represent a vector, the direction of which is the axis of rotation and the magnitude of which represents the amount of CCW rotation in radians (always between 0 and Pi). * There is a Mathematica function called RotationMatrix that will convert the rotation vector into a rotation matrix.