# Three Camera Stereo Example

Use a stereo pair for depth and a separate RGB camera for color on one [OAK4
FFC](https://docs.luxonis.com/hardware/platform/deploy/oak4-ffc-getting-started.md). Choose this layout to relate color images to
depth, for example to locate an object detected in RGB in 3D. Calibrating all three cameras establishes their relative poses.

> **RGB alignment**
> The third camera adds a color viewpoint. Select RGB-aligned depth in your application pipeline to use that viewpoint for depth output.

## What you need

Hardware

 * 1× [OAK4 FFC](https://shop.luxonis.com/products/oak-4-ffc) baseboard
 * 2× stereo camera modules with matching sensors and optics for `CAM_B` and `CAM_C`, for example
   [OAK-FFC-V2-OV9282](https://shop.luxonis.com/products/oak-ffc-v2-ov9282?Configuration=Standard+%C2%B7+Mono+%C2%B7+Fixed+focus)
   or [OAK-FFC-V2-OG05-M](https://shop.luxonis.com/products/oak-ffc-v2-og05?Configuration=Standard+%C2%B7+Mono+%C2%B7+Fixed+focus)
 * 1× color camera module for `CAM_A`, for example
   [OAK-FFC-V2-IMX586](https://shop.luxonis.com/products/oak-ffc-v2-imx586?Configuration=Standard+-+Auto+focus) or
   [OAK-FFC-V2-OG05-C](https://shop.luxonis.com/products/oak-ffc-v2-og05?Configuration=Standard+%C2%B7+Color+%C2%B7+Fixed+focus).
   See all [supported camera modules](https://docs.luxonis.com/hardware/platform/deploy/oak4-ffc-getting-started.md).
 * 3× FFC cables, long enough to reach the holders without tension
 * 1× [OAK-FFC Kit](https://shop.luxonis.com/products/oak-ffc-kit) or another rigid rail with 3 module holders
 * Power supply and network connection, as described in [Getting
   Started](https://docs.luxonis.com/hardware/platform/deploy/oak4-ffc-getting-started.md)

Tools

 * Computer with OAK Viewer
 * Ruler or caliper

You can configure the OAK4 FFC together with its camera modules in the [Luxonis
shop](https://shop.luxonis.com/products/oak-4-ffc).

## Assemble and wire the rig

| Socket | Role | Placement |
| --- | --- | --- |
| `CAM_B` | Left stereo camera | Left when looking in the cameras' viewing direction |
| `CAM_A` | RGB camera | Between the stereo cameras, looking at the same scene |
| `CAM_C` | Right stereo camera | Right when looking in the cameras' viewing direction |

Disconnect power. Secure the baseboard and holders, with all lenses upright and facing the same scene. Check module fit and
overlapping views.

Choose the `CAM_B`–`CAM_C` baseline for your working range. Tighten the holders, then measure each camera center's X/Y/Z offset
from `CAM_A`, including differences in lens depth.

With power disconnected, connect the sockets listed above. Check contact orientation, label the cables and leave slack so they
cannot pull on a module.

Power the rig and connect it to the computer's network. Check all three streams in Viewer; cover each lens briefly to confirm its
socket.

## Configure extrinsics in OAK Viewer

For an incomplete layout, Viewer opens Extrinsics configuration required on connection.

 1. Click Connect on the device card. If the extrinsics dialog does not appear, open Device → FFC Calibration → Reset Extrinsics
    to enter the new layout. Back up the existing calibration before replacing it.
 2. Select `CAM_B`, keep Relative to set to `CAM_A`, and enter the measured translation in centimeters on [RDF
    axes](https://docs.luxonis.com/software-v3/depthai/depthai-components/coordinate-systems.md) (+X right, +Y down, +Z forward).
    For parallel, upright cameras, keep the initial rotation at zero.
 3. Select `CAM_C`, set Relative to to the camera you measured it from, and enter the measured translation.
 4. Select `CAM_A` and check that the 3D view matches the physical layout of your rig.
 5. Click Save and Start. OAK Viewer saves the extrinsics and opens the Stereo pipeline.

## Run Dynamic Calibration

In the Stereo view, click Recalibrate and follow [Calibrate a stereo pair in
Viewer](https://docs.luxonis.com/hardware/platform/deploy/oak4-ffc-getting-started.md). Aim all three cameras at the same textured
scene so `CAM_A` is calibrated together with the `CAM_B` + `CAM_C` pair.

## Verify the result

Open Stereo or Neural 3D to inspect depth and the point cloud.

 * Confirm Calibration Details includes all three cameras.
 * Compare a textured object's reported depth with a measured distance.
 * For RGB-aligned depth, check that color and depth object boundaries agree.
 * Reconnect to verify calibration persists. Recalibrate after moving a camera or changing optics.

Recheck camera spacing if distances are consistently scaled incorrectly. For edge mismatches, check the selected stereo pair,
scene texture and calibration errors in Calibration Details.

## Next steps

 * [DynamicCalibration](https://docs.luxonis.com/software-v3/depthai/depthai-components/host_nodes/dynamic_calibration.md) - use
   3-sensor calibration in your own DepthAI pipeline
 * [Compare example camera setups](https://docs.luxonis.com/hardware/platform/deploy/oak4-ffc-getting-started.md)
 * [Multi-Device Setup](https://docs.luxonis.com/software-v3/depthai/tutorials/multi-device-setup.md) - for cameras on separate
   OAK devices
