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. Options: aztec , codabar , code128 , code39 , code93 , composite , datamatrix , databar , databar_exp , ean2 , ean5 , ean8 , ean13 , i25 , isbn10 , isbn13 , maxicode , partial , pdf417 , qrcode , microqrcode , rmqrcode , upca , upce , linearcodes , matrixcodes . Leave empty to detect all types. | enum-multi | null | No |
display_info | Display barcode info on video? | bool | true | No |
preprocess | Apply image preprocessing. Options: upscale (if too small), downscale (if too big), sharpen , rotate (attempt to straighten). | enum-multi | null | No |
process_detected_barcodes_only | 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 |
barcode_engine | Select a barcode decoding engine. Options: zxing , zbar . | enum | zxing | Yes |
retention_duration | Duration (seconds) to remember barcodes. After this interval, a barcode that was seen previously will be treated as a new barcode. | float | 60 | No |
Metadata
Metadata Property | Description |
---|---|
nodes.<node_id> | Describes Barcode information for any decoded barcodes. Format: as defined in the table below. <node_id> for Recognize Barcode Nodes is of the form annotate_barcodeX (ex. annotate_barcode1 ) |
Example
"nodes": {
"annotate_barcode1": {
"type": "annotate_barcode",
"barcodes" : [
{
"type": "EAN13",
"data": "124314072131",
"coords": [104,205,100,300],
"id": 1203112309710239
},
{
"type": "CODE128",
"data": "203927812",
"coords": [410,445,120,340],
"id": 102397932481
}
],
"barcode_count": 2,
"barcode_count_delta": 1
}
}
Format
Key | Type | Description |
---|---|---|
barcodes | Array | True if motion is currently detected, else False |
barcodes[].type | Enum | Type of recognized barcode. One of the supported barcode_types values. |
barcodes[].data | String | Contents of the Barcode |
barcodes[].coords | Array | Where in the image the barcode is detected. Format: [x,y,width,height] |
barcodes[].id | Long Integer | Unique tracking ID for the detected barcode if a tracker is used and process_detected_barcodes_only is set to True. Else -1. |
barcode_count | Integer | Number of barcodes recognized. |
barcode_count_delta | Integer | Number of new barcodes recognized in this frame. |
Objects metadata augmentation
The following information is added to the detected object's "attributes"
array:
"class_id" field | "label" field | "probability" field |
---|---|---|
11000 | The recognized barcode result (string ) | The barcode recognition confidence |
11001 | The recognized barcode type (string ) | The barcode recognition confidence |
"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 about 1 month ago