Skip to content

Commit e241e41

Browse files
committed
Fixing Ci/CD
1 parent 91031c1 commit e241e41

File tree

6 files changed

+927
-459
lines changed

6 files changed

+927
-459
lines changed

dynamic-calibration/README.md

Lines changed: 27 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ This example demonstrates **runtime stereo camera calibration** with the `Dynami
2929
- `numpy`
3030

3131
Install via:
32+
3233
```bash
3334
pip install -r requirements.txt
3435
```
@@ -44,42 +45,44 @@ python3 main.py --device 18443010C1BA9D1200
4445
```
4546

4647
When launched, the app starts a RemoteConnection server. Open the visualizer at:
48+
4749
```
4850
http://localhost:8082
4951
```
52+
5053
Replace `localhost` with your host IP if viewing from another machine.
5154

5255
## Controls
5356

5457
Use these keys while the app is running (focus the browser visualizer window):
5558

56-
| Key | Action |
57-
| --- | ------ |
58-
| `q` | Quit the app |
59-
| `h` | Toggle help panel |
60-
| `g` | Toggle Depth HUD (ROI readout) |
61-
| `r` | Start recalibration |
62-
| `d` | **Force** recalibration |
63-
| `l` | Load image(s) for calibration (shows coverage bar for ~2s) |
64-
| `c` | Calibration quality check |
65-
| `v` | **Force** calibration quality check |
66-
| `n` | Apply **NEW** calibration (when available) |
67-
| `o` | Apply **PREVIOUS** calibration (rollback) |
68-
| `p` | **Flash NEW/current** calibration to EEPROM |
69-
| `k` | **Flash PREVIOUS** calibration to EEPROM |
70-
| `f` | **Flash FACTORY** calibration to EEPROM |
59+
| Key | Action |
60+
| ----------- | ---------------------------------------------------------------------------------------- |
61+
| `q` | Quit the app |
62+
| `h` | Toggle help panel |
63+
| `g` | Toggle Depth HUD (ROI readout) |
64+
| `r` | Start recalibration |
65+
| `d` | **Force** recalibration |
66+
| `l` | Load image(s) for calibration (shows coverage bar for ~2s) |
67+
| `c` | Calibration quality check |
68+
| `v` | **Force** calibration quality check |
69+
| `n` | Apply **NEW** calibration (when available) |
70+
| `o` | Apply **PREVIOUS** calibration (rollback) |
71+
| `p` | **Flash NEW/current** calibration to EEPROM |
72+
| `k` | **Flash PREVIOUS** calibration to EEPROM |
73+
| `f` | **Flash FACTORY** calibration to EEPROM |
7174
| `w / a / s` | Move ROI up/left/down (Depth HUD).<br>**Note:** `d` is reserved for *Force recalibrate*. |
72-
| `z / x` | ROI size − / + |
75+
| `z / x` | ROI size − / + |
7376

74-
> **Status banners** appear in the **center** after critical actions (e.g., applying/ flashing calibration) and auto-hide after ~2s.
77+
> **Status banners** appear in the **center** after critical actions (e.g., applying/ flashing calibration) and auto-hide after ~2s.\
7578
> **Modals** (quality/recalibration) also appear centered and auto-hide after ~3.5s or on any key press.
7679
7780
## On‑screen UI Cheat Sheet
7881

79-
- **Help panel** (top-left): quick reference of all keys (toggle with `h`).
80-
- **Coverage bar** (center): big progress bar while collecting frames; also shown briefly (≈2s) after pressing `l`.
81-
- **Quality modal** (center): three colored segments (green/yellow/red) with a **downward** pointer (``) indicating rotation-change severity; optional line with depth-error deltas (@1m/2m/5m/10m).
82-
- **Recalibration modal** (center): “Recalibration complete”, significant-axis warning (if any), Euler angles, and depth-error deltas; suggests flashing if the change is significant.
82+
- **Help panel** (top-left): quick reference of all keys (toggle with `h`).
83+
- **Coverage bar** (center): big progress bar while collecting frames; also shown briefly (≈2s) after pressing `l`.
84+
- **Quality modal** (center): three colored segments (green/yellow/red) with a **downward** pointer (``) indicating rotation-change severity; optional line with depth-error deltas (@1m/2m/5m/10m).
85+
- **Recalibration modal** (center): “Recalibration complete”, significant-axis warning (if any), Euler angles, and depth-error deltas; suggests flashing if the change is significant.
8386
- **Depth HUD** (inline): shows depth/disp at the ROI center and mean within a tiny box; move with `w/a/s` (and resize with `z/x`).
8487

8588
## Output (console)
@@ -93,7 +96,7 @@ Use these keys while the app is running (focus the browser visualizer window):
9396

9497
## Tips & Notes
9598

