Class for decoding. More...
#include <decl_decoder.hpp>
Public Member Functions | |
| std::vector< Result > | Execute (const ImagePlane &plane, const Rect< int > &aoi) |
| Performs the decoding. | |
| std::vector< Result > | Execute (const ImagePlane &plane) |
| Performs the decoding. | |
| template<class Rep, class Period> | |
| TimeLimitedDecoderResult | ExecuteFor (const ImagePlane &plane, const Rect< int > &aoi, const std::chrono::duration< Rep, Period > &timeSpan) |
| Performs the decoding within a specified time limit. | |
| template<class Rep, class Period> | |
| TimeLimitedDecoderResult | ExecuteFor (const ImagePlane &plane, const std::chrono::duration< Rep, Period > &timeSpan) |
| Performs the decoding within a specified time limit. | |
| template<Symbology SYM> | |
| Config::Mapper< SYM >::Type & | Config () |
| Retrieves the configuration object for a specific symbology. | |
| void | SetBasicInkjetDPMEnabled (bool value) |
| Enables or disables the reading of Basic Inkjet DPM (Direct Part Marking) codes. | |
| bool | IsBasicInkjetDPMEnabled () const |
| Checks whether the Basic Inkjet DPM mode is enabled. | |
| void | SetCustomPerformance (CustomPerformance value) |
| Sets the custom image processing method used to optimize decoding robustness and performance. | |
| CodeReader::CustomPerformance | CustomPerformance () const |
| Retrieves the custom image processing method used to optimize decoding robustness and performance. | |
| void | SetDetectorDensity (int value) |
| Sets the detector density to control the search aggressiveness for small codes. | |
| int | DetectorDensity () const |
| Retrieves the detector density to control the search aggressiveness for small codes. | |
| void | SetCodeSearchSpeed (int value) |
| Sets the code search speed. | |
| int | CodeSearchSpeed () const |
| Retrieves the code search speed. | |
Static Public Member Functions | |
| static std::unique_ptr< Decoder > | Create () |
| Creates and returns a new Decoder instance. | |
Class for decoding.
This class provides the core functionality for detecting and decoding codes in images. Each codes type can be configured using its corresponding configuration class.
To decode an image containing a supported codes, start by creating a decoder. You can configure your decoder using the member function Decoder::Config(), which returns a reference to the desired configuration class. The configuration class is specified by the CodeReader::Symbology template. All supported codes types are enumerated in the enum class CodeReader::Symbology.
After configuring the decoder, load an image containing the codes(s) and execute the decoding process. The following code snippet demonstrates how to decode an image containing Data Matrix and QR codes:
|
inline |
Retrieves the code search speed.
For details refer to Cvb::CodeReader::Decoder::SetCodeSearchSpeed.
|
inline |
Retrieves the configuration object for a specific symbology.
Use this function to access the configuration settings for a particular symbology. After creating a decoder, you can obtain the desired configuration object as shown below:
Alternatively, you can utilize the fluent interface pattern for seamless configuration:
| SYM | The symbology for which the configuration is retrieved. |
|
inlinestatic |
Creates and returns a new Decoder instance.
std::unique_ptr pointing to the newly created Decoder object.
|
inline |
Retrieves the custom image processing method used to optimize decoding robustness and performance.
|
inline |
Retrieves the detector density to control the search aggressiveness for small codes.
For details refer to SetDetectorDensity.
|
inline |
Performs the decoding.
Up to 256 codes can be detected using this function.
| plane | The image plane containing the code(s) to be decoded. |
|
inline |
Performs the decoding.
For further details see function Execute(const ImagePlane &).
| plane | The image plane containing the code(s) to be decoded. |
| aoi | The area of interest within the image where the decoding operation will be performed. |
|
inline |
Performs the decoding within a specified time limit.
For further details see function ExecuteFor(const ImagePlane &, const std::chrono::duration<Rep, Period> &).
| Rep | An arithmetic type, or a class emulating an arithmetic type, representing the number of ticks. |
| Period | A std::ratio representing the tick period. |
| plane | The image plane containing the code(s) to be decoded. |
| aoi | The area of interest within the image where the decoding operation will be performed. |
| timeSpan | The maximum decoding time in milliseconds (0-60000). |
|
inline |
Performs the decoding within a specified time limit.
Starts the decoding process on the given image plane and continues until either all detectable codes have been processed or the specified time limit is reached.
The value of timeSpan must be in the range [0, 60000] milliseconds. A value of 0 disables the time limit and allows decoding to run without restriction.
| Rep | An arithmetic type, or a class emulating an arithmetic type, representing the number of ticks. |
| Period | A std::ratio representing the tick period. |
| plane | The image plane containing the code(s) to be decoded. |
| timeSpan | The maximum decoding time in milliseconds (0-60000). |
|
inline |
Checks whether the Basic Inkjet DPM mode is enabled.
true if the Basic Inkjet DPM mode is enabled, false otherwise.
|
inline |
Enables or disables the reading of Basic Inkjet DPM (Direct Part Marking) codes.
This setting applies exclusively to DPM codes. Enabling Basic Inkjet DPM allows for the reading of low-quality inkjet images.
| value | Set to true to enable Basic Inkjet DPM, false otherwise. |
|
inline |
Sets the code search speed.
Adjusts the trade-off between decoding speed, damage tolerance, and required code contrast. The default value (0) provides maximum damage tolerance and allows detection of low-contrast codes. Higher values increase search speed but reduce damage tolerance and require higher code contrast:
0 - Maximum damage tolerance, detects low-contrast codes (default)
1 - Faster, reduced damage tolerance, detects low-contrast codes
2 - Faster, further reduced damage tolerance, detects medium-contrast codes
3 - Fastest, same damage tolerance as level 2, detects high-contrast codes only
| value | Code search speed value between 0 and 3 (inclusive). |
|
inline |
Sets the custom image processing method used to optimize decoding robustness and performance.
The default setting is CustomPerformance::None.
| value | Value for image processing method. |
|
inline |
Sets the detector density to control the search aggressiveness for small codes.
Lower values increase the robustness when decoding small or poorly printed 2D codes, but may result in longer decoding times. Higher values reduce decoding time, but may decrease robustness for small codes. The default value is 3.
| value | Detector density value between 1 and 4 (inclusive). |