Skip to main content

Dora Node for capturing video with Pyrealsense

Project description

Dora Node for capturing video with PyRealSense

This node is used to capture video from a camera using PyRealsense.

Installation

Make sure to use realsense udev config at https://github.com/IntelRealSense/librealsense/blob/master/doc/installation.md

You can try, the following:

wget https://raw.githubusercontent.com/IntelRealSense/librealsense/refs/heads/master/scripts/setup_udev_rules.sh

mkdir config
cd config
wget https://raw.githubusercontent.com/IntelRealSense/librealsense/refs/heads/master/scripts/config/99-realsense-libusb.rules
cd ..

chmod +x setup_udev_rules.sh

YAML

- id: opencv-video-capture
  build: pip install ../../node-hub/opencv-video-capture
  path: opencv-video-capture
  inputs:
    tick: dora/timer/millis/16 # try to capture at 60fps
  outputs:
    - image: # the captured image

  env:
    PATH: 0 # optional, default is 0

    IMAGE_WIDTH: 640 # optional, default is video capture width
    IMAGE_HEIGHT: 480 # optional, default is video capture height

Inputs

  • tick: empty Arrow array to trigger the capture

Outputs

  • image: an arrow array containing the captured image
## Image data
image_data: UInt8Array # Example: pa.array(img.ravel())
metadata = {
  "width": 640,
  "height": 480,
  "encoding": str, # bgr8, rgb8
}

## Example
node.send_output(
  image_data, {"width": 640, "height": 480, "encoding": "bgr8"}
  )

## Decoding
storage = event["value"]

metadata = event["metadata"]
encoding = metadata["encoding"]
width = metadata["width"]
height = metadata["height"]

if encoding == "bgr8":
    channels = 3
    storage_type = np.uint8

frame = (
    storage.to_numpy()
    .astype(storage_type)
    .reshape((height, width, channels))
)

Examples

Check example at examples/python-dataflow

License

This project is licensed under Apache-2.0. Check out NOTICE.md for more information.

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

dora_pyrealsense-0.3.11.tar.gz (4.2 kB view details)

Uploaded Source

Built Distribution

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

dora_pyrealsense-0.3.11-py3-none-any.whl (4.5 kB view details)

Uploaded Python 3

File details

Details for the file dora_pyrealsense-0.3.11.tar.gz.

File metadata

  • Download URL: dora_pyrealsense-0.3.11.tar.gz
  • Upload date:
  • Size: 4.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.6.12

File hashes

Hashes for dora_pyrealsense-0.3.11.tar.gz
Algorithm Hash digest
SHA256 1fee85c4509b90b86e4cf59d2afc74bee63b1ca3adb43ee85c26bf98cb1e2c6b
MD5 7902abf47fa6dcf4da3c072c7dcc066e
BLAKE2b-256 1c521be26c8cbc2c068c1baed9fe82e6ef013a7fb491b7e8be7edf00536fa4e6

See more details on using hashes here.

File details

Details for the file dora_pyrealsense-0.3.11-py3-none-any.whl.

File metadata

File hashes

Hashes for dora_pyrealsense-0.3.11-py3-none-any.whl
Algorithm Hash digest
SHA256 6209dcb409212d0cfc7730b317b9190259d5bb0c4d1468a816191026f20f06cd
MD5 578800819c7231d59d1aa4ad69abb4fe
BLAKE2b-256 f25dab49f27229c24af3ce0d52e114bac779576215649d73f35e11145e11c672

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