What is the correspondence between the parameters produced by camera_calibrator and camera_info?

asked 2020-04-20 09:24:00 -0500

LukeAI gravatar image

The ROS camera_calibration package outputs a YAML file containing:

image_width, image_height, camera_name,

distortion_model, distortion_coefficients

camera_matrix (9 elements),

rectification_matrix (9 elements = Identity for my monocular camera),

projection_matrix (12 elements)

The camera_info message contains:

width, height,

distortion_model, D

K (9 elements) - "Intrinsic camera matrix for the raw (distorted) images"

R (9 elements) - "Rectification matrix (stereo cameras only) A rotation matrix aligning the camera coordinate system to the ideal stereo image plane so that epipolar lines in both stereo images are parallel."

P (12 elements) - "intrinsic matrix of the processed (rectified) image.... Normally, monocular cameras will also have R = the identity and P[1:3,1:3] = K"

Problem

I want to efficiently publish this YAML as camera_info. but I can't find documentation on what exactly, the relationship between the YAML file and the camera_info message is.

At a glance it looks like camera_matrix = K, rectification_matrix=R, projection_matrix=P

but P[1:3,1:3] = K is not true for the params I have for my monocular camera, which suggests this isn't quite right.

Question

What is the correspondence between these two sets of params?

Or: What exactly are camera_matrix, rectification_matrix, projection_matrix?

edit retag flag offensive close merge delete