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
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
Close
Hashes for opencv_video_capture-0.3.6.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9fc15a8f95e4dc10e45e33f378ee7da1f1af0025510a5bad0f719fca90fea701 |
|
MD5 | a7f3df135080ccd88adfce251f8d5956 |
|
BLAKE2b-256 | 8b1b7f34b4cb273b6dbfe3edc9445b07ccd3d7520c0ef38ced304b7b205fc95f |
Close
Hashes for opencv_video_capture-0.3.6-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 78cbb93b8802bb1bff0633de4d7f058b9dd1c6da067be2a338258a3c59782d6f |
|
MD5 | 9a188734f31e9e0c860130f775572005 |
|
BLAKE2b-256 | 66d54d95c10c52a2421fd5c1baec87d4492e327e95ec63ff12c6046e92e1c56f |