Camera Calibration

Open in ClaudeOpen in ChatGPT

Overview

ZED cameras undergo an extensive and rigorous multi-step factory calibration process to ensure accurate camera parameter estimation. This calibration defines key characteristics such as focal length, field of view, and stereo alignment, which are essential for various computer vision and imaging applications.

This applies to both stereo cameras (ZED, ZED Mini, ZED 2, ZED 2i, ZED X, ZED X Mini, ZED X Nano) and monocular cameras (ZED X One), which are factory-calibrated for their intrinsic parameters.

The ZED and ZED 2 cameras are out of production and may no longer be supported by newer versions of the ZED SDK.

The following parameters can be retrieved for each eye and resolution:

  • Focal length: fx, fy.
  • Principal point (optical center): cx, cy.
  • Lens distortion, depending on the lens model: radial-tangential (Brown-Conrady) uses radial coefficients k1k6, tangential coefficients p1, p2, and thin-prism coefficients s1s4, while fisheye uses k1k4.
  • Field of view: horizontal (h_fov), vertical (v_fov), and diagonal (d_fov).
  • Stereo transform between the left and right eye (stereo cameras only): baseline, translation (TY, TZ), and rotation — optical convergence (CV/RY), RX, and RZ.

The Calibration File

Each ZED camera has a dedicated calibration file that is generated during the factory calibration process. It stores the optical characteristics of the camera’s sensor(s) — and, for stereo cameras, the geometry between the two sensors — and is essential to accurate imaging and to the quality of the depth estimation process.

The file is named after the camera’s serial number (e.g. SNxxxxxxx.conf) and is normally stored in the following location:

  • Windows: C:\ProgramData\StereoLabs\settings
  • Linux: /usr/local/zed/settings/

In addition, all cameras produced after May 2026 — except the ZED Mini — store the factory calibration data directly on their internal EEPROM.

When an application opens a camera through the ZED SDK API, it looks for the calibration file in the settings folder. The SDK selects the calibration source in the following order of priority:

  1. The calibration file found in the settings folder.
  2. The calibration data stored on the camera’s EEPROM, when no local file is available.
  3. A fresh copy automatically downloaded from the StereoLabs servers, when neither a local file nor valid EEPROM data is available. Note: an internet connection is required in this case.

The calibration file can also be downloaded manually at any time from calib.stereolabs.com using the camera serial number.

The calibration data in the settings folder takes priority over the data stored on the EEPROM. This means that a custom calibration file, which overrides the factory calibration, always takes precedence over the EEPROM data.

Reading the calibration data from the EEPROM requires ZED SDK v5.3 or newer.

File Structure

The calibration file is a plain-text, INI-style file organized in named sections. Its exact content depends on the camera type:

  • A stereo camera file (e.g. ZED 2i) describes the left and right sensors and the geometry between them.
  • A monocular camera file (e.g. ZED X One) describes a single sensor and contains no stereo geometry.

In both cases, the sections are named after the resolution they apply to, the intrinsics follow the pinhole camera model, and a final [MISC] section carries metadata such as the sensor identifier (Sensor_ID).

The table below summarizes the sections found in each file type:

ContentStereo cameraMonocular camera
Sensor intrinsics (per resolution)[LEFT_CAM_<RES>], [RIGHT_CAM_<RES>][CAM_<RES>]
Lens distortion[LEFT_DISTO], [RIGHT_DISTO][DISTO]
Stereo transform (extrinsics)[STEREO](none)
Metadata[MISC][MISC]

Sensor intrinsics

The intrinsic parameters describe a single sensor at a given resolution, following the pinhole camera model:

  • fx, fy: focal length in pixels.
  • cx, cy: optical center (principal point) coordinates in pixels.

For a stereo camera, each eye has its own section per resolution — [LEFT_CAM_<RES>] and [RIGHT_CAM_<RES>], where <RES> is one of 2K, FHD, HD, VGA. These sections also embed a basic radial-tangential distortion model (k1, k2, k3, p1, p2):

1[LEFT_CAM_HD]
2fx=951.925
3fy=952.475
4cx=642.95
5cy=366.023
6k1=-0.0719661
7k2=-0.0168656
8p1=2.16146e-05
9p2=-0.000677513
10k3=-0.0496784
11
12[RIGHT_CAM_HD]
13fx=955.27
14fy=955.99
15cx=633.98
16cy=362.8445
17k1=-0.0692211
18k2=-0.0253319
19p1=-1.05111e-05
20p2=0.000239657
21k3=-0.0460711

For a monocular camera, there is a single [CAM_<RES>] section per resolution (the resolution names depend on the camera model, e.g. FHD1200, FHD, SVGA). These sections contain only the focal length and optical center — the distortion is stored separately in a dedicated section (see below):

1[CAM_FHD]
2fx=737.615
3fy=737.295
4cx=951.708
5cy=474.671

Lens distortion

The distortion model depends on the camera’s lens type:

  • Standard (rectilinear) lenses use a radial-tangential (Brown-Conrady) model: radial coefficients k1k6 and tangential coefficients p1, p2.
  • Fisheye lenses (e.g. a ZED X One fitted with such a lens) use a dedicated fisheye distortion model, which relies on only four radial coefficients (k1k4), with no tangential or prism terms.

These coefficients are stored separately from the per-resolution intrinsics, in a resolution-independent section — one per eye for a stereo camera ([LEFT_DISTO], [RIGHT_DISTO]) and a single [DISTO] for a monocular camera. The example below shows the radial-tangential coefficients of a standard lens:

1[DISTO]
2k1=0.121598
3k2=0.0687899
4k3=-0.0443668
5k4=0.122025
6k5=0.123382
7k6=-0.0586831
8p1=0.000355499
9p2=-0.000283728

Through the ZED SDK, you can determine which model a given camera uses by reading the lens_distortion_model field (sl::LENS_DISTORTION_MODEL) of its parameters — calibration_parameters.left_cam (or right_cam) for a stereo camera, and calibration_parameters directly for a monocular one. Raw/unrectified parameters report RAD_TAN (Brown-Conrady) or FISHEYE, whereas rectified parameters always report PINHOLE, since the distortion is corrected during rectification. The raw coefficients themselves are exposed in the disto array. For the RAD_TAN model it is ordered as [k1, k2, p1, p2, k3, k4, k5, k6, s1, s2, s3, s4] — radial (k1k6), tangential (p1, p2), and thin-prism (s1s4); for the FISHEYE model, only the first four entries (k1k4) are used.

Stereo transform

The [STEREO] section is present only for stereo cameras. It holds the extrinsic parameters: the position of the right sensor relative to the left sensor, with the right sensor itself as the center of rotation. Monocular files do not contain this section, as a single sensor has no stereo geometry.

1[STEREO]
2Baseline=120.27
3TY=-0.319205
4TZ=0.444416
5CV_2K=0.000952819
6CV_FHD=0.000952819
7CV_HD=0.000952819
8CV_VGA=0.000952819
9RX_2K=0.00196122
10RX_FHD=0.00196122
11RX_HD=0.00196122
12RX_VGA=0.00196122
13RZ_2K=0.0019015
14RZ_FHD=0.0019015
15RZ_HD=0.0019015
16RZ_VGA=0.0019015
  • Baseline: distance between the two optics, in mm.
  • TY, TZ: translation of the right sensor relative to the left one along the Y and Z axes, in mm.
  • CV_* (also written RY_*): optical convergence, i.e. the rotation around the Y axis, given per resolution.
  • RX_*, RZ_*: the remaining rotation axes describing the transformation between the two sensors, given per resolution.

Rotations are expressed using the Rodrigues notation.

Raw and Rectified Calibration

The ZED SDK exposes two sets of calibration parameters, and they intentionally differ. Knowing which one you are looking at explains, for example, why the values shown in the ZED Explorer Calibration tab do not match those returned by the SDK API.

Raw (unrectified) calibration describes the real optics of each physical sensor: each side keeps its own intrinsics, and the full lens distortion (RAD_TAN or FISHEYE) is present. These values correspond to the unrectified images (VIEW::LEFT_UNRECTIFIED / VIEW::RIGHT_UNRECTIFIED) and match — or are very close to — the values stored in the calibration file and shown by ZED Explorer.

Rectified calibration describes the images after rectification, with the lens distortion already removed; the distortion coefficients are therefore zero and the model is PINHOLE. For a stereo camera, rectification also aligns the two views as if they came from an ideal, perfectly matched stereo pair, so that:

  • the left and right sensors share the same intrinsics, because the epipolar lines are aligned on the same image rows;
  • the stereo rotation is zero and the translation reduces to the baseline (Tx), with the other components being zero.

These are the parameters of the VIEW::LEFT / VIEW::RIGHT images that feed the depth-estimation pipeline, which is why the SDK returns them by default. ZED Explorer, in contrast, displays the raw stream — hence the difference.

Both sets are available from getCameraInformation():

1auto cam_config = zed.getCameraInformation().camera_configuration;
2// Rectified parameters (default VIEW::LEFT / VIEW::RIGHT images)
3sl::CalibrationParameters calib = cam_config.calibration_parameters;
4// Raw parameters (VIEW::LEFT_UNRECTIFIED / VIEW::RIGHT_UNRECTIFIED images)
5sl::CalibrationParameters calib_raw = cam_config.calibration_parameters_raw;

Monocular cameras (sl::CameraOne) expose the same two sets through calibration_parameters and calibration_parameters_raw, each as a single CameraParameters. The stereo-specific points above do not apply, but the principle is identical: the rectified set describes the undistorted image (PINHOLE, zero distortion), while the raw set describes the real lens.

