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
+57-20Lines changed: 57 additions & 20 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
@@ -9,10 +9,10 @@ This folder contains two minimal, end-to-end **C++** examples that use **`dai::n
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
+67-31Lines changed: 67 additions & 31 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
@@ -9,24 +9,24 @@ This folder contains two minimal, end-to-end examples that use **`dai.node.Dynam
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
-
python calibrate_dynamic.py
173
+
python calibration_dynamic.py
174
+
175
+
# Quality evaluation (reports metrics of when recalibration is required)
176
+
python calibration_quality_dynamic.py
141
177
142
-
#Quality evaluation (reports metrics; does not apply)
143
-
python quality_dynamic.py
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`.
@@ -149,19 +185,19 @@ python quality_dynamic.py
149
185
150
186
## Commands overview
151
187
152
-
-`StartCalibrationCommand()`
153
-
Begins dynamic calibration collection/solve. Use `OPTIMIZE_SPEED` for speed or `OPTIMIZE_PERFORMANCE` for more robust estimation.
188
+
-`StartCalibration()`
189
+
Begins dynamic calibration collection/solve.
154
190
155
-
-`ApplyCalibrationCommand(calibration)`
191
+
-`ApplyCalibration(calibration)`
156
192
Applies the provided `CalibrationHandler` to the device (affects downstream nodes in this session).
157
193
158
-
-`LoadImageCommand()`
194
+
-`LoadImage()`
159
195
Triggers coverage computation for the current frame(s).
160
196
161
-
-`CalibrationQualityCommand()`
197
+
-`CalibrationQuality()`
162
198
Produces a `CalibrationQuality` message with `qualityData` if estimation is possible.
163
199
164
-
-`ResetDataCommand()`
200
+
-`ResetData()`
165
201
Clears accumulated samples/coverage state to start fresh.
166
202
167
203
---
@@ -187,9 +223,9 @@ python quality_dynamic.py
187
223
Ensure the pattern is visible, not motion-blurred, and covers diverse regions of the image. Increase lighting, adjust exposure, or hold the rig steady.
188
224
189
225
-**Disparity looks worse after apply**
190
-
Re-run to collect more diverse views (tilt/translate the target), or try `OPTIMIZE_PERFORMANCE`. Check for lens smudges and ensure focus is appropriate.
226
+
Re-run to collect more diverse views (tilt/translate the target).
191
227
192
228
-**Typos in prints**
193
229
The examples should print “Successfully calibrated” and “Rotation difference” (avoid “Succesfully”/“dofference” if copying code).
0 commit comments