![]() |
Zivid C++ API 2.18.0+1b44dbef-1
|
Class for enabling the detection of barcodes. More...
#include <Zivid/Experimental/Toolbox/Barcode.h>
Public Member Functions | |
| ZIVID_CORE_EXPORT | BarcodeDetector () |
| Constructor. | |
| ZIVID_CORE_EXPORT Settings2D | suggestSettings (Camera &camera) const |
| Get 2D capture settings that are ideal for barcode reading with the given camera. | |
| ZIVID_CORE_EXPORT std::vector< LinearBarcodeDetectionResult > | detectLinearCodes (const Frame2D &frame2d) const |
| Detect linear (1D) barcode candidate regions based on the result of a 2D capture. | |
| ZIVID_CORE_EXPORT std::vector< std::optional< LinearBarcodeDecodingResult > > | decodeLinearCodes (const std::vector< LinearBarcodeDetectionResult > &detectionResults, const LinearBarcodeFormatFilter &formatFilter=LinearBarcodeFormatFilter::all()) const |
| Decode linear (1D) barcode candidate regions. | |
| ZIVID_CORE_EXPORT std::vector< LinearBarcodeDecodingResult > | readLinearCodes (const Frame2D &frame2d, const LinearBarcodeFormatFilter &formatFilter=LinearBarcodeFormatFilter::all()) const |
| Detect and decode linear (1D) barcodes based on the result of a 2D capture. | |
| ZIVID_CORE_EXPORT std::vector< MatrixBarcodeDecodingResult > | readMatrixCodes (const Frame2D &frame2d, const MatrixBarcodeFormatFilter &formatFilter=MatrixBarcodeFormatFilter::all()) const |
| Detect and decode matrix (2D) barcodes based on the result of a 2D capture. | |
| ZIVID_CORE_EXPORT std::string | toString () const |
| Get string representation of the object. | |
Class for enabling the detection of barcodes.
Constructing an instance of this class initializes the resources needed for efficient barcode detection. For repeated detection it is recommended to keep and re-use an instance of this class and not create a new one every time.
The recommended workflow for detecting barcodes with an instance of this class is:
| ZIVID_CORE_EXPORT Zivid::Experimental::Toolbox::BarcodeDetector::BarcodeDetector | ( | ) |
Constructor.
| ZIVID_CORE_EXPORT std::vector< std::optional< LinearBarcodeDecodingResult > > Zivid::Experimental::Toolbox::BarcodeDetector::decodeLinearCodes | ( | const std::vector< LinearBarcodeDetectionResult > & | detectionResults, |
| const LinearBarcodeFormatFilter & | formatFilter = LinearBarcodeFormatFilter::all() ) const |
Decode linear (1D) barcode candidate regions.
This function attempts to decode barcode candidates that were previously detected using BarcodeDetector::detectLinearCodes. The ordering of the returned decoding results matches the ordering of the input detection results. If a specific candidate failed to decode, the corresponding element in the returned sequence will be nullopt.
By default this function will attempt to detect and decode all supported barcode formats. Users can achieve increased detection speed and reliability by using the formatFilter argument to specify a subset of formats, for example LinearBarcodeFormat::ean13 | LinearBarcodeFormat::ean8.
| detectionResults | Results from a previous call to detectLinearCodes |
| formatFilter | A filter defining which barcode formats to look for. |
| ZIVID_CORE_EXPORT std::vector< LinearBarcodeDetectionResult > Zivid::Experimental::Toolbox::BarcodeDetector::detectLinearCodes | ( | const Frame2D & | frame2d | ) | const |
Detect linear (1D) barcode candidate regions based on the result of a 2D capture.
This function detects potential barcode regions in the image but does not attempt to decode them. Since decoding has not yet been attempted, the list of regions returned are likely to contain some false positives (regions that look like barcodes but are not actually barcodes). Use BarcodeDetector::decodeLinearCodes to attempt to decode some or all candidate image regions.
| frame2d | A Frame2D instance from a 2D or 2D+3D capture |
| ZIVID_CORE_EXPORT std::vector< LinearBarcodeDecodingResult > Zivid::Experimental::Toolbox::BarcodeDetector::readLinearCodes | ( | const Frame2D & | frame2d, |
| const LinearBarcodeFormatFilter & | formatFilter = LinearBarcodeFormatFilter::all() ) const |
Detect and decode linear (1D) barcodes based on the result of a 2D capture.
By default this function will attempt to detect and decode all supported barcode formats. Users can achieve increased detection speed and reliability by using the formatFilter argument to specify a subset of formats, for example LinearBarcodeFormat::ean13 | LinearBarcodeFormat::ean8.
| frame2d | A Frame2D instance from a 2D or 2D+3D capture |
| formatFilter | A filter defining which barcode formats to look for. |
| ZIVID_CORE_EXPORT std::vector< MatrixBarcodeDecodingResult > Zivid::Experimental::Toolbox::BarcodeDetector::readMatrixCodes | ( | const Frame2D & | frame2d, |
| const MatrixBarcodeFormatFilter & | formatFilter = MatrixBarcodeFormatFilter::all() ) const |
Detect and decode matrix (2D) barcodes based on the result of a 2D capture.
By default this function will attempt to detect and decode all supported barcode formats. Users can achieve increased detection speed and reliability by using the formatFilter argument to specify a subset of formats, for example MatrixBarcodeFormat::qrcode | MatrixBarcodeFormat::dataMatrix.
| frame2d | A Frame2D instance from a 2D or 2D+3D capture |
| formatFilter | A filter defining which barcode formats to look for. |
| ZIVID_CORE_EXPORT Settings2D Zivid::Experimental::Toolbox::BarcodeDetector::suggestSettings | ( | Camera & | camera | ) | const |
Get 2D capture settings that are ideal for barcode reading with the given camera.
| camera | The camera to find barcode settings for. |
| ZIVID_CORE_EXPORT std::string Zivid::Experimental::Toolbox::BarcodeDetector::toString | ( | ) | const |
Get string representation of the object.