Get one or several parameters that describe the 2D data code model.
The operator get_data_code_2d_param allows to query the parameters that are used to describe the 2D data code model. The names of the desired parameters are passed in the generic parameter GenParamNames, the corresponding values are returned in GenParamValues. All these parameters can be set and changed at any time with the operator set_data_code_2d_param. A list with the names of all parameters that are valid for the used 2D data code type is returned by the operator query_data_code_2d_params.
The following parameters can be queried - ordered by different categories and data code types:
Size and shape of the symbol:
Data matrix ECC 200 (including the finder pattern):
- 'symbol_cols_min': minimum number of module columns in the symbol.
- 'symbol_cols_max': maximum number of module columns in the symbol.
- 'symbol_rows_min': minimum number of module rows in the symbol.
- 'symbol_rows_max': maximum number of module rows in the symbol.
- 'symbol_shape': possible restrictions concerning the module shape (rectangle and/or square): 'square', 'rectangle', 'any'. Since HALCON 7.1.1, the same search algorithm is used for both shapes.
QR Code (including the finder pattern):
- 'model_type': type of the QR Code model specification: 1, 2, 'any'
- 'version_min': minimum symbol version to be read: [1..40] (Model 1: [1..14])
- 'version_max': maximum symbol version to be read: [1..40] (Model 1: [1..14])
- 'symbol_size_min': minimum symbol size (this value is directly linked to the version 'version_min'): [21..177] (Model 1: [21..73])
- 'symbol_size_max': maximum symbol size (this value is directly linked to the version 'version_max'): [21..177] (Model 1: [21..73])
PDF417:
- 'symbol_cols_min': minimum number of data columns in the symbol in codewords, i.e., excluding the codewords of the start/stop pattern and of the two row indicators.
- 'symbol_cols_max': maximum number of data columns in the symbol in codewords, i.e., excluding the codewords of the start/stop pattern and of the two row indicators.
- 'symbol_rows_min': minimum number of module rows in the symbol.
- 'symbol_rows_max': maximum number of module rows in the symbol.
Appearance of the modules in the image:
All data code types:
- 'polarity': possible restrictions concerning the polarity of the modules, i.e., if they are printed dark on a light background or vice versa: 'dark_on_light', 'light_on_dark', 'any'.
- 'mirrored': describes whether the symbol is or may be mirrored (which is equivalent to swapping the rows and columns of the symbol): 'yes', 'no', 'any'.
- 'contrast_min': minimum contrast between the foreground and the background of the symbol (this measure corresponds to the minimum gradient between the symbol's foreground and the background).
Data matrix ECC 200 and QR Code:
- 'module_size_min': minimum module size in the image in pixels.
- 'module_size_max': maximum module size in the image in pixels.
With the following parameters it is possible to specify whether neighboring foreground modules are connected or whether there is or may be a gap between them (possible values are 'no' (no gap) < 'small' < 'big'):
- 'module_gap_col_min': minimum gap in direction of the symbol columns.
- 'module_gap_col_max': maximum gap in direction of the symbol columns.
- 'module_gap_row_min': minimum gap in direction of the symbol rows.
- 'module_gap_row_max': maximum gap in direction of the symbol rows.
PDF417:
- 'module_width_min': minimum module width in the image in pixels.
- 'module_width_max': maximum module width in the image in pixels.
- 'module_aspect_min': minimum module aspect ratio (module height to module width).
- 'module_aspect_max': maximum module aspect ratio (module height to module width).
Data matrix ECC 200:
- 'slant_max': maximum slant of the L-shaped finder (the angle is returned in radians and corresponds to the distortion that occurs when the symbol is printed or during the image acquisition).
- 'module_grid': describes whether the size of the modules may vary (in a specific range) or not. Dependent on the parameter different algorithms are used for the calculation of the module's center positions. If it is set to 'fixed', an equidistant grid is used. Allowing a variable module size ('variable'), the grid is aligned only to the alternating side of the finder pattern. With 'any' both approaches are tested one after the other.
QR Code:
- 'position_pattern_min': Number of position detection patterns that have to be visible for generating a new symbol candidate (2 or 3).
General model behavior:
All data code types:
- 'persistence': controls whether certain intermediate results of the symbol search with find_data_code_2d are stored only temporarily or persistently in the model: 0 (temporary), 1 (persistent).
- 'strict_model': controls the behavior of find_data_code_2d while detecting symbols that could be read but that do not fit the model restrictions concerning the size of the symbols: 'yes' (strict: such symbols are rejected), 'no' (not strict: all readable symbols are returned as a result independent of their size and the size specified in the model).
It is possible to query the values of several or all parameters with a single operator call by passing a tuple containing the names of all desired parameters to GenParamNames. As a result a tuple of the same length with the corresponding values is returned in GenParamValues.
|
DataCodeHandle (input_control) |
datacode_2d -> integer |
| Handle of the 2D data code model. | |
|
GenParamNames (input_control) |
string(-array) -> string |
| Names of the generic parameters that are to be queried for the 2D data code model. | |
| Default value: 'contrast_min' | |
| List of values: 'strict_model', 'persistence', 'polarity', 'mirrored', 'contrast_min', 'model_type', 'version_min', 'version_max', 'symbol_size_min', 'symbol_size_max', 'symbol_cols_min', 'symbol_cols_max', 'symbol_rows_min', 'symbol_rows_max', 'symbol_shape', 'module_size_min', 'module_size_max', 'module_width_min', 'module_width_max', 'module_aspect_min', 'module_aspect_max', 'module_gap_col_min', 'module_gap_col_max', 'module_gap_row_min', 'module_gap_row_max', 'slant_max', 'module_grid', 'position_pattern_min' | |
|
GenParamValues (output_control) |
string(-array) -> string / integer / real |
| Values of the generic parameters. | |
The operator get_data_code_2d_param returns the value 2 (H_MSG_TRUE) if the given parameters are correct. Otherwise, an exception will be raised.
get_data_code_2d_param is reentrant and processed without parallelization.
query_data_code_2d_params, set_data_code_2d_param, find_data_code_2d
find_data_code_2d, write_data_code_2d_model
query_data_code_2d_params, set_data_code_2d_param, get_data_code_2d_results, get_data_code_2d_objects, find_data_code_2d
Data Code