Skip to main content

Dora Node for capturing video with OpenCV

Project description

Dora Node for capturing video with OpenCV

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

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.0.1.tar.gz (2.7 kB view details)

Uploaded Source

Built Distribution

dora_pyrealsense-0.0.1-py2.py3-none-any.whl (3.6 kB view details)

Uploaded Python 2 Python 3

File details

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

File metadata

  • Download URL: dora_pyrealsense-0.0.1.tar.gz
  • Upload date:
  • Size: 2.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.2 CPython/3.12.3 Linux/6.8.0-47-generic

File hashes

Hashes for dora_pyrealsense-0.0.1.tar.gz
Algorithm Hash digest
SHA256 bea7701a41447f264690a20113709b8bc7c689939f5e142811184697c82d7a0f
MD5 7aea9020517f3e4b507a891da0cd8273
BLAKE2b-256 41c7f8a4af90bb010a6e64c7ffdddb920c6e2f447cbc848c4dd417acde8eb647

See more details on using hashes here.

File details

Details for the file dora_pyrealsense-0.0.1-py2.py3-none-any.whl.

File metadata

  • Download URL: dora_pyrealsense-0.0.1-py2.py3-none-any.whl
  • Upload date:
  • Size: 3.6 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.2 CPython/3.12.3 Linux/6.8.0-47-generic

File hashes

Hashes for dora_pyrealsense-0.0.1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 8c5daa70f68cfc01a2d6284ad45c7f2a49c436b6861946bd389aa9a0bcab4f25
MD5 eaa2cff22315f7ce56deaca09a584f05
BLAKE2b-256 83871dba4286b7b318f34ead4fdf47dbadaf4d0641857aaa34b7b60ff5aa005f

See more details on using hashes here.

Supported by

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