Glossary

Camera calibration (intrinsic / extrinsic)

Camera calibration – definition

Camera calibration is the process of estimating the mathematical parameters that relate a three-dimensional point in the environment to a pixel in a camera image. In mobile robotics, calibration has two connected parts: intrinsic calibration and extrinsic calibration. Intrinsic parameters are needed to interpret image geometry, while an extrinsic transform is needed when camera data must be related to LiDAR, IMU, wheel odometry, GNSS/RTK, another camera, or another robot frame.

Intrinsic calibration describes the internal imaging model of one camera. It includes focal lengths, principal point coordinates, and lens distortion coefficients; the associated image dimensions are also recorded in camera calibration data. Extrinsic calibration describes the rigid-body transformation between the camera coordinate frame and another robot frame, such as base_link, imu_link, or a LiDAR frame.

For an unmanned ground vehicle (UGV), calibration determines whether visual detections can be placed correctly in the robot frame, map frame, or odometry frame. A depth camera mounted on Leo Rover or Raph Rover can publish image data without a complete calibration and transform setup, but navigation, perception fusion, visual odometry, and metric obstacle positions depend on correct camera parameters and transforms.

Intrinsic camera parameters

The pinhole camera model maps a point expressed in the camera optical frame, (X, Y, Z), to pixel coordinates (u, v). The basic projection equation is:

u = fx * X / Z + cx
v = fy * Y / Z + cy

In this model, fx and fy are focal lengths expressed in pixels. cx and cy define the principal point. Real lenses also introduce distortion, especially at wide fields of view. ROS camera drivers normally provide these values in the sensor_msgs/msg/CameraInfo message.

The ROS CameraInfo interface contains the data needed by image-processing nodes. Its main calibration fields are:

Field Purpose ROS 2 meaning
width, height Calibrated image dimensions Must match the image stream used by the consumer node.
distortion_model Lens model identifier Common values include plumb_bob and equidistant.
d Distortion coefficients Coefficient order depends on the selected distortion model.
k 3 × 3 intrinsic matrix Contains fx, fy, cx, and cy.
r, p Rectification and projection matrices Used particularly by stereo and rectified image pipelines.

A calibration is valid only for the camera mode for which it was created. Changing resolution, binning, crop region, focus, lens, or driver-side image scaling requires appropriately adjusted or newly estimated parameters. The CameraInfo header timestamp should correspond to the image timestamp, and its frame_id should identify the camera optical frame.

Extrinsic calibration and ROS 2 coordinate frames

Extrinsic calibration estimates the translation and rotation between two coordinate frames. It is commonly represented as a homogeneous transformation matrix:

T_target_source = [ R  t ]
                  [ 0  1 ]

Here, R is a 3 × 3 rotation matrix and t is a translation vector. In ROS 2, this relationship is distributed through tf2. Static sensor mounts are usually published on /tf_static, while transforms that change over time are published on /tf.

REP 103 defines the preferred camera optical-frame convention: z points forward along the optical axis, x points right in the image, and y points down. REP 105 defines commonly used mobile-robot frames, including map, odom, and base_link. A camera integration should preserve a connected transform tree from the camera frame to base_link.

ros2 run tf2_ros static_transform_publisher \
  0.18 0.00 0.24 0 0 0 1 \
  base_link camera_link

The values above are an example only. They must be replaced with measured or calibrated translation and orientation values for the actual camera mount.

Calibration workflow for mobile UGVs

Intrinsic and extrinsic calibration should be treated as separate validation tasks. Intrinsics can often be supplied by a camera manufacturer or estimated from images of a known calibration target. Extrinsics must be verified after the sensor payload is installed on the UGV.

A practical workflow for Leo Rover or Raph Rover includes the following steps:

  • Fix the camera mount mechanically before collecting calibration data.
  • Publish the raw image and matching camera_info stream.
  • Estimate or load intrinsic parameters for the exact image mode.
  • Define the camera link and optical frame in URDF or publish a static tf2 transform.
  • Measure or optimize the camera-to-base_link transform.
  • Validate projected LiDAR points, depth measurements, or visual landmarks against the image.

On Leo Rover, the default Raspberry Pi compute unit can publish and consume standard ROS 2 image and transform messages, but high-resolution stereo processing, dense visual SLAM, or multi-sensor optimization may require an external compute payload. The supported ROS 2 distribution, driver, and calibration procedure depend on the installed software image and the attached camera.

Raph Rover is intended for payload configurations requiring greater capacity. Its larger sensor payload does not remove the need for calibration. In fact, a camera, LiDAR, and GNSS/RTK installation with separate mounting brackets can require careful frame definition because a small angular error can create a large position error at longer perception ranges.

Camera calibration in perception and navigation

Calibration affects several ROS 2 perception pipelines. Stereo depth requires accurate intrinsics and stereo baseline geometry. RGB-D mapping requires alignment between color and depth streams. Camera-LiDAR fusion requires both time synchronization and a correct camera-to-LiDAR transform. Visual-inertial odometry additionally depends on the camera-to-IMU transform and timestamp consistency.

For differential-drive platforms such as Leo Rover, camera calibration does not replace wheel odometry, IMU integration, or a navigation stack. It enables camera-derived observations to be expressed in the same coordinate system as those inputs. A robot can then use calibrated visual data for obstacle classification, fiducial detection, terrain observation, or map enrichment.

Normative references and technical sources

The following primary documentation defines the ROS concepts used in camera calibration and mobile-robot frame integration:

See also