# DynamicCalibration

DynamicCalibration is a self-healing, on-device recalibration tool built into DepthAI 3.0. It allows stereo depth cameras to
automatically monitor and restore their stereo extrinsic calibration, ensuring stable depth accuracy over time — even after
thermal shifts, mechanical shocks, or mounting changes degrade factory alignment.

The current multi-sensor work also extends this workflow to FFC and other multi-camera layouts, where calibration may need to stay
consistent across more than one camera pair.

![Depth before and after DynamicCalibration](https://docs.luxonis.com/static/images/software/depthai/nodes/before_after_dcl.webp)

### Key capabilities

 * Restore depth performance — bring your disparity map back to crisp, geometrically consistent output.
 * Continuous or manual operation — works in real time or via manual triggers.
 * Calibration health monitoring — check alignment drift without modifying the device.
 * Fast, robust recalibration — typically completes in seconds using live stereo input.
 * No special targets needed — runs in natural scenes with feature-rich visual content.
 * Supports all stereo cameras running DepthAI 3.0 — including OAK-D, OAK-D-Lite, OAK-D Pro, CM4 PoE, and more.
 * Extending to multi-sensor calibration — newer workflows can calibrate connected sensor graphs and expose socket-keyed
   diagnostics.

[Video: Dynamic Calibration: Keeping Stereo Depth Accurate](https://www.youtube.com/watch?v=GoEtPvwqMS8)

### Try it out in OAK Viewer (no code required)

The fastest way to test the capabilities of DynamicCalibration is by using the latest version of the OAK-Viewer:

### OAK Viewer

OAK Viewer is a desktop GUI application that allows you to visualize the camera's streams and interact with the device. It is
available for Windows, macOS, and Linux.

[Click here to get started](https://docs.luxonis.com/software-v3/depthai/tools/oak-viewer.md)

## Automatic Calibration Procedures

AutoCalibration provides startup and continuous recalibration procedures under one feature.

### ON_START and CONTINUOUS

* Start DCL automatically with `ON_START` before normal operation.
 * Keep DCL running with `CONTINUOUS` for ongoing self-healing during runtime.
 * No manual DCL trigger needed in your application flow.
 * Better chance of stable calibration in both startup and long-running deployments.

[See integration details](https://docs.luxonis.com/software-v3/depthai/depthai-components/host_nodes/dynamic_calibration.md)

## Restore factory calibration

If you are unsatisfied with the results of `AutoCalibration` or `DynamicCalibration`, use `device.factoryResetCalibration()` to
restore factory calibration. This overwrites user calibration and leaves the factory backup unchanged.

Stopping or disabling automatic calibration does not undo flashed changes.

Close the running pipeline and device connection, then run:

#### Python

```python
import depthai as dai

with dai.Device() as device:
    device.factoryResetCalibration()
```

#### C++

```cpp
#include "depthai/depthai.hpp"

int main() {
    dai::Device device;
    device.factoryResetCalibration();
}
```

Reconnect and restart your pipeline with automatic calibration disabled. For custom FFC rigs, use your saved rig calibration if
the factory backup does not match the rig.

## Multi-sensor and FFC workflows

DynamicCalibration is not limited to a single stereo pair. It also supports:

 * Multi-sensor calibration solved as one connected rig instead of unrelated pairwise updates.
 * Known-baseline recalibration, where camera centers stay fixed and only orientation drift is corrected.
 * Free-form recalibration for unknown baselines, useful on FFC setups that do not yet have reliable rig extrinsics.
 * Socket-keyed diagnostics so applications can reason about coverage and rotation deltas per connected camera.

For implementation details, command behavior, and code examples, continue to the [technical DynamicCalibration
page](https://docs.luxonis.com/software-v3/depthai/depthai-components/host_nodes/dynamic_calibration.md).

## Scenery guidelines

Good calibration scenes make it easier for algorithms to detect, match, and track features. Recommended characteristics:

 * Include textured objects at multiple depths.
 * Avoid blank walls or featureless surfaces.
 * Slowly move the camera to cover the full FOV; avoid sudden motions.

| Recommendation | Original Image VS. Feature Coverage (in green) |
| --- | --- |
| ✅Ensure rich texture and visual detail - rich textures, edges, and objects evenly distributed across FOV create ideal calibration conditions | ![Factory robots and Dynamic Calibration feature coverage](https://docs.luxonis.com/static/images/software/depthai/nodes/dcl_scene_features_robots.webp) |
| 🚫Avoid flat or featureless surfaces - lack of textured surfaces or visually distinct objects provide little usable features | ![White room and Dynamic Calibration feature coverage](https://docs.luxonis.com/static/images/software/depthai/nodes/dcl_scene_features_white_room.webp) |
| 🚫Avoid reflective and transparent surfaces - reflective and transparent surfaces create false 3D features | ![Glass hallway and Dynamic Calibration feature coverage](https://docs.luxonis.com/static/images/software/depthai/nodes/dcl_scene_features_glass.webp) |
| 🚫Avoid dark scenes - low contrast, shadows, and poorly lit scenes yield few detectable features | ![Night street and Dynamic Calibration feature coverage](https://docs.luxonis.com/static/images/software/depthai/nodes/dcl_scene_features_street.webp) |
| 🚫Avoid repetitive patterns - many patterned regions look too similar to tell apart | ![Kitchen and Dynamic Calibration feature coverage](https://docs.luxonis.com/static/images/software/depthai/nodes/dcl_scene_features_kitchen.webp) |

## Developer Integration

Dynamic Calibration is included in DepthAI and does require extra installation. Run the following example to get an overview of
the implementation.

### Clone & Run the Example

```bash
git clone https://github.com/luxonis/depthai-core.git
cd depthai-core/
python3 -m venv venv
source venv/bin/activate
python3 examples/python/install_requirements.py
python3 examples/python/DynamicCalibration/calibration_integration.py
```

### Implement into your projects

Follow the [dynamic calibration library
documentation](https://docs.luxonis.com/software-v3/depthai/depthai-components/host_nodes/dynamic_calibration.md) to learn how to
implement Dynamic Calibration into your own projects.

## Calibrating multiple devices

To estimate the positions and orientations between separate OAK devices, see [Multi-Device
Calibration](https://docs.luxonis.com/hardware/platform/depth/multi-device-calibration.md). Use it to put their point clouds or
camera views into a shared coordinate system.