Stereo Cameras

Stereo cameras expose the intrinsic parameters of both the left and right eye, as well as the stereo transform (rotation and translation) between them, which is required for depth computation.

Using the API

Camera parameters are available in CalibrationParameters. They can be retrieved using getCameraInformation().

1CalibrationParameters calibration_params = zed.getCameraInformation().camera_configuration.calibration_parameters;
2// Focal length of the left eye in pixels
3float focal_left_x = calibration_params.left_cam.fx;
4// First radial distortion coefficient
5float k1 = calibration_params.left_cam.disto[0];
6// Translation between left and right eye on x-axis
7float tx = calibration_params.stereo_transform.getTranslation()[0];
8// Horizontal field of view of the left eye in degrees
9float h_fov = calibration_params.left_cam.h_fov;

If self-calibration is enabled (the default), the ZED SDK re-estimates and refines the calibration at startup, so the returned values may differ slightly from the factory file. See Self-Calibration and Raw and Rectified Calibration for details.

Self-Calibration

By default, the ZED SDK runs a self-calibration process every time a stereo camera is opened. This step refines the factory calibration on the fly, correcting the small offsets that develop over time or with changing operating conditions (mechanical stress, vibrations, or thermal expansion of the camera body). The optimized parameters are then used by the SDK for rectification and depth estimation.

This behavior is controlled by the camera_disable_self_calib field of InitParameters:

  • false (default) — self-calibration is enabled. Accuracy is improved, but the calibration parameters change slightly from one live run to another, which can be an issue when strict repeatability is required.
  • true — self-calibration is skipped. The SDK uses the calibration parameters straight from the calibration file, guaranteeing identical values across runs at the cost of potentially reduced accuracy.

In most situations, self-calibration should remain enabled. You can also trigger it manually at any time after the camera is opened by calling Camera::updateSelfCalibration().

This is why the camera parameters reported by the ZED SDK API often differ from those shown by the ZED Explorer tool. ZED Explorer reads the raw values directly from the calibration file, whereas the API returns the self-calibrated parameters that have been optimized at startup. Because of this, even the raw parameters returned by the SDK (calibration_parameters_raw) can differ slightly from the factory file. To obtain the unmodified factory values, disable self-calibration by setting camera_disable_self_calib to true in sl::InitParameters. See Raw and Rectified Calibration for the distinction between raw and rectified parameters, and this support article for more details.

A common practical use of self-calibration is compensating for temperature drift: as the camera heats up, its optical and mechanical characteristics shift, and re-running the self-calibration realigns the stereo pair. See Using the sensor to compensate for temperature drift for a concrete example.

Monocular Cameras

Monocular cameras, such as the ZED X One, have a single lens and are factory-calibrated for their intrinsic parameters only (focal length, principal point, lens distortion, and field of view). As they have a single optical sensor, no stereo transform is provided.

Using the API

When using a monocular camera through the sl::CameraOne class, calibration parameters are available in a single CameraParameters object (instead of the CalibrationParameters used for stereo cameras). They can be retrieved using getCameraInformation().

1CameraParameters calibration_params = zed_one.getCameraInformation().camera_configuration.calibration_parameters;
2// Focal length in pixels
3float focal_x = calibration_params.fx;
4// First radial distortion coefficient
5float k1 = calibration_params.disto[0];
6// Horizontal field of view in degrees
7float h_fov = calibration_params.h_fov;

Two ZED X One cameras can be rigidly paired to build a Virtual Stereo Vision system. Because each monocular factory calibration file describes a single sensor and contains no stereo geometry (no [STEREO] section), an additional extrinsic calibration is mandatory to compute the relative position and orientation of the two cameras before depth can be estimated.

Recalibrating your camera

While the factory calibration is typically more accurate than user calibrations, you may need to recalibrate your camera in specific situations, such as when placing glass in front of the lens, when operating underwater, or after a strong impact or exposure to extreme temperatures.

  • ZED Calibration tool: a GUI tool shipped with the ZED SDK to fine-tune the intrinsic and extrinsic parameters of a stereo ZED camera. This tool only works with stereo cameras and cannot be used to calibrate a monocular ZED X One camera.
  • ZED OpenCV Calibration tool: an open-source, OpenCV-based tool to perform a guided checkerboard calibration of both monocular and stereo cameras — single ZED X One cameras, ZED stereo cameras, and custom stereo rigs (e.g. a dual ZED X One Virtual Stereo system). It generates calibration files compatible with the ZED SDK, and can also be used to verify the quality of an existing calibration.

To manually calibrate a monocular ZED X One camera used in particular conditions (e.g. underwater, behind glass) or fitted with custom lenses, you must use the ZED OpenCV Calibration packages or a standard OpenCV calibration process, as the ZED Calibration tool does not support monocular cameras.