Struct CameraCalibration¶
Defined in File schemas.hpp
Struct Documentation¶
-
struct CameraCalibration¶
Camera calibration parameters.
Public Members
-
std::string frame_id¶
Frame of reference for the camera. The origin of the frame is the optical center of the camera. +x points to the right in the image, +y points down, and +z points into the plane of the image.
-
uint32_t width = 0¶
Image width.
-
uint32_t height = 0¶
Image height.
-
std::string distortion_model¶
Name of distortion model.
Supported parameters:
plumb_bob
(k1, k2, p1, p2, k3),rational_polynomial
(k1, k2, p1, p2, k3, k4, k5, k6), andkannala_brandt
(k1, k2, k3, k4).plumb_bob
andrational_polynomial
models are based on the pinhole model OpenCV’s pinhole camera model. Thekannala_brandt
model is matches the OpenvCV fisheye model.
-
std::vector<double> d¶
Distortion parameters.
-
std::array<double, 9> k¶
Intrinsic camera matrix (3x3 row-major matrix)
A 3x3 row-major matrix for the raw (distorted) image.
Projects 3D points in the camera coordinate frame to 2D pixel coordinates using the focal lengths (fx, fy) and principal point (cx, cy).
@brief [fx 0 cx] @brief K = [ 0 fy cy] @brief [ 0 0 1] @brief
-
std::array<double, 9> r¶
Rectification matrix (stereo cameras only, 3x3 row-major matrix)
A rotation matrix aligning the camera coordinate system to the ideal stereo image plane so that epipolar lines in both stereo images are parallel.
-
std::array<double, 12> p¶
Projection/camera matrix (3x4 row-major matrix)
@brief [fx' 0 cx' Tx] @brief P = [ 0 fy' cy' Ty] @brief [ 0 0 1 0] @brief
By convention, this matrix specifies the intrinsic (camera) matrix of the processed (rectified) image. That is, the left 3x3 portion is the normal camera intrinsic matrix for the rectified image.
It projects 3D points in the camera coordinate frame to 2D pixel coordinates using the focal lengths (fx’, fy’) and principal point (cx’, cy’) - these may differ from the values in K.
For monocular cameras, Tx = Ty = 0. Normally, monocular cameras will also have R = the identity and P[1:3,1:3] = K.
For a stereo pair, the fourth column [Tx Ty 0]’ is related to the position of the optical center of the second camera in the first camera’s frame. We assume Tz = 0 so both cameras are in the same stereo image plane. The first camera always has Tx = Ty = 0. For the right (second) camera of a horizontal stereo pair, Ty = 0 and Tx = -fx’ * B, where B is the baseline between the cameras.
Given a 3D point [X Y Z]’, the projection (x, y) of the point onto the rectified image is given by:
@brief [u v w]' = P * [X Y Z 1]' @brief x = u / w @brief y = v / w @brief
This holds for both images of a stereo pair.
-
std::string frame_id¶