$ cat rgbd-range/README.md
Independent Project · July – August 2026

Object detection with metric range on a Raspberry Pi 5 CPU

A C++ RGB-D pipeline that detects objects with YOLO11n and reads a distance for each one from an aligned depth frame. It all runs on the Pi 5 CPU, with no GPU.

Role
Solo project: model export, C++ pipeline and depth alignment
Goal
A metric range per detection on CPU-only hardware
Stack
C++ · YOLO11n · ONNX Runtime · Orbbec SDK v2 · Orbbec Gemini 335 · Raspberry Pi 5
90–110ms
per frame at 640x640, YOLO11n through ONNX Runtime on the Raspberry Pi 5 CPU (no GPU)
1 in 3
frames processed from a 30 FPS stream, so it doesn't keep up frame for frame
Problem

A bounding box doesn't tell you how far away something is

Detection gives a box in pixels. Anything that has to act on a detection, whether it stops, approaches or sorts, needs a distance in metres. An RGB-D camera has that in a second stream, but the depth frame has to be registered to the colour frame, and the loop has to fit a CPU budget on a Raspberry Pi 5 with no GPU.

Approach
01Built the frame loop in C++, with no Python in the loop.
02Ran YOLO11n through ONNX Runtime on the Pi 5 CPU, exporting the bare forward pass rather than a graph with post-processing included.
03Decoded the raw output tensor in C++ outside the model graph, writing the confidence threshold, box-format conversion and NMS by hand. I did this to control the threshold at runtime, make debugging easier and keep memory use predictable. It was a design choice, not a measured speed-up.
04Aligned depth to colour with Orbbec SDK v2, then read depth at each box centre. Without that alignment, the depth pixel you read isn't the one that was detected.
05Measured the loop at 90–110 ms per frame at 640x640 against a 30 FPS stream, so roughly every third frame gets processed.
Results
  • 90–110 ms per frame at 640x640 input on the Raspberry Pi 5 CPU, no GPU.
  • Against a 30 FPS stream, roughly every third frame is processed.
  • Metric range per detection from depth aligned to colour (Orbbec SDK v2).
  • Post-processing (threshold, box conversion and NMS) runs in C++ outside the model graph.
Limitations
  • Range is read at a single point, the box centre. If the centre lands on background rather than the object, the range is wrong.
Skills demonstrated
C++YOLO11nONNX Runtimetensor decoding · NMSOrbbec SDK v2RGB-D depth alignmentRaspberry Pi 5CPU edge inference