You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: examples/cpp/DynamicCalibration/README.md
+46-9Lines changed: 46 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
# Dynamic Calibration (C++) — DepthAI
2
2
3
-
This folder contains two minimal, end-to-end **C++** examples that use **`dai::node::DynamicCalibration`** to (a) **calibrate** a stereo rig live and (b) **evaluate** calibration quality on demand — both while streaming synchronized stereo frames and disparity for visual feedback.
3
+
This folder contains three minimal, end-to-end **C++** examples that use **`dai::node::DynamicCalibration`** to (a) **calibrate** a stereo rig live and (b) **evaluate** calibration quality on demand, (c) combination of both — while streaming synchronized stereo frames and disparity for visual feedback.
4
4
5
5
> Close your preview window or stop the program to quit.
6
6
@@ -44,20 +44,20 @@ This folder contains two minimal, end-to-end **C++** examples that use **`dai::n
44
44
-`DynamicCalibration.left/right`
45
45
-`StereoDepth.left/right` (for live disparity view)
46
46
2. Start the pipeline, give AE a moment to settle.
47
-
3.**Start calibration** by sending `DynamicCalibrationControl::Command::StartCalibration{})`.
47
+
3.**Start calibration** by sending `DynamicCalibrationControl::Command::StartCalibration{}`.
48
48
4. In the loop:
49
49
- Show `left`, `right`, and `disparity`.
50
50
- Poll `coverageOutput` for progress.
51
51
- Poll `calibrationOutput` for a result.
52
52
5. When a result arrives:
53
-
-**Apply** it by sending `DynamicCalibrationControl::Command::ApplyCalibration(newCalibration)` on the control queue.
53
+
-**Apply** it by sending `DynamicCalibrationControl::Command::ApplyCalibration{newCalibration}` on the control queue.
54
54
- Print quality deltas.
55
55
56
56
---
57
57
58
58
## 2) Calibration **quality check** (no applying)
59
59
60
-
**File idea:**`calib_quality_dynamic.cpp`
60
+
**File idea:**`calibration_quality_dynamic.cpp`
61
61
62
62
**Flow:**
63
63
1. Same camera / StereoDepth / DynamicCalibration setup as above.
@@ -67,6 +67,39 @@ This folder contains two minimal, end-to-end **C++** examples that use **`dai::n
67
67
3. If `qualityData` is present, print rotation/Sampson/depth-error metrics.
68
68
4. Optionally reset internal sample store (`DynamicCalibrationControl::Command::ResetData{}`).
Runs one loop that periodically checks calibration quality and, if drift is detected, starts calibration and applies the new calibration automatically — while showing `left`, `right`, and a colorized `disparity` preview.
79
+
80
+
**Flow:**
81
+
1. Create mono cameras → request **full-res NV12** (unrectified) → link to `dai::node::DynamicCalibration` and `dai::node::StereoDepth` for live disparity. Read the device’s current calibration as the baseline.
82
+
2. On a fixed interval (e.g., ~3 seconds), send on the control queue:
83
+
-`DynamicCalibrationControl::Command::LoadImage{}` to compute coverage on the current frames, and
84
+
-`DynamicCalibrationControl::Command::CalibrationQuality{true}` to request a (forced) quality estimate.
85
+
3. When a **quality** message arrives on `qualityOutput`:
86
+
- Log status; if `qualityData` is present, you may **reset** the internal data store with `DynamicCalibrationControl::Command::ResetData{}`.
87
+
- If quality indicates drift (for example, `abs(sampsonErrorNew - sampsonErrorCurrent) > 0.05f`), **start calibration** with `DynamicCalibrationControl::Command::StartCalibration{}`.
88
+
4. When a **calibration** message arrives on `calibrationOutput`:
89
+
-**Apply** the new `CalibrationHandler` with `DynamicCalibrationControl::Command::ApplyCalibration{result.newCalibration}`, then **reset** data again (`ResetData{}`) to begin monitoring afresh.
90
+
5. Exit on `q` keypress or window close.
91
+
92
+
**Notes & defaults:**
93
+
- Disparity preview can be auto-scaled to the observed maximum; zero disparity can be rendered black for clarity.
94
+
- The 0.05 px Sampson threshold is a simple heuristic — tune to your tolerance and noise profile.
Copy file name to clipboardExpand all lines: examples/python/DynamicCalibration/README.md
+49-13Lines changed: 49 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
# Dynamic Calibration (Python) — DepthAI
2
2
3
-
This folder contains two minimal, end-to-end examples that use **`dai.node.DynamicCalibration`** to (a) **calibrate** a stereo rig live and (b) **evaluate** calibration quality on demand — both while streaming synchronized stereo frames and disparity for visual feedback.
3
+
This folder contains three minimal, end-to-end examples that use **`dai.node.DynamicCalibration`** to (a) **calibrate** a stereo device real-time and (b) **evaluate** calibration quality on demand (c) combination of both — while streaming synchronized stereo frames and disparity for visual feedback.
4
4
5
5
> Press **`q`** in the preview window to quit either example.
6
6
@@ -17,16 +17,16 @@ This folder contains two minimal, end-to-end examples that use **`dai.node.Dynam
17
17
### Outputs & metrics
18
18
19
19
-**CoverageData** (`coverageOutput`)
20
-
-`meanCoverage` — overall spatial coverage [0–1].
21
-
-`dataAcquired` — amount of calibration-relevant data gathered [0–1].
22
-
-`coveragePerCellA/B` - matrix of spatial coverage of imager A or B
Runs one loop that periodically checks calibration quality and, if drift is detected, starts calibration and applies the new calibration automatically — while showing `left`, `right`, and colorized `disparity` previews.
116
+
117
+
**Flow:**
118
+
1. Create mono cameras → request **full-res NV12** → link to `DynamicCalibration` and `StereoDepth` for live disparity. Read the device’s current calibration as baseline.
119
+
2. On a fixed interval (for example, every ~3 seconds), send:
120
+
-`LoadImage()` to compute coverage on the current frames, and
121
+
-`CalibrationQuality(True)` (or equivalent) to request a quality estimate.
122
+
3. When a quality result arrives:
123
+
- Log status; if quality data is present, **reset** the internal data store.
124
+
- If the quality indicates drift (e.g., a Sampson error delta above a small threshold like 0.05 px), **start calibration** (`StartCalibration()`).
125
+
4. When a calibration result arrives:
126
+
-**Apply** the new `CalibrationHandler` to the device and **reset** data again.
127
+
5. Press **`q`** to exit.
128
+
129
+
**Notes & defaults:**
130
+
- Disparity preview is auto-scaled to the observed maximum; **zero disparity appears black** for clarity.
131
+
- The 0.05 px Sampson threshold is a simple heuristic — adjust per your tolerance.
# Live calibration (applies new calibration when ready)
140
173
python calibrate_dynamic.py
141
174
142
-
# Quality evaluation (reports metrics; does not apply)
143
-
python calib_quality_dynamic.py
175
+
# Quality evaluation (reports metrics of when recalibration is required)
176
+
python calibration_quality_dynamic.py
177
+
178
+
# Integration example (starts new calibration when the quality reports major changes)
179
+
python calibration_integration.py
144
180
```
145
181
146
182
> Tip: Ensure your calibration target is well-lit, sharp, and observed across the **entire** FOV. Aim for high `meanCoverage` and steadily increasing `dataAcquired`.
0 commit comments