Inside AI
← Build & Hack
Proposed build / Edge AI

Read a cup’s depth in a detection box

Run Orbbec’s host-side example and check how the label responds when you move a cup. A proposed extension adds a representative 3D surface point.

Device profile · Orbbec Gemini 336 ↗
Start with the documented setup

This is a proposed workflow. Follow the linked official setup, then use the checks below to decide whether it works on your hardware.

Run the manufacturer example

Connect the camera to the host, install pyorbbecsdk2 and the example dependencies, including ONNX Runtime. Use the v2-main repository so the script can find its helper files. In its object_detection directory, run python setup_model.py to obtain the model if needed, then python object_detection.py. Put a matte cup against a plain backdrop within the camera’s ideal range. Example and model setup The detection demo lists Windows x64 and Ubuntu x64 or ARM64 as supported hosts. Demo prerequisites

Check the depth label

When the detector finds the cup, the example collects positive depth readings inside the aligned box, filters outliers and displays the median in millimeters. Move the cup nearer while keeping the camera fixed. If the box is missing, check the color image and detector. If a box reads N/A, inspect its aligned depth pixels. If the value sticks to the wall, look for background inside the box.

Proposed extension: locate a visible point

Record the proportion of valid depth pixels. Select a valid cup pixel near the middle of the detection and use the calibrated color-camera intrinsics and its depth to compute X, Y and Z. Compare the axial Z reading with a ruler along the viewing axis. Report the coordinate frame and the sampled surface. For an arm, measure the camera-to-robot transform separately before interpreting these coordinates. This extension has not been tested by Inside AI.

Time each stage

On a fixed USB port and host, record stream profile, model and runtime. Count complete RGB-D frame pairs per second, time individual model calls and measure the time from capture to visible output with synchronized clocks or an external video reference. A 30 fps depth stream alone cannot establish any of those application timings.

Primary sources

Orbbec SDK v2 Python bindings pyorbbecsdk2 2.1.3 YOLOv5 object detection with aligned depth Two-point depth ruler