Class for decoding. More...
Public Member Functions | |
Union[cvb.code_reader.DataMatrix] | config (self, int symbology) |
Retrieves the configuration object for a specific symbology. | |
cvb.code_reader.Decoder | create () |
Creates and returns a new decoder object. | |
List[cvb.code_reader.Result] | execute (self, cvb.ImagePlane plane) |
Performs the decoding. | |
List[cvb.code_reader.Result] | execute (self, cvb.ImagePlane plane, cvb.Rect aoi) |
Properties | |
all_2d_codes_enabled = property | |
bool: Gets or sets the status whether all 2D codes are enabled. | |
all_common_1d_codes_enabled = property | |
bool: Gets or sets the status whether all common 1D codes are enabled. | |
custom_performance = property | |
int: Gets or sets the custom image processing method used to optimize decoding robustness and performance (see cvb.code_reader.CustomPerformance). | |
detector_density = property | |
int: Gets or sets the detector density to control the search aggressiveness for small codes. | |
is_basic_inkjet_dpm_enabled = property | |
bool: Gets or sets the status of the Basic Inkjet DPM (Direct Part Marking) code decoding feature. | |
Class for decoding.
This class provides the core functionality for detecting codes and decoding them in images. Each code type can be configured using its corresponding configuration class.
To decode an image containing a supported code, 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 code_reader.Symbology. All supported code types are enumerated in the enum class code_reader.Symbology.
After configuring the decoder, load an image containing the code(s) and execute the decoding process. The following code snippet demonstrates how to decode an image containing Data Matrix and QR codes:
Union[cvb.code_reader.DataMatrix] config | ( | self, | |
int | symbology ) |
Retrieves the configuration object for a specific 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:
symbology : int The symbology for which the configuration is retrieved (see cvb.code_reader.Symbology).
Union[cvb.code_reader.DataMatrix] A reference to the configuration object corresponding to the specified symbology.
cvb.code_reader.Decoder create | ( | ) |
Creates and returns a new decoder object.
cvb.code_reader.Decoder Newly created decoder object.
List[cvb.code_reader.Result] execute | ( | self, | |
cvb.ImagePlane | plane ) |
Performs the decoding.
plane : cvb.ImagePlane The image plane containing the code(s) to decode.
List[cvb.code_reader.Result] A list of result objects containing the decoded code data.
List[cvb.code_reader.Result] execute | ( | self, | |
cvb.ImagePlane | plane, | ||
cvb.Rect | aoi ) |
plane : cvb.ImagePlane The image plane containing the code(s) to decode.
aoi : cvb.Rect The area of interest within the image where the decoding operation will be performed.
List[cvb.code_reader.Result] A list of result objects containing the decoded code data.
|
static |
bool: Gets or sets the status whether all 2D codes are enabled.
True
if all 2D codes are enabled, False
otherwise.
|
static |
bool: Gets or sets the status whether all common 1D codes are enabled.
Enables Code128, Code39, UPCA, UPCE, EAN8, EAN13, Interleaved2of5, Code93, GS1DataBar codes. True
if all common 1D codes are enabled, False
otherwise.
|
static |
int: Gets or sets the custom image processing method used to optimize decoding robustness and performance (see cvb.code_reader.CustomPerformance).
The default setting is code_reader.CustomPerformance.None.
|
static |
int: Gets or 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. Valid values range from 1 to 4 (inclusive).
|
static |
bool: Gets or sets the status of the Basic Inkjet DPM (Direct Part Marking) code decoding feature.
True if the decoding feature is enabled, False otherwise. This setting applies exclusively to DPM codes. Enabling Basic Inkjet DPM allows for the reading of low-quality inkjet images.
We use cookies to improve your experience. By using this documentation, you agree to our use of cookies.