Files
dora-image-view/dora-node.yml
T
cristhian 0efeacd538 add a depth map panel
The node showed a colour image only, so debugging a depth pipeline meant
either trusting the numbers or writing a throwaway viewer. It now keeps one
panel per frame stream -- image and depth -- and tiles them side by side,
scaled to a common height. Wiring one is a plain viewer; wiring both shows
them together. bbox and text stay overlays rather than panels.

The contract follows what dora-zed already publishes: float32 [H, W] in
millimetres with 0 for missing. It is sent there as a raw byte slice, so the
payload arrives as UInt8 despite the Float32 contract and is reinterpreted
rather than converted.

Auto-ranging the colormap over the valid pixels' full extent, rather than over
a percentile of them, is deliberate and was not the first attempt: trimming
the tails collapsed on the scene the node exists for. A small object in front
of a large wall is a few percent of the pixels, so both tails landed on the
wall and the object clipped away. Rendering a frame and looking at it found
that; every test passed either way.

Verified with dora-cli 1.0.1: validate passes with both contracts injected,
the dataflow runs both nodes to a clean exit, and a composed frame was
rendered and inspected.
2026-09-15 05:06:50 -03:00

82 lines
3.0 KiB
YAML

# Node manifest: the typed contract a consumer wires against.
#
# No source package is shared between node repositories, so this file and its
# type URNs are the only contract a consumer has. `dora validate` checks a
# dataflow against it without running the node, so CI needs neither OpenCV nor
# a display.
apiVersion: 1
name: dora-image-view
namespace: liria
description: Displays an image and a depth map side by side in an OpenCV window, with bounding box and text overlays
categories: [visualization, debug]
keywords: [opencv, view, bbox, bounding-box, image, depth, visualization, object-detection]
runtime: python
entrypoint: dora-image-view
# `dora build --uv` / `dora run --uv` rewrites this to `uv pip install .` and
# gives the node its own managed venv under `.dora/python-envs/`, so the
# dependencies it sees at runtime are the ones installed here.
build: pip install .
dora: ">=1.0"
inputs:
image:
type: std/core/v1/UInt8
required: false
description: >-
Base image to draw on: a flat UInt8 buffer described by the metadata
{width, height, encoding}. Supported encodings: bgr8, rgb8,
jpeg/jpg/jpe/bmp/webp/png (encoded bytes), yuv420, avif. Receiving this
input triggers a redraw and display.
bbox:
required: false
description: >-
Bounding boxes to overlay: an Arrow struct with fields {bbox, conf,
labels} and metadata {format}. Supported formats: xyxy, xywh. Stored and
drawn on the next image redraw. Deliberately untyped — senders differ in
whether the numeric fields are 32- or 64-bit, and the node casts either.
text:
type: std/core/v1/String
required: false
description: >-
Text string to overlay at the top-left corner. Stored and drawn on the
next image redraw.
depth:
type: std/core/v1/Float32
required: false
description: >-
Depth map as a flat Float32 buffer, described by the metadata
{shape: [height, width], units}. Millimetres unless `units` says `m`;
0 and non-finite values are missing depth and draw black. Colour-mapped
into its own panel, which receiving this input redraws.
outputs: {}
env:
VIEW_DEPTH_MIN_MM:
type: float
description: >-
Pin the near end of the depth colour range, in millimetres. Each end is
auto-ranged over the valid pixels of the current frame when it is unset.
VIEW_DEPTH_MAX_MM:
type: float
description: Pin the far end of the depth colour range, in millimetres.
VIEW_WIDTH:
type: int
description: Resize the displayed frame to this width (pixels). Defaults to the image input width.
VIEW_HEIGHT:
type: int
description: Resize the displayed frame to this height (pixels). Defaults to the image input height.
example: |
- id: view
git: ssh://git@gitea.liria.cl:5001/liria/dora-image-view.git
tag: v0.1.0
build: pip install .
path: dora-image-view
inputs:
image: camera/image_bgr
depth: camera/depth
bbox: detector/bbox
text: detector/text