Recognize Barcodes
Recognize barcodes in video
Overview
The Recognize Barcodes node decodes barcodes detected by an AI model, and adds metadata to the frame metadata.
Suggested use : AI Model Node (with Barcode model) -> Track Objects Node -> Recognize Barcodes Node
Inputs & Outputs
- Inputs : 1, Media Format : Raw Video
- Outputs : 1, Media Format: Raw Video
- Output Metadata : Barcode Information
Properties
| Property | Description | Type | Default | Required |
|---|---|---|---|---|
barcode_types | Comma-separated list of barcode types to recognize. Leave empty to detect all types. Options: AZTEC (ZXing engine only) (aztec); CODABAR (codabar); CODE128 (code128); CODE39 (code39); CODE93 (code93); COMPOSITE (ZBar engine only) (composite); DATAMATRIX (ZXing engine only) (datamatrix); DATABAR (databar); DATABAR EXPANDED (databar_exp); EAN2 (ZBar engine only) (ean2); EAN5 (ZBar engine only) (ean5); EAN8 (ean8); EAN13 (ean13); I25 (i25); ISBN10 (ZBar engine only) (isbn10); ISBN13 (ZBar engine only) (isbn13); MAXICODE (maxicode); PARTIAL (partial); PDF417 (pdf417); QRCODE (qrcode); MICROQRCODE (ZXing engine only) (microqrcode); RMQRCODE (ZXing engine only) (rmqrcode); UPCA (upca); UPCE (upce); All Linear Codes (ZXing engine only) (linearcodes); All Matrix Codes (ZXing engine only) (matrixcodes). Format: array of selected option values. | string[] | null | No |
display_info | Display barcode info on video? | bool | true | No |
preprocess | Enables preprocessing to enhance barcode image quality, which might improve detection rates. Options: Upscale (if too small) (upscale); Downscale (if too big) (downscale); Sharpen (sharpen); Rotate (attempt to straighten) (rotate). Format: array of selected option values. | string[] | null | No |
process_detected_barcodes_only | Disable to scan entire image for barcodes and increase processing time. Useful if the model doesn't detect barcodes well. | bool | true | No |
watchlist | Comma separated list of barcodes to watch for. | string | null | No |
watchlist_tolerance | Allow barcodes to differ by this number of characters from the watchlist. Unit: characters. | number | 0 | No |
barcode_engine | Select a barcode decoding engine. Options: ZXing (zxing); ZBar (zbar). | enum | zxing | Yes |
retention_duration | After this interval, a barcode that was seen previously will be treated as a new barcode. Unit: seconds. | float | 60 | No |
Output Metadata
The fields below are declared by this node's metadata schema; the JSON values are representative examples.
| Path | Type | Description |
|---|---|---|
nodes.<node_id>.barcode_count | integer | Number of decoded barcodes in the current frame. |
nodes.<node_id>.barcode_count_delta | integer | When one or more new barcodes are recognized |
nodes.<node_id>.watchlist_entered_delta | integer | When one or more new watchlist barcodes are recognized |
nodes.<node_id>.watchlist_exited_delta | integer | When one or more watchlist barcodes are no longer present |
nodes.<node_id>.barcodes[].type | string | Decoded barcode symbology. |
nodes.<node_id>.barcodes[].data | string | Decoded barcode contents. |
nodes.<node_id>.barcodes[].coords | array | Array of four numbers containing the barcode bounding box as x, y, width, and height. |
nodes.<node_id>.barcodes[].id | integer | Associated tracked object ID, or -1 for a full-frame decode. |
nodes.<node_id>.barcodes[].watchlist_match | boolean | Boolean indicating whether the decoded value matched the configured watchlist. |
nodes.<node_id>.barcodes[].watchlist_barcode | string | Configured watchlist value that matched this barcode, if any. |
nodes.<node_id>.type | string | Identifies the node type that produced this metadata. |
JSON example
{
"nodes": {
"annotate_barcode1": {
"barcode_count": 2,
"barcode_count_delta": 1,
"barcodes": [
{
"coords": [
104,
205
],
"data": "124314072131",
"id": 1203112309710239,
"type": "EAN13",
"watchlist_barcode": "value",
"watchlist_match": false
},
{
"coords": [
410,
445
],
"data": "203927812",
"id": 102397932481,
"type": "CODE128",
"watchlist_barcode": "value",
"watchlist_match": false
}
],
"type": "annotate_barcode",
"watchlist_entered_delta": 0,
"watchlist_exited_delta": 0
}
}
}Object labels and attributes
- Object labels/classes added: None.
- Object attribute labels/classes added: Recognized barcode data (
11000), barcode type (11001), andwatchlistfor a match (11002).
The following information is added to the detected object's "attributes" array:
| "class_id" | "label" | "probability" |
|---|---|---|
11000 | The recognized barcode result (string) | The barcode recognition confidence |
11001 | The recognized barcode type (string) | The barcode recognition confidence |
11002 | watchlist when the barcode matches | 1.0 |
"objects": [{
"id": 5750484150146564100,
"label": "barcode",
"class_id": 0,
"probability": 0.98,
"rect": {
"width": 47,
"top": 201,
"left": 656,
"height": 25.
},
"attributes": [{
"label": "124314072131",
"class_id": 11000,
"probability": 1.0,
},
{
"label": "EAN13",
"class_id": 11001,
"probability": 1.0,
}]
}]Updated 9 days ago
Did this page help you?