96-
- To **flash** (EEPROM) from the UI you must pass the `device` into the controller (`dyn_ctrl.set_device(device)`).
99+
- To **flash** (EEPROM) from the UI you must pass the `device` into the controller (`dyn_ctrl.set_device(device)`).
97100
- If you link **disparity** instead of **depth** to the controller, call `dyn_ctrl.set_depth_units_is_mm(False)` so the HUD labels use “Disp” instead of meters.
98101
- The coverage percentage accepts either `[0..1]` or `[0..100]` from the device; the controller auto-detects and normalizes.
99102
- The **Collecting frames** bar hides automatically 2s after pressing `l`; during active recalibration (`r`/`d`) it stays up until calibration finishes.
@@ -108,6 +111,6 @@ pip install -r requirements.txt
108111
python3 main.py
109112
```
110113

111-
---
114+
______________________________________________________________________
112115

113-
If you use this as a base for your own app, the heart of the UX is `utils/dynamic_controler.py` — it wires `DynamicCalibration` queues and renders all overlays via `ImgAnnotations` so you don’t need `cv2.imshow()`.
116+
If you use this as a base for your own app, the heart of the UX is `utils/dynamic_controler.py` — it wires `DynamicCalibration` queues and renders all overlays via `ImgAnnotations` so you don’t need `cv2.imshow()`.

dynamic-calibration/main.py

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import numpy as np
21
import cv2
32

43
from depthai_nodes.node import ApplyColormap
@@ -13,14 +12,17 @@
1312
device = dai.Device(dai.DeviceInfo(args.device)) if args.device else dai.Device()
1413
# ---------- Pipeline definition ----------
1514
with dai.Pipeline(device) as pipeline:
16-
1715
# Create camera nodes
18-
cam_left = pipeline.create(dai.node.Camera).build(dai.CameraBoardSocket.CAM_B)
16+
cam_left = pipeline.create(dai.node.Camera).build(dai.CameraBoardSocket.CAM_B)
1917
cam_right = pipeline.create(dai.node.Camera).build(dai.CameraBoardSocket.CAM_C)
2018

2119
# Request full resolution NV12 outputs
22-
left_out = cam_left.requestFullResolutionOutput(dai.ImgFrame.Type.NV12, fps=args.fps_limit)
23-
right_out = cam_right.requestFullResolutionOutput(dai.ImgFrame.Type.NV12, fps=args.fps_limit)
20+
left_out = cam_left.requestFullResolutionOutput(
21+
dai.ImgFrame.Type.NV12, fps=args.fps_limit
22+
)
23+
right_out = cam_right.requestFullResolutionOutput(
24+
dai.ImgFrame.Type.NV12, fps=args.fps_limit
25+
)
2426

2527
# Stereo node
2628
stereo = pipeline.create(dai.node.StereoDepth)
@@ -38,24 +40,24 @@
3840
depth_parser.setColormap(cv2.COLORMAP_JET)
3941

4042
calibration = device.readCalibration()
41-
new_calibration = None
43+
new_calibration = None
4244
old_calibration = None
4345

4446
# --- existing ---
4547
calibration_output = dyn_calib.calibrationOutput.createOutputQueue()
46-
coverage_output = dyn_calib.coverageOutput.createOutputQueue()
47-
quality_output = dyn_calib.qualityOutput.createOutputQueue()
48-
input_control = dyn_calib.inputControl.createInputQueue()
48+
coverage_output = dyn_calib.coverageOutput.createOutputQueue()
49+
quality_output = dyn_calib.qualityOutput.createOutputQueue()
50+
input_control = dyn_calib.inputControl.createInputQueue()
4951
device.setCalibration(calibration)
5052

5153
# ---------- Visualizer setup ----------
52-
visualizer.addTopic("Left", stereo.syncedLeft, "images")
54+
visualizer.addTopic("Left", stereo.syncedLeft, "images")
5355
visualizer.addTopic("Right", stereo.syncedRight, "images")
54-
visualizer.addTopic("Depth", depth_parser.out, "images")
56+
visualizer.addTopic("Depth", depth_parser.out, "images")
5557

5658
dyn_ctrl = pipeline.create(DynamicCalibrationControler).build(
57-
preview=depth_parser.out, # for timestamped overlays
58-
depth=stereo.depth # raw uint16 depth in mm
59+
preview=depth_parser.out, # for timestamped overlays
60+
depth=stereo.depth, # raw uint16 depth in mm
5961
)
6062
visualizer.addTopic("DynCalib HUD", dyn_ctrl.out_annotations, "images")
6163

@@ -81,4 +83,4 @@
8183
if key != -1:
8284
dyn_ctrl.handle_key_press(key)
8385
if dyn_ctrl.wants_quit:
84-
break
86+
break

dynamic-calibration/utils/arguments.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ def initialize_argparser():
66
parser = argparse.ArgumentParser(
77
formatter_class=argparse.ArgumentDefaultsHelpFormatter
88
)
9-
parser.description = "This example showcases the capabinility of Dynamic Calibration on OAK devices. "
9+
parser.description = "This example showcases the capabinility of Dynamic Calibration on OAK devices. "
1010

1111
parser.add_argument(
1212
"-d",

0 commit comments

Comments
 (0)