Operators |
find_2d_bar_code — Find regions that might contain a 2D bar code.
find_2d_bar_code is obsolete and is only provided for reasons of backward compatibility. New applications should use the functionality in the chapter Identification / Data Code for reading 2D data code symbologies instead (see create_data_code_2d_model).
find_2d_bar_code(Image : CodeRegion : BarCodeDescr, GenParamNames, GenParamValues : CodeRegDescr)
find_2d_bar_code searches in the image Image for regions that might contain a 2D bar code. Candidate regions are returned in the array of regions CodeRegion. Whether such a region really contains a (readable) 2D bar code can only be determined with the help of the operator get_2d_bar_code (or get_2d_bar_code_pos).
Besides regions that might contain a 2D bar code, the operator passes further, internal information about the regions to the operator for extracting the data from a symbol (get_2d_bar_code or get_2d_bar_code_pos). This information is stored in a region descriptor and returned in the parameter CodeRegDescr.
Depending on the method for printing the bar code ('mode' ), different image processing steps are performed. Together with other information about the 2D bar code, the actual printing method is part of a descriptor created with the help of the operator gen_2d_bar_code_descr and passed in the parameter BarCodeDescr.
In the case of difficult conditions, additional control parameters can be passed to the operator with the help of the (optional) generic parameters GenParamNames and GenParamValues, in the form of descriptor-value pairs. One group of parameters describes the appearance of the symbols in the actual images, e.g., the expected size of data elements in pixels. The operator will then check candidate regions against the specified criteria. Suitable values can be determined from the real images, e.g., by manually selecting a region with a bar code and then applying the corresponding operator. If the specification of such parameters does not lead to successfully extracted regions, the user can influence the underlying image processing operators directly with the help of a second group of parameters. As the image processing steps taken depend on the printing method, different parameters are to be applied.
Parameter that will be passed on in CodeRegDescr:
Mean size of a module (data element) in pixels. From this quantity, a set of other parameters will be derived. A module should have a size of 4 to 16 pixels in order to be recognized successfully.
GenParamValues: | > 0 |
default: | 10 |
Parameters for the printing method 'printed' :
The following parameters are used to limit the set of candidate regions with the help of region features. To prevent the use of a certain feature, the corresponding parameter must be set to -1.
Maximum anisometry (see operator eccentricity).
GenParamValues: | > 1 (-1: feature not used) |
default: | 1.45 |
Minimum compactness (see operator compactness).
GenParamValues: | > 1 (-1: feature not used) |
default: | 1.2 |
Maximum compactness.
GenParamValues: | >= 'compactness_min' (-1: feature not used) |
default: | 3.0 |
Maximum circularity (see operator circularity).
GenParamValues: | 0... 1.0 (-1: feature not used) |
default: | 0.8 |
Minimum circularity.
GenParamValues: | <= 'circularity_max' (-1: feature not used) |
default: | 0.45 |
Minimum deviation of gray values (see operator intensity).
GenParamValues: | > 1.0 (-1: feature not used) |
default: | 20.0 |
The following parameters are automatically derived from the size of a module, 'module_width' , and from parameters of the bar code descriptor BarCodeDescr (see operator gen_2d_bar_code_descr). However, they can be adjusted individually, too.
ATTENTION: If you want to set 'module_width' together with other parameters, make sure set 'module_width' BEFORE the others!
Mask size for the first smoothing of the image.
GenParamValues: | >= 3 |
default: | 2.5*'module_width' |
Mask size for the second smoothing of the image.
GenParamValues: | >= 5 |
default: | 10.0 * 'module_width' |
Minimum size of the symbol in pixels squared.
GenParamValues: | > 0 |
default: | 0.25 * 'module_width' ^2 * 'columns_min' * 'rows_min' |
Maximum size of the symbol in pixels squared.
GenParamValues: | >= 'area_min' |
default: | 4.00 * 'module_width' ^2 * 'columns_min' * 'rows_min' |
Mask size for calling the operator closing_circle with a test region..
GenParamValues: | > 0 |
default: | 'module_width' |
Parameters for the printing method 'engraved_darkfield' :
Minimum compactness (see operator compactness).
GenParamValues: | > 1.0 (-1: feature not used) |
default: | 1.2 |
Maximum compactness.
GenParamValues: | >= 'compactness_min' (-1: feature not used) |
default: | 3.0 |
Edge threshold.
GenParamValues: | 0 ... 255 |
default: | 120 |
Relation between the areas of the region and the smallest surrounding rectangle.
GenParamValues: | < 1.0 |
default: | 0.7 |
Mask size for the initial median filtering (see operator median_image).
GenParamValues: | > 0 |
default: | 0.1 * 'module_width' + 0.5 |
Parameters for the printing method 'engraved_lightfield' :
Maximum anisometry (see operator eccentricity).
GenParamValues: | > 1 (-1: feature not used) |
default: | 1.45 |
Minimum compactness (see operator compactness).
GenParamValues: | > 1 (-1: feature not used) |
default: | 1.2 |
Maximum compactness.
GenParamValues: | >= 'compactness_min' (-1: feature not used) |
default: | 3.0 |
Maximum circularity (see operator circularity).
GenParamValues: | 0... 1.0 (-1: feature not used) |
default: | 0.8 |
Minimum circularity.
GenParamValues: | <= 'circularity_max' (-1: feature not used) |
default: | 0.45 |
Minimum deviation of gray values (see operator intensity).
GenParamValues: | > 1.0 (-1: feature not used) |
default: | 20.0 |
Mask size for smoothing the image.
GenParamValues: | >= 3 |
default: | 10*'module_width' |
Minimum size of the symbol in pixels squared.
GenParamValues: | > 0 |
default: | 0.25 * 'module_width' ^2 * 'columns_min' * 'rows_min' |
Maximum size of the symbol in pixels squared.
GenParamValues: | >= 'area_min' |
default: | 4.00 * 'module_width' ^2 * 'columns_min' * 'rows_min' |
Mask size for calling the operator closing_circle with a test region.
GenParamValues: | > 0 |
default: | 'module_width' |
Mask size for calling the operator opening_circle with a test region.
GenParamValues: | > 0 |
default: | 1.5*'module_width' |
Image of one or more bar codes.
Regions that might contain a bar code.
Description of a 2D bar code class to look for.
List of names of (optional) generic parameters controlling the image processing.
Default value: []
List of values: 'anisometry_max' , 'area_max' , 'area_min' , 'circularity_max' , 'circularity_min' , 'closing_mask_rad' , 'compactness_max' , 'compactness_max' , 'compactness_min' , 'compactness_min' , 'deviation_min' , 'edge_thresh' , 'mean_mask_size' , 'mean_mask_size_1' , 'mean_mask_size_2' , 'median_mask_rad' , 'module_width' , 'opening_mask_rad' , 'region_rect2_rel'
List of values of generic parameters controlling the image processing.
Default value: []
List of values: 1, 1.1, 1.2, 1.3, 1.4, 1.5, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20
Additional parameters describing the bar code regions. They can be used for extracting the data (see decode_2d_bar_code).
The operator find_2d_bar_code returns the value 2 (H_MSG_TRUE) if the given parameters are correct. Otherwise, an exception will be raised.
Data Code
Operators |