You are here: Start » Function Reference » Computer Vision » Barcodes » DecodeBarcode

DecodeBarcode
Header: | FIL.h |
---|---|
Namespace: | fil |
Module: | Barcodes |
Translates an array of bar widths to sequence of digits or text in accordance to the selected barcode standard.
Applications: Decoding of barcodes whose bars have been measured in a non-standard way.
Syntax
void fil::DecodeBarcode ( const ftl::Array<float>& inBarWidths, ftl::Optional<fil::BarcodeFormat::Type> inBarcodeFormat, ftl::Conditional<ftl::String>& outDecodedText, ftl::Conditional<fil::BarcodeFormat::Type>& outBarcodeFormat )
Parameters
Name | Type | Default | Description | |
---|---|---|---|---|
![]() |
inBarWidths | const Array<float>& | Widths of the barcode bars (starting with width of the black bar) | |
![]() |
inBarcodeFormat | Optional<BarcodeFormat::Type> | EAN13 | Format of the barcode |
![]() |
outDecodedText | Conditional<String>& | Decoded barcode text or nothing if decoding failed | |
![]() |
outBarcodeFormat | Conditional<BarcodeFormat::Type>& | Decoded barcode format or nothing if decoding failed |
Description
This filter is especially useful when a barcode is not provided in a standard black and white printed form.
Use this filter to decode a barcode printed or engraved on circular or distorted surfaces. Also the filter can be used to decode a barcode when one of colors is transparent due to printing on glass or other transparent surface.
It can be useful in decoding damaged codes in which barcode position detection is very complex.
Use the ScanMultipleStripes filter to get the bar widths.
Hints
- Pass an array of computed widths of consecutive black and white bars to the inBarWidths input.
- Select inBarcodeFormat according to the type of codes you want to read. If you choose the wrong format, the codes will not be recognized. The Auto value causes decoding of UPC-A codes as EAN-13 codes.
Remarks
Minimal bar width requirement
To provide precise detection of the barcode width of the thinnest bar should be at least 1.5 pixels.
Depending on the barcode format guard or start/end code patterns must be readable.
Using a relative coordinate systems
Read more about Local Coordinate Systems in Machine Vision Guide: Local Coordinate Systems.
See Also
- ReadSingleBarcode – Detects and recognizes a single barcode on the input image.
- ReadMultipleBarcodes – Detects and recognizes multiple barcodes on the input image.
- RecognizeBarcode – Extracts information from a barcode located on the input image at a given position.