Skip to main content

Unofficial pure-Python driver for the Orbbec Astra Pro IR/depth sensor

Project description

orbbec-astra-raw

Unofficial pure-Python driver for the Orbbec Astra Pro IR / depth sensor.

Works without the broken OpenNI2 / pyorbbecsdk stack. Reverse-engineered from raw USB traffic. No compiled extensions, no kernel drivers.

Supported hardware

Device VID:PID
Orbbec Astra Pro depth/IR sensor 2BC5:0403

The color camera (2BC5:0501) is a standard UVC webcam — use OpenCV's VideoCapture directly.

Install

# Core library only (numpy arrays, no viewer)
pip install orbbec-astra-raw

# With live viewer (requires OpenCV)
pip install orbbec-astra-raw[viewer]

Quick start

from astra_raw import AstraIRCamera

with AstraIRCamera() as cam:
    ir    = cam.read_ir()        # (480, 640) uint16 — raw Y11 values
    depth = cam.read_depth_mm()  # (480, 640) float32 — millimetres (0 = invalid)

CLI

# Live three-panel viewer: Depth | IR | Color
astra-ir-view

# Save one IR frame to PNG
astra-ir-save frame.png

# Dump one raw frame payload to binary
astra-ir-dump frame.bin

Viewer keys

Key Action
q quit
s save depth / IR / color PNGs to /tmp/
g / h IR gamma down / up
j / k IR lo-percentile down / up
n / m IR hi-percentile down / up
u toggle median blur
c toggle CLAHE
t toggle temporal smoothing on depth
p toggle speckle filter on depth

API

from astra_raw import AstraIRCamera, decode_y11_msb, parse_packet_stream

cam = AstraIRCamera()
cam.open()

ir    = cam.read_ir()           # (480, 640) uint16
depth = cam.read_depth_mm()     # (480, 640) float32 mm
raw   = cam.read_raw_group()    # bytes — undecoded Y11 payload

cam.close()

# Lower-level helpers
groups = parse_packet_stream(blob)   # {gid: [(seq, payload), ...]}
vals   = decode_y11_msb(payload)     # 1-D uint16 array

OS notes

Platform Status
macOS (Apple Silicon) works without sudo
Linux requires a udev rule for non-root USB access
Windows requires Zadig to bind WinUSB to 2BC5:0403

Linux udev rule

# /etc/udev/rules.d/99-orbbec-astra.rules
SUBSYSTEM=="usb", ATTRS{idVendor}=="2bc5", ATTRS{idProduct}=="0403", MODE="0666"

Then: sudo udevadm control --reload && sudo udevadm trigger

Windows

Install Zadig, select ASTRA Pro (PID 0403), install WinUSB, then run your Python script normally.

How it works

The sensor streams 3072-byte packets on USB bulk endpoint 0x81. Each packet has a 12-byte header (magic + seq + gid) followed by 3060 bytes of Y11 payload. Grouping 137 packets by their gid field assembles one frame.

The payload is decoded as 11-bit MSB-first (big-endian bit order) samples, reshaped to 1280x240, center-cropped to 640x240, and resized to 640x480.

Depth is estimated as K / disparity where K = 342 000 (focal-length x baseline x sub-pixel-factor for this sensor).

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

orbbec_astra_raw-0.1.0.tar.gz (24.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

orbbec_astra_raw-0.1.0-py3-none-any.whl (13.5 kB view details)

Uploaded Python 3

File details

Details for the file orbbec_astra_raw-0.1.0.tar.gz.

File metadata

  • Download URL: orbbec_astra_raw-0.1.0.tar.gz
  • Upload date:
  • Size: 24.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.4

File hashes

Hashes for orbbec_astra_raw-0.1.0.tar.gz
Algorithm Hash digest
SHA256 0861bbc02481e1549dbd29d5842a890a3cdd3334bfe93779bf0733470be4ad69
MD5 bb66ce3c8f5cd7abb52d52bd8ff07288
BLAKE2b-256 e8e477ca952f5a8d84363fc8ca6a976d858c30fa6656004a8941e75cf9a72364

See more details on using hashes here.

File details

Details for the file orbbec_astra_raw-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for orbbec_astra_raw-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7eb0049e5c92128671621b9c3263a059d2e2df391e717e99a7b161be4186f213
MD5 e59359da24da12c868233bc9a3b99884
BLAKE2b-256 a3c5a5a7c233a4cb40a56f91ce2f2214b7921419e97ef9d48ad98058281a0eb5

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page