# FFC Calibration: Setup and Accuracy

FFC Calibration in OAK Viewer works out how your [OAK4
FFC](https://docs.luxonis.com/hardware/platform/deploy/oak4-ffc-getting-started.md) camera modules sit relative to one another. In
Viewer, you enter roughly how each camera is turned and in which direction its neighbor lies. Calibration then refines both from
the images. It does not change the distance between cameras, so that is the one value you must measure carefully.

This page explains how to arrange the cameras and the scene, what accuracy to expect, and how to check a result before you rely on
it. For the steps in Viewer, see [Calibrate a stereo pair in
Viewer](https://docs.luxonis.com/hardware/platform/deploy/oak4-ffc-getting-started.md#OAK4%20FFC%20Getting%20Started-Connect%20in%20OAK%20Viewer-Calibrate%20a%20stereo%20pair%20in%20Viewer).

> **Two cameras side by side?**
> Two camera modules mounted side by side and pointing the same way form a regular stereo pair, and calibration behaves as [Dynamic Calibration](https://docs.luxonis.com/hardware/platform/depth/dynamic-calibration.md) does on a stereo camera. For that setup, follow the Dynamic Calibration scene guidelines and see the [Dynamic Calibration Specification](https://docs.luxonis.com/software-v3/depthai/depthai-components/host_nodes/dynamic_calibration/specification.md) for its accuracy. This page covers cameras that point in different directions or share only part of their view.

### 99 %

Camera pairs that completed calibration within the setup limits.

### < 0.59°

Rotation error for 90 % of camera pairs.

### 85.1 %

Camera pairs within 1° in rotation and 5 % of the baseline in position.

## Setup requirements

![Three camera modules on one mount, seen from above. Two point the same way and the third is turned outward. Neighboring camera views overlap. The baseline is the distance between two neighboring cameras; the angle is the difference between their pointing directions.](https://docs.luxonis.com/static/images/hardware/deploy/ffc-calibration-spec/setup-ffc.webp)

The accuracy figures on this page apply when each pair of neighboring cameras meets these conditions:

| Condition | Requirement |
| --- | --- |
| Difference in camera pointing directions | < 30° |
| Shared view (overlap) | ≥ 40 % |
| Distance to the scene during calibration | Detailed objects within 20 baseline lengths |
| Baseline length | 6–50 cm (tested) |
| Mounting | Rigid mount; cameras and scene stay still during capture |

The shared view is the part of each image that the other camera also sees, excluding areas hidden behind objects. Use the smaller
of the two percentages. For cameras that see about 75° across horizontally, the shared view is about 65 % with 15° between
neighboring pointing directions and about 45 % with 30°.

> **Measure the baseline length carefully**
> The baseline length is the distance between the optical centers of two neighboring cameras. Calibration keeps the distance you enter and does not correct it, so any error carries straight into depth: a baseline entered 2 % too long gives depth that reads 2 % too far.

### Place cameras where they can see useful detail

 * Aim neighboring cameras at furniture, objects or equipment visible in both views. A blank wall or bare floor offers few details
   to match.
 * Keep those objects close while calibrating: within 2 m for a 10 cm baseline, within 4 m for 20 cm. This applies only during
   calibration, not during normal use.

If your setup falls outside these limits, see [Results beyond the tested setup
limits](#Results%20beyond%20the%20tested%20setup%20limits) before relying on the accuracy figures.

## How the results were measured

FFC Calibration was tested on a large set of synthetic camera rigs, each with five camera modules, rendered in a variety of rooms.
Rendering the scenes means the true camera positions are known exactly, so every result is compared with the ground truth. The
runs used the same calibration settings as Viewer's FFC Calibration, without running Viewer or a device, and one camera type
(1280×800 mono, 75° horizontal view) with exactly known lens parameters.

### What the errors measure

![Left: one camera seen from above; the calibrated pointing direction differs from the true one by the rotation error, at most 1° to meet the target. Right: two neighboring cameras; the calibrated position of the second camera differs from its true position by the position error, at most 5 % of the baseline to meet the target.](https://docs.luxonis.com/static/images/hardware/deploy/ffc-calibration-spec/errors-ffc.webp)

 * Rotation error is the angle between the calibrated and the true orientation of a camera relative to its neighbor, in degrees.
 * Position error is the distance between the calibrated and the true position of a camera relative to its neighbor.

A result meets the accuracy target when both errors are within their limits: at most 1° in rotation and at most 5 % of the
baseline length in position. For cameras 10 cm apart, the position limit is 0.5 cm.

> **Percentiles are not maximum errors**
> An entry such as "0.59° at the 90th percentile" means nine out of ten camera pairs had a smaller error. It is not a maximum error for every run.

## Results

### Accuracy within the setup limits

99 % of camera pairs completed calibration, and 85.1 % met the accuracy target.

| Metric | Median | 90th percentile |
| --- | --- | --- |
| Rotation error | 0.06° | 0.59° |
| Position error | 0.2 cm | 1.9 cm |

### Check the result

After calibration, check New Sampson Error in Viewer's Calibration Details. If it is above 0.3 px, run calibration again.

### Results beyond the tested setup limits

The chart shows how often a camera pair met the accuracy target as the pointing angle and shared view changed. Outlined cells meet
the setup limits. Gray cells had no test samples; they do not mean a 0 % success rate. Outside the outlined cells, results depend
on the scene and are not guaranteed.

![Rate of camera pairs meeting the accuracy target by overlap (rows) and angle (columns 0–15, 15–30, 30–45, 45–60, 60–75, over 75°). 0–20 %: no samples, no samples, no samples, 20, 2, 0. 20–40 %: no samples, 50, 61, 34, no samples, no samples. 40–60 %: 80, 73, 57, no samples, no samples, no samples. 60–80 %: 86, 69, no samples, no samples, no samples, no samples.](https://docs.luxonis.com/static/images/hardware/deploy/ffc-calibration-spec/heatmap-ffc.webp)

### Calibrating more than two cameras

Cameras that share a view are calibrated together as one group. In groups of three to five cameras, neighboring pairs were as
accurate as when calibrated two at a time. With four or five cameras, the first attempt sometimes stops for lack of data (16–29 %
of cases); starting calibration again completes it in 99 % of cases.

## When to recalibrate

Keep the cameras fixed relative to one another after calibration. Recalibrate if a camera moves on its mount, is re-mounted, takes
a knock, or if you change a lens.

To catch slow drift, periodically re-run calibration and check the rotation change in Calibration Details. Repeated runs in the
tests differed by about 0.04° in rotation. A larger change is a reason to check the mounts and the scene, though on its own it
does not prove that a camera moved.

### Need assistance?

Head over to [Discussion Forum](https://discuss.luxonis.com/) for technical support or any other questions you might have.
