$ cat rgbd-range/README.md
Independent Project · July – August 2026
How far away is it? Detection plus metric range on a Raspberry Pi 5
A C++ RGB-D pipeline that detects objects with YOLO11n and reads a real distance for each one — running on the Pi 5 CPU, with no GPU anywhere in the loop.
Role
Solo — end-to-end: model export, C++ pipeline, depth alignment
Goal
A metric range per detection on CPU-only hardware
Key outcome
90–110 ms per frame at 640x640 on the Pi 5 CPU — roughly every third frame of a 30 FPS stream
Stack
C++ · YOLO11n · ONNX Runtime · Orbbec SDK v2 · Orbbec Gemini 335 · Raspberry Pi 5
90–110ms
per frame at 640x640 — YOLO11n via ONNX Runtime on the Raspberry Pi 5 CPU, no GPU
1 in 3
frames processed against a 30 FPS stream — not real-time frame-for-frame
C++
no Python interpreter in the frame loop on CPU-only hardware
A bounding box doesn't tell you how far away anything is
Detection gives you a box in pixels. Anything downstream that has to act — stop, approach, sort — needs a distance in metres. An RGB-D camera has that information in a second stream, but joining the two means the depth frame has to be registered to the colour frame, and the whole thing has to fit inside a CPU budget on a Raspberry Pi 5 with no GPU.
01Built the whole frame loop in C++ — no Python interpreter in the loop on CPU-only hardware.
02Ran YOLO11n through ONNX Runtime on the Pi 5 CPU, exporting the bare forward pass rather than a graph with post-processing baked in.
03Decoded the raw output tensor in C++ outside the model graph — confidence threshold, box-format conversion and NMS written by hand. Kept out of the graph for runtime control of the threshold, easier debugging and predictable memory; this was a control decision, not a measured speed optimization.
04Aligned the depth frame to colour via the Orbbec SDK v2, then read depth at each box centre for a metric range per detection. Alignment is the load-bearing part — with an unregistered depth frame, the pixel you read is not the pixel you detected.
05Measured the loop at 90–110 ms per frame at 640x640 on the Pi 5 CPU against a 30 FPS camera stream — roughly every third frame gets processed.
- 90–110 ms per frame at 640x640 input on the Raspberry Pi 5 CPU, no GPU
- Against a 30 FPS stream that is roughly every third frame — real-time only with that qualifier attached
- Metric range per detection from a depth frame aligned to colour with Orbbec SDK v2
- Detection post-processing — threshold, box conversion, NMS — hand-written in C++ outside the model graph, for runtime threshold control, debuggability and predictable memory
- Limitation: range is read at a single point, the box centre — a detection whose centre lands on background rather than on the object returns the wrong range
C++YOLO11nONNX Runtimetensor decoding · NMSOrbbec SDK v2RGB-D depth alignmentRaspberry Pi 5CPU edge inference