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/master/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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file dora_pyrealsense-0.3.12rc1.tar.gz.
File metadata
- Download URL: dora_pyrealsense-0.3.12rc1.tar.gz
- Upload date:
- Size: 4.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.7.17
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
df352113f6f95df7150440e7eda6e8d62bee8030eff4f058a20f0da9e28fbba6
|
|
| MD5 |
703240eda577808dd4a2b9d9f1c81d0f
|
|
| BLAKE2b-256 |
abe8557b6596fd7aa490c9eb545a005c7782ede47f9577c2e8d0e3f68cac8ab2
|
File details
Details for the file dora_pyrealsense-0.3.12rc1-py3-none-any.whl.
File metadata
- Download URL: dora_pyrealsense-0.3.12rc1-py3-none-any.whl
- Upload date:
- Size: 4.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.7.17
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b220fd9e4c6fa4ee951a498afb5e5d755864b02b05cfee7c93d139ce060858d1
|
|
| MD5 |
43a41d1dd0a4c47bd2b07c7284742045
|
|
| BLAKE2b-256 |
c70a41738cf187426b9d9d12f4bc16525118abe841aa5bf4d6d73acaaaf635c6
|