barcode_reader is a stateless perception node that decodes barcodes
and 2D codes from a frame and emits a structured list of codes plus a
call_model-shaped detections projection — so the existing
perception chain (annotate, spatial_filter,
conditional/detection_event_gate, send_alert) consumes barcodes
with no special-casing.
The same node compiles into the edge worker (@cw.on_frame handler on
the device) when the workflow has Run on edge enabled and a Camera
Frame trigger upstream, and runs in the cloud workflow runner
otherwise (against an image_url or image_bytes from data_source /
call_model). The decode helpers live in src/lib/workflow_utils.py
and are inlined into the generated worker via inspect.getsource() so
the cloud and edge paths share one decoder implementation.
It is backed by zxing-cpp
(Apache-2.0), a fast native-C++ decoder with prebuilt Python wheels for
manylinux_x86_64, manylinux_aarch64 (Pi 4 / 5 64-bit), macOS, and
Windows. No GPU and no system package install — pip install zxing-cpp
inside the edge worker image is enough.
Typical chain for a “scan and alert” warehouse workflow:
Symbologies
Default is “any symbology zxing-cpp supports”. You can narrow it down to the formats you actually expect — this reduces false positives and shortens decode time per frame.Inputs
Outputs
Edge implementation
The node compiles into the same@cw.on_frame worker that the rest of
the perception chain uses. Runtime helpers (_decode_barcodes,
_barcode_codes_to_detections, plus the small _barcode_position_to_polygon
/ _barcode_polygon_bbox geometry helpers) are inlined at module scope
from src/lib/workflow_utils.py via inspect.getsource() and shared
across multiple barcode_reader nodes in the same worker. The
zxing-cpp wheel is lazy-imported on first decode so missing the
optional barcode SDK extra surfaces in node logs rather than blocking
worker startup.
The edge-ml-worker Docker image ships with zxing-cpp baked in (the
barcode extra is part of the default CYBERWAVE_SDK_EXTRAS). For a
custom Pi-slim image, include barcode alongside zenoh and
schedule and skip the heavier ml-* extras.
See Edge Workers for
the full lifecycle.
Companion nodes
annotate— draw decoded barcode boxes on the live overlay channel.spatial_filter— only count codes that fall inside an author-defined ROI (e.g. the conveyor belt zone).conditional— fire on first-seen, on a new payload, or only after a code has been visible for N frames.send_alert— escalate to an operator with the decoded payload attached.