ClassesClassesClassesClasses | | | | Operators

set_bar_code_paramset_bar_code_paramSetBarCodeParamset_bar_code_paramSetBarCodeParamSetBarCodeParam (Operator)

Name

set_bar_code_paramset_bar_code_paramSetBarCodeParamset_bar_code_paramSetBarCodeParamSetBarCodeParam — Set selected parameters of the bar code model.

Signature

set_bar_code_param( : : BarCodeHandle, GenParamNames, GenParamValues : )

Herror set_bar_code_param(const Hlong BarCodeHandle, const char* GenParamNames, double GenParamValues)

Herror T_set_bar_code_param(const Htuple BarCodeHandle, const Htuple GenParamNames, const Htuple GenParamValues)

Herror set_bar_code_param(const HTuple& BarCodeHandle, const HTuple& GenParamNames, const HTuple& GenParamValues)

void HBarCode::SetBarCodeParam(const HTuple& GenParamNames, const HTuple& GenParamValues) const

void SetBarCodeParam(const HTuple& BarCodeHandle, const HTuple& GenParamNames, const HTuple& GenParamValues)

void HBarCode::SetBarCodeParam(const HTuple& GenParamNames, const HTuple& GenParamValues) const

void HBarCode::SetBarCodeParam(const HString& GenParamNames, double GenParamValues) const

void HBarCode::SetBarCodeParam(const char* GenParamNames, double GenParamValues) const

void HOperatorSetX.SetBarCodeParam(
[in] VARIANT BarCodeHandle, [in] VARIANT GenParamNames, [in] VARIANT GenParamValues)

void HBarCodeX.SetBarCodeParam(
[in] VARIANT GenParamNames, [in] VARIANT GenParamValues)

static void HOperatorSet.SetBarCodeParam(HTuple barCodeHandle, HTuple genParamNames, HTuple genParamValues)

void HBarCode.SetBarCodeParam(HTuple genParamNames, HTuple genParamValues)

void HBarCode.SetBarCodeParam(string genParamNames, double genParamValues)

Description

The operator set_bar_code_paramset_bar_code_paramSetBarCodeParamset_bar_code_paramSetBarCodeParamSetBarCodeParam is used to set or change the different parameters of a bar code model in order to adapt to special properties of the bar codes or to a particular appearance in the image. All parameters can also be set while creating the bar code model with create_bar_code_modelcreate_bar_code_modelCreateBarCodeModelcreate_bar_code_modelCreateBarCodeModelCreateBarCodeModel. The current configuration of the bar code model can be queried with get_bar_code_paramget_bar_code_paramGetBarCodeParamget_bar_code_paramGetBarCodeParamGetBarCodeParam.

The following overview lists the different generic parameters with the respective value ranges and default values:

Size of bar code elements:

The first two parameters, 'element_size_min'"element_size_min""element_size_min""element_size_min""element_size_min""element_size_min" and 'element_size_max'"element_size_max""element_size_max""element_size_max""element_size_max""element_size_max", influence the search for candidate regions and the decoding of the bar code. But note that these values are not used as strict limits for the size of the elements of found bar codes, i.e., also bar codes with elements that are slightly smaller than 'element_size_min'"element_size_min""element_size_min""element_size_min""element_size_min""element_size_min" or slightly larger than 'element_size_max'"element_size_max""element_size_max""element_size_max""element_size_max""element_size_max" may be found.

'element_size_min'"element_size_min""element_size_min""element_size_min""element_size_min""element_size_min":

Minimal size of bar code elements, i.e. the minimal width of bars and spaces. The value of this parameter is defined in pixels. For low resolution bar codes, the value should be reduced to 1.5, and in some cases even as low as 1.2. In the case of huge bar codes, the value should be increased, which results in a shorter execution time and fewer candidates.

Typical values: [1.2 ... 10.0]

Default: 2.0

'element_size_max'"element_size_max""element_size_max""element_size_max""element_size_max""element_size_max":

Maximal size of bar code elements, i.e. the maximal width of bars and spaces. The value of this parameter is defined in pixels. It should be adequately low such that two neighboring bar codes are not fused into a single one. On the other hand the value should be sufficiently high in order to find the complete bar code region.

Typical values: [4.0 ... 60.0]

Default: 8.0

'element_size_variable'"element_size_variable""element_size_variable""element_size_variable""element_size_variable""element_size_variable":

In some bar code images, the smallest element size may vary across a given bar code object. These deformations might be caused by perspective projection or by deformations of the surface on which the bar code is printed (e.g. barrel distortion on a bottle). By default, the bar code reader cannot handle such distortions. However, if 'element_size_variable'"element_size_variable""element_size_variable""element_size_variable""element_size_variable""element_size_variable" is set to 'true'"true""true""true""true""true", the bar code reader tries to compensate for such distortions. Please note that in some situations it is still not possible to undistort the bar code image.

The parameter 'element_size_variable'"element_size_variable""element_size_variable""element_size_variable""element_size_variable""element_size_variable" applies to the following bar code types only:

Any other bar code type is unaffected by this parameter.

Values: 'false'"false""false""false""false""false", 'true'"true""true""true""true""true"

Default: 'false'"false""false""false""false""false"

'element_height_min'"element_height_min""element_height_min""element_height_min""element_height_min""element_height_min":

Minimal bar code height. The value of this parameter is defined in pixels. The default value is -1, meaning that the bar code reader automatically derives a reasonable height from the other parameters. Just for very flat and very high bar codes a manual adjustment of this parameter can be necessary. In the case of a bar code with a height of less than 16 pixels the respective height should be set by the user. Note, that the minimal value is 8 pixels. If the bar code is very high, i.e. 70 pixels and more, manually adjusting to the respective height can lead to a speed-up of the subsequent finding and reading operation.

Typical values: [-1, 8 ... 64]

Default: -1

Scanning settings:

'num_scanlines'"num_scanlines""num_scanlines""num_scanlines""num_scanlines""num_scanlines":

Maximum number of scanlines used during the scanning of a (candidate) bar code. If 'num_scanlines'"num_scanlines""num_scanlines""num_scanlines""num_scanlines""num_scanlines" is not set (the parameter has a value of 0) the maximum number of scanlines is determined internally and it will be 10 for all single-row bar codes, 20 for GS1 DataBar Stacked Omnidirectional, respectively, and 55 for GS1 DataBar Expanded Stacked. With this parameter, you can improve performance in two cases. In the first case, the image contains many false candidates. While the bar code itself is usually decoded after one or two scans (except for stacked bar codes, see below), a false candidate is scanned with the default value of 10 scanlines, which increases the runtime unnecessarily. Reducing the number of scanlines can therefore improve performance in images with many false candidates. As a rule of thumb, images with higher quality need less scanlines than images of lower quality. For an average image, a value between 2 and 5 should be sufficient. If a bar code can, however, not be detected after reducing the number of scanlines, the number has to be increased again. The second case concerns stacked bar codes (currently GS1 DataBar Stacked, GS1 DataBar Stacked Omnidirectional, and GS1 DataBar Expanded Stacked). Here, all scanlines are evaluated, in contrast to single-row bar codes (e.g., Code 128, EAN 13, or GS1 DataBar Limited) where the scanning stops after the code is decoded successfully. Since the scanning of the scanlines is actually one of the most time consuming parts of the find_bar_codefind_bar_codeFindBarCodefind_bar_codeFindBarCodeFindBarCode algorithm, adjusting 'num_scanlines'"num_scanlines""num_scanlines""num_scanlines""num_scanlines""num_scanlines" might result in essential performance improvements. This is especially valid for GS1 DataBar Expanded Stacked. A GS1 DataBar Expanded Stacked symbol might have up to 11 rows and therefore 55 scanlines are required to robustly detect all of them. If only symbols with smaller number of rows are expected, one can reduce 'num_scanlines'"num_scanlines""num_scanlines""num_scanlines""num_scanlines""num_scanlines" leaving 1.5 to 5 scanlines per row.

This parameter can be set specifically for different types of bar codes by using the operator set_bar_code_param_specificset_bar_code_param_specificSetBarCodeParamSpecificset_bar_code_param_specificSetBarCodeParamSpecificSetBarCodeParamSpecific.

Typical values: [0, 5, 10, 20 ...]

Default: 0

'min_identical_scanlines'"min_identical_scanlines""min_identical_scanlines""min_identical_scanlines""min_identical_scanlines""min_identical_scanlines":

Minimal number of successfully decoded scanlines, which return identical data, for a decoding of a bar code symbol to be accepted. If this parameter is not set (has a value of 0) a bar code is considered decoded with the first scanline, which was successfully decoded (in the case of stacked codes, it must be a successful scanline per symbol row). Increasing this parameter to 2 or more is particularly useful, when it has to be prevented that a bar code is detected accidentally. This can typically happen if a scanline extracted erronous or false edges out of a low quality image or in a very noisy image fragment. This parameter reduces the false detection also in cases where a specific bar code type is searched for in an image containing symbols from other bar code symbologies.

This parameter can be set specifically for different types of bar codes by using the operator set_bar_code_param_specificset_bar_code_param_specificSetBarCodeParamSpecificset_bar_code_param_specificSetBarCodeParamSpecificSetBarCodeParamSpecific.

Typical values: [0, 2, 3, ...]

Default: 0

'stop_after_result_num'"stop_after_result_num""stop_after_result_num""stop_after_result_num""stop_after_result_num""stop_after_result_num":

Number of successfully decoded bar codes after which the decoding will stop. If this parameter is not set (has a value of 0), all bar code candidates are decoded. Typically, this parameter is set if the number of expected bar codes is known in advance. Then the bar code reader can abort further decoding of candidates after a certain number of bar codes has been found and the overall decoding time will decrease.

Typical values: [0, 1, 2, ...]

Default: 0

'orientation'"orientation""orientation""orientation""orientation""orientation":

Expected bar code orientation. A potential (candidate) bar code contains bars with similar orientation. The 'orientation'"orientation""orientation""orientation""orientation""orientation" and 'orientation_tol'"orientation_tol""orientation_tol""orientation_tol""orientation_tol""orientation_tol" parameters are used to specify the range ['orientation'"orientation""orientation""orientation""orientation""orientation"-'orientation_tol'"orientation_tol""orientation_tol""orientation_tol""orientation_tol""orientation_tol", 'orientation'"orientation""orientation""orientation""orientation""orientation"+'orientation_tol'"orientation_tol""orientation_tol""orientation_tol""orientation_tol""orientation_tol"]. find_bar_codefind_bar_codeFindBarCodefind_bar_codeFindBarCodeFindBarCode processes a candidate bar code only when the avarage orientation of its bars lies in this range. If the bar codes are expected to appear only in certain orientations in the processed images, one can reduce the orientation range adequately. This enables an early identification of false candidates and hence shorter execution times. This adjustment can be used for images with a lot of texture, which includes fragments tending to result in false bar code candidates.

The actual orientation angle of a bar code is explained with get_bar_code_resultget_bar_code_resultGetBarCodeResultget_bar_code_resultGetBarCodeResultGetBarCodeResult(...,'orientation'"orientation""orientation""orientation""orientation""orientation",...) with the only difference that for the early identification of false candidates the reading direction of the bar codes is ignored, which results in relevant orientation values only in the range [-90.0 ... 90.0]. The only exception to this rule constitutes the bar code symbol PharmaCode, which possesses a forward and a backward reading direction at the same time: here, 'orientation'"orientation""orientation""orientation""orientation""orientation" can take values in the range [-180.0 ... 180.0] and the decoded result is unique corresponding to just one reading direction.

This parameter can be set specifically for different types of bar codes by using the operator set_bar_code_param_specificset_bar_code_param_specificSetBarCodeParamSpecificset_bar_code_param_specificSetBarCodeParamSpecificSetBarCodeParamSpecific.

Typical values: [-90.0 ... 90.0]

Default: 0.0

'orientation_tol'"orientation_tol""orientation_tol""orientation_tol""orientation_tol""orientation_tol":

Orientation tolerance. Please refer to the explanation of 'orientation'"orientation""orientation""orientation""orientation""orientation" parameter for further information. As explained there, relevant orientation values are only in the range of [-90.0 ... 90.0], which means that with 'orientation_tol'"orientation_tol""orientation_tol""orientation_tol""orientation_tol""orientation_tol" = 90 the whole range is spanned. Therefore, valid values for 'orientation_tol'"orientation_tol""orientation_tol""orientation_tol""orientation_tol""orientation_tol" are only in the range of [0.0 ... 90.0]. The default value 90.0 means that no restriction on the bar code candidates is performed.

This parameter can be set specifically for different types of bar codes by using the operator set_bar_code_param_specificset_bar_code_param_specificSetBarCodeParamSpecificset_bar_code_param_specificSetBarCodeParamSpecificSetBarCodeParamSpecific.

Typical values: [0.0 ... 90.0]

Default: 90.0

'quiet_zone'"quiet_zone""quiet_zone""quiet_zone""quiet_zone""quiet_zone":

Enforces the verification of the quiet zones of a bar code symbol. When enabled, scanlines are rejected when unexpected bars are detected within the quiet zones both left or right of a detected bar code sequence. With 'quiet_zone'"quiet_zone""quiet_zone""quiet_zone""quiet_zone""quiet_zone"='true'"true""true""true""true""true" the quiet zones must be at least as wide as specified by the corresponding bar code standard. The following values apply (in X units, where X stands for "module width" and corresponds to the smallest width of a bar in the sequence):

    Barcode Type     Left QZ  Right QZ    Barcode Type                 Left QZ  Right QZ
    ---------------  -------  --------    ---------------------------  -------  --------
                                       
    2/5 Industrial    10       10         UPC-A                         9        9
    2/5 Interleaved   10       10         UPC-A Add-On 2                9        5
    Codabar           10       10         UPC-A Add-On 5                9        5
    Code 39           10       10         UPC-E                         9        7
    Code 93           10       10         UPC-E Add-On 2                9        5
    Code 128          10       10         UPC-E Add-On 5                9        5
    MSI               10       10         GS1-128                       10       10
    PharmaCode        5        5          GS1 DataBar Omnidir           1        1
    EAN-8             7        7          GS1 DataBar Truncated         1        1
    EAN-8 Add-On 2    7        5          GS1 DataBar Stacked           1        1
    EAN-8 Add-On 5    7        5          GS1 DataBar Stacked Omnidir   1        1
    EAN-13            11       7          GS1 DataBar Limited           1        1
    EAN-13 Add-On 2   11       5          GS1 DataBar Expanded          1        1
    EAN-13 Add-On 5   11       5          GS1 DataBar Expanded Stacked  1        1
  

With 'quiet_zone'"quiet_zone""quiet_zone""quiet_zone""quiet_zone""quiet_zone" set to an integer value greater than or equal 1, the quiet zones must be at least as wide as 'quiet_zone'"quiet_zone""quiet_zone""quiet_zone""quiet_zone""quiet_zone" x X.

With 'quiet_zone'"quiet_zone""quiet_zone""quiet_zone""quiet_zone""quiet_zone"='tolerant'"tolerant""tolerant""tolerant""tolerant""tolerant", a limited number of edges are allowed in the quiet zone, but at most 1 per 4 module widths. The intent of this is to prevent detecting only part of a bar code, while still allowing to read bar codes with simple quiet zone violations.

With 'quiet_zone'"quiet_zone""quiet_zone""quiet_zone""quiet_zone""quiet_zone"='false'"false""false""false""false""false", the quiet zones verification is disabled.

The quiet zone verification is very useful when using the bar code reader in multi-type or 'auto' reading modus. It prevents that simple bar code types are detected inside of a bar sequence representing a longer bar code or inside another, typically more complex bar code type. Usually, values between 2 and 4 achieve optimal results by effectively suppressing false bar codes, but still tolerating small disturbances, textures, label edges, etc. next to the symbol.

Typical values: 'false'"false""false""false""false""false", 'true'"true""true""true""true""true", 1, 2, 3, 4, 5

Default: 'false'"false""false""false""false""false"

'slanted'"slanted""slanted""slanted""slanted""slanted":

Additional processing for handling of slanted bar codes, i.e., symbols whose bars are not perpendicular to the major symbol orientation. Currently, three modes are supported.

If 'slanted'"slanted""slanted""slanted""slanted""slanted"='true'"true""true""true""true""true", find_bar_codefind_bar_codeFindBarCodefind_bar_codeFindBarCodeFindBarCode tries to estimate the major symbol orientation and the orientation of the bars separately.

If 'slanted'"slanted""slanted""slanted""slanted""slanted"='false'"false""false""false""false""false", the operator estimates the orientation of the bars only and assumes the symbol orientation is perpendicular to them. This is equivalent to disabling the special handling for slanted codes.

If 'slanted'"slanted""slanted""slanted""slanted""slanted"='auto'"auto""auto""auto""auto""auto", the operator tries first to decode the symbol using only the dominant bar orientation. If the decoding fails, it estimates the major symbol orientation as well and tries to decode the symbol again.

If the surface, on which the bar code is printed, is exposed parallel to the camera sensor, the bar code will appear non-slanted in the image. In contrast, if the surface is tilted relative to the camera, the bar code might appear slanted to some extend. Similar distortions could appear if a bar code is scanned by a line-scan camera.

The estimation of the dominant bar orientation is based on the bar edges detected, while the estimation of the major symbol orientation is based on the analysis of the candidate region. As a result, the bars orientation can be estimated much more robustly than the symbol orientation. The latter is especially valid, when the candidate region (see get_bar_code_objectget_bar_code_objectGetBarCodeObjectget_bar_code_objectGetBarCodeObjectGetBarCodeObject with ObjectName='candidate_regions'"candidate_regions""candidate_regions""candidate_regions""candidate_regions""candidate_regions") does not represent the shape of the bar code optimally, e.g., it covers only parts of it, or it includes other textures and image structures around the bar code.

Because of these concerns, it is recommended to enable the processing ('slanted'"slanted""slanted""slanted""slanted""slanted"='true'"true""true""true""true""true") only when slanted codes are really expected and the imaging system being developed delivers image quality allowing a clean extraction of the candidate regions. As an alternative, 'slanted'"slanted""slanted""slanted""slanted""slanted"='auto'"auto""auto""auto""auto""auto" can be used. Note however that the current implementation of the 'auto'"auto""auto""auto""auto""auto" handling increases the risk of finding wrong bar codes within the bar code sequence. In such cases, it is recommended to use the parameters 'quiet_zone'"quiet_zone""quiet_zone""quiet_zone""quiet_zone""quiet_zone" and 'min_identical_scanlines'"min_identical_scanlines""min_identical_scanlines""min_identical_scanlines""min_identical_scanlines""min_identical_scanlines" to suppress false bar code detections. Finally, if the imaging system does not deliver any slanted codes, it is recommended to leave the handling disabled ('slanted'"slanted""slanted""slanted""slanted""slanted"='false'"false""false""false""false""false").

List of values: 'false'"false""false""false""false""false", 'auto'"auto""auto""auto""auto""auto", 'true'"true""true""true""true""true"

Default: 'false'"false""false""false""false""false"

'start_stop_tolerance'"start_stop_tolerance""start_stop_tolerance""start_stop_tolerance""start_stop_tolerance""start_stop_tolerance":

Enforces a tolerant ('high'"high""high""high""high""high") or strict ('low'"low""low""low""low""low") searching criteria, while inspecting a scanline for a start or stop pattern, respectively. A more tolerant criteria will generally increase the detection chances of a bar code, provided that a clear symbol is imaged in the processed image. On the other side, it might result in false detections in noisy images or images containing symbols from other symbologies. Less tolerant criteria increase the robustness against false detections, but might reduce the general detection rate. Currently, there are two distinct criteria implemented only for Code 128 and GS1-128.

This parameter can be set specifically for different types of bar codes by using the operator set_bar_code_param_specificset_bar_code_param_specificSetBarCodeParamSpecificset_bar_code_param_specificSetBarCodeParamSpecificSetBarCodeParamSpecific. As already mentioned, currently this makes a difference only for Code 128 and GS1-128.

List of values: ['high'"high""high""high""high""high", 'low'"low""low""low""low""low"]

Default: 'high'"high""high""high""high""high"

Appearance of the bar code in the image:

'meas_thresh'"meas_thresh""meas_thresh""meas_thresh""meas_thresh""meas_thresh":

'meas_thresh'"meas_thresh""meas_thresh""meas_thresh""meas_thresh""meas_thresh" defines a threshold, which is a relative value with respect to the dynamic range of the scanline pixels. The bar-space-sequence of a bar code is determined with a scanline measuring the position of the edges. Finding these edges requires the mentioned threshold. In the case of disturbances in the bar code region or a high noise level, the value of 'meas_thresh'"meas_thresh""meas_thresh""meas_thresh""meas_thresh""meas_thresh" should be increased.

Typical values: [0.05 ... 0.2]

Default: 0.05

'meas_thresh_abs'"meas_thresh_abs""meas_thresh_abs""meas_thresh_abs""meas_thresh_abs""meas_thresh_abs":

If a scanline is laid in an image region with no or just very small gray value dynamic range (e.g., in a white region with all gray values near 255), the edge detection threshold based on 'meas_thresh'"meas_thresh""meas_thresh""meas_thresh""meas_thresh""meas_thresh" would be computed unreasonably small. This leads typically to the detection of a big amount of false edges. 'meas_thresh_abs'"meas_thresh_abs""meas_thresh_abs""meas_thresh_abs""meas_thresh_abs""meas_thresh_abs" is used to prevent such misdetections. If the threshold value based on 'meas_thresh'"meas_thresh""meas_thresh""meas_thresh""meas_thresh""meas_thresh" gets smaller than the value of 'meas_thresh_abs'"meas_thresh_abs""meas_thresh_abs""meas_thresh_abs""meas_thresh_abs""meas_thresh_abs", the latter is used as threshold instead. By default, 'meas_thresh_abs'"meas_thresh_abs""meas_thresh_abs""meas_thresh_abs""meas_thresh_abs""meas_thresh_abs" is set to 5.0. A greater value might be more appropriate for images with high noise levels. On the other hand, in noise-free images with very weak contrast, this parameter might disturb the detection of real edges, so it might be necessary to reduce it or even completely disable it by setting it to 0.0.

Typical values: [0.0 ... 10.0]

Default: 5.0

'max_diff_orient'"max_diff_orient""max_diff_orient""max_diff_orient""max_diff_orient""max_diff_orient":

A potential bar code region contains bars, and hence edges, with a similar orientation. The value 'max_diff_orient'"max_diff_orient""max_diff_orient""max_diff_orient""max_diff_orient""max_diff_orient" denotes the maximal difference in this orientation between adjacent pixels and is given in degree. If a bar code is of bad quality with jagged edges, the parameter 'max_diff_orient'"max_diff_orient""max_diff_orient""max_diff_orient""max_diff_orient""max_diff_orient" should be set to higher values. If the bar code is of good quality 'max_diff_orient'"max_diff_orient""max_diff_orient""max_diff_orient""max_diff_orient""max_diff_orient" can be set to lower values, thus reducing the number of potential but false bar code candidates.

Typical values: [2 ... 20]

Default: 10

Bar code specific values:

'check_char'"check_char""check_char""check_char""check_char""check_char":

Bar codes with an optional check character are interpreted according to this parameter. These bar code types include, e.g., Code 39, Codabar, 2/5 Industrial and 2/5 Interleaved. The default setting of 'absent'"absent""absent""absent""absent""absent" assumes that no check character is present. In this case, no check is performed and all characters are returned as data.

When set to 'present'"present""present""present""present""present", a check character is expected and used to verify the correctness of the bar code. No bar code result is returned if the check sum does not match, and the check character itself is stripped from the data. If this stripping is undesired, the mode 'preserved'"preserved""preserved""preserved""preserved""preserved" allows to verify the bar code while still keeping the check character in the data.

Note that bar code types with a mandatory check character are always treated as if this parameter were set to 'present'"present""present""present""present""present". This includes, e.g., Code 128, EAN-8, EAN-13 and UPC-A.

This parameter can be set specifically for different types of bar codes by using the operator set_bar_code_param_specificset_bar_code_param_specificSetBarCodeParamSpecificset_bar_code_param_specificSetBarCodeParamSpecificSetBarCodeParamSpecific.

List of values: ['absent'"absent""absent""absent""absent""absent", 'present'"present""present""present""present""present", 'preserved'"preserved""preserved""preserved""preserved""preserved"]

Default: 'absent'"absent""absent""absent""absent""absent"

'composite_code'"composite_code""composite_code""composite_code""composite_code""composite_code":

Most of the GS1 conform bar codes can have an additional 2D GS1 Composite code component appended. If 'composite_code'"composite_code""composite_code""composite_code""composite_code""composite_code" is set to 'CC-A/B'"CC-A/B""CC-A/B""CC-A/B""CC-A/B""CC-A/B" the composite component will be found and decoded. By default, 'composite_code'"composite_code""composite_code""composite_code""composite_code""composite_code" is set to 'none'"none""none""none""none""none" and thus it is disabled. If the searched bar code symbol has no attached composite component, just the result of the bar code itself is returned by find_bar_codefind_bar_codeFindBarCodefind_bar_codeFindBarCodeFindBarCode. Currently, composite codes are supported only for bar codes of the GS1 DataBar family.

This parameter can be set specifically for different types of bar codes by using the operator set_bar_code_param_specificset_bar_code_param_specificSetBarCodeParamSpecificset_bar_code_param_specificSetBarCodeParamSpecificSetBarCodeParamSpecific.

List of values: ['none'"none""none""none""none""none", 'CC-A/B'"CC-A/B""CC-A/B""CC-A/B""CC-A/B""CC-A/B"]

Default: 'none'"none""none""none""none""none"

'upce_encodation'"upce_encodation""upce_encodation""upce_encodation""upce_encodation""upce_encodation":

For UPC-E bar codes, different output formats can be used. By default, 'upce_encodation'"upce_encodation""upce_encodation""upce_encodation""upce_encodation""upce_encodation" is set to 'ucc-12'"ucc-12""ucc-12""ucc-12""ucc-12""ucc-12" and the decoded string will be returned in UCC-12 format (consisting of 12 digits). If 'upce_encodation'"upce_encodation""upce_encodation""upce_encodation""upce_encodation""upce_encodation" is set to 'zero-suppressed'"zero-suppressed""zero-suppressed""zero-suppressed""zero-suppressed""zero-suppressed", the result will be returned in zero-suppressed format (with suppressed zeros at defined places). This format consists of a leading zero, six encoded digits, and an implicitly encoded check digit. This corresponds to the format demanded by ISO/IEC 15420 standard.

This parameter can be set specifically for UPC-E bar codes by using the operator set_bar_code_param_specificset_bar_code_param_specificSetBarCodeParamSpecificset_bar_code_param_specificSetBarCodeParamSpecificSetBarCodeParamSpecific.

List of values: ['ucc-12'"ucc-12""ucc-12""ucc-12""ucc-12""ucc-12", 'zero-suppressed'"zero-suppressed""zero-suppressed""zero-suppressed""zero-suppressed""zero-suppressed"]

Default: 'ucc-12'"ucc-12""ucc-12""ucc-12""ucc-12""ucc-12"

Training:

Besides setting the model parameters manually with set_bar_code_paramset_bar_code_paramSetBarCodeParamset_bar_code_paramSetBarCodeParamSetBarCodeParam, the model can also be trained with find_bar_codefind_bar_codeFindBarCodefind_bar_codeFindBarCodeFindBarCode based on one or several sample images. For this, a bar code model must be created in training mode or an existing bar code model must be put into training mode by passing the generic parameter 'train'"train""train""train""train""train" in GenParamNamesGenParamNamesGenParamNamesGenParamNamesGenParamNamesgenParamNames of set_bar_code_paramset_bar_code_paramSetBarCodeParamset_bar_code_paramSetBarCodeParamSetBarCodeParam. The corresponding value passed in GenParamValuesGenParamValuesGenParamValuesGenParamValuesGenParamValuesgenParamValues determines the model parameters that should be learned. The following values are possible:

'all'"all""all""all""all""all":

Train all possible model parameters.

'element_size_min'"element_size_min""element_size_min""element_size_min""element_size_min""element_size_min":

Minimal size of bar code elements. This setting activates the training mode for the parameter 'element_size_min'"element_size_min""element_size_min""element_size_min""element_size_min""element_size_min".

'element_size_max'"element_size_max""element_size_max""element_size_max""element_size_max""element_size_max":

Maximal size of bar code elements. This setting activates the training mode for the parameter 'element_size_max'"element_size_max""element_size_max""element_size_max""element_size_max""element_size_max".

'meas_thresh'"meas_thresh""meas_thresh""meas_thresh""meas_thresh""meas_thresh":

Relative threshold for measuring the edge position within a scanline. This setting activates the training mode for the parameter 'meas_thresh'"meas_thresh""meas_thresh""meas_thresh""meas_thresh""meas_thresh".

'meas_thresh_abs'"meas_thresh_abs""meas_thresh_abs""meas_thresh_abs""meas_thresh_abs""meas_thresh_abs":

Absolute threshold for measuring the edge position within a scanline. This setting activates the training mode for the parameter 'meas_thresh_abs'"meas_thresh_abs""meas_thresh_abs""meas_thresh_abs""meas_thresh_abs""meas_thresh_abs".

'max_diff_orient'"max_diff_orient""max_diff_orient""max_diff_orient""max_diff_orient""max_diff_orient":

Maximum difference in the orientation of adjacent pixels. This setting activates the training mode for the parameter 'max_diff_orient'"max_diff_orient""max_diff_orient""max_diff_orient""max_diff_orient""max_diff_orient".

'orientation'"orientation""orientation""orientation""orientation""orientation":

Orientation of the bar code. This setting activates the training mode for the parameters 'orientation'"orientation""orientation""orientation""orientation""orientation" and 'orientation_tol'"orientation_tol""orientation_tol""orientation_tol""orientation_tol""orientation_tol". After ending the training the value for 'orientation_tol'"orientation_tol""orientation_tol""orientation_tol""orientation_tol""orientation_tol" can be increased by a tolerance value to be able to find bar codes with orientations slightly beyond the trained orientations.

It is possible to train several of these parameters in one call of find_bar_codefind_bar_codeFindBarCodefind_bar_codeFindBarCodeFindBarCode by passing the generic parameter 'train'"train""train""train""train""train" in set_bar_code_paramset_bar_code_paramSetBarCodeParamset_bar_code_paramSetBarCodeParamSetBarCodeParam in a tuple more than once in conjunction with the appropriate parameters: e.g., GenParamNamesGenParamNamesGenParamNamesGenParamNamesGenParamNamesgenParamNames = ['train','train']["train","train"]["train","train"]["train","train"]["train","train"]["train","train"] and GenParamValuesGenParamValuesGenParamValuesGenParamValuesGenParamValuesgenParamValues = ['element_size_min','element_size_max']["element_size_min","element_size_max"]["element_size_min","element_size_max"]["element_size_min","element_size_max"]["element_size_min","element_size_max"]["element_size_min","element_size_max"]. Furthermore, in conjunction with 'train'"train""train""train""train""train" = 'all'"all""all""all""all""all" it is possible to exclude single parameters from training explicitly again by passing 'train'"train""train""train""train""train" more than once. The names of the parameters to exclude, however, must be prefixed by '~'"~""~""~""~""~": GenParamNamesGenParamNamesGenParamNamesGenParamNamesGenParamNamesgenParamNames = ['train','train']["train","train"]["train","train"]["train","train"]["train","train"]["train","train"] and GenParamValuesGenParamValuesGenParamValuesGenParamValuesGenParamValuesgenParamValues = ['all','~orientation']["all","~orientation"]["all","~orientation"]["all","~orientation"]["all","~orientation"]["all","~orientation"], e.g., trains all parameters except the orientation.

Afterwards, the operator find_bar_codefind_bar_codeFindBarCodefind_bar_codeFindBarCodeFindBarCode has to be called for every image to be trained.

For training the model, the following aspects should be considered:

Miscellaneous:

'timeout'"timeout""timeout""timeout""timeout""timeout":

By the use of this parameter, it is possible to interrupt find_bar_codefind_bar_codeFindBarCodefind_bar_codeFindBarCodeFindBarCode after a defined period in milliseconds. This is especially useful in cases where a maximum cycle time has to be ensured. All results gained until the interrupt can be accessed by get_bar_code_resultget_bar_code_resultGetBarCodeResultget_bar_code_resultGetBarCodeResultGetBarCodeResult. Passing values less or equal zero implies a deactivation of the timeout (default).

The temporal accuracy of this interrupt is about 10 ms. It depends on several factors including the speed of your computer and the 'timer_mode'"timer_mode""timer_mode""timer_mode""timer_mode""timer_mode" set via set_systemset_systemSetSystemset_systemSetSystemSetSystem.

find_bar_codefind_bar_codeFindBarCodefind_bar_codeFindBarCodeFindBarCode does not raise an exception if a timeout occurs. To check whether find_bar_codefind_bar_codeFindBarCodefind_bar_codeFindBarCodeFindBarCode has been interrupted, check the parameter 'timeout_occurred'"timeout_occurred""timeout_occurred""timeout_occurred""timeout_occurred""timeout_occurred" in get_bar_code_resultget_bar_code_resultGetBarCodeResultget_bar_code_resultGetBarCodeResultGetBarCodeResult.

Note that the timeout is ignored if find_bar_codefind_bar_codeFindBarCodefind_bar_codeFindBarCodeFindBarCode runs in training mode.

Typical values: ['false'"false""false""false""false""false", -1, 20 ... 100]

Default: 'false'"false""false""false""false""false"

'persistence'"persistence""persistence""persistence""persistence""persistence":

Setting the model in persistence mode to 1, makes it store some intermediate results during bar code decoding. These results are required if the bar code print quality has to be assessed (get_bar_code_resultget_bar_code_resultGetBarCodeResultget_bar_code_resultGetBarCodeResultGetBarCodeResult with 'quality_isoiec15416'"quality_isoiec15416""quality_isoiec15416""quality_isoiec15416""quality_isoiec15416""quality_isoiec15416") or the decoding scanlines have to be inspected (get_bar_code_objectget_bar_code_objectGetBarCodeObjectget_bar_code_objectGetBarCodeObjectGetBarCodeObject with 'scanlines_all'"scanlines_all""scanlines_all""scanlines_all""scanlines_all""scanlines_all" or 'scanlines_valid'"scanlines_valid""scanlines_valid""scanlines_valid""scanlines_valid""scanlines_valid"). Yet, enabling the 'persistence'"persistence""persistence""persistence""persistence""persistence" mode results in increased memory requirements for the bar code model structures.

List of values: [0, 1]

Default: 0

Attention

A bar code model BarCodeHandleBarCodeHandleBarCodeHandleBarCodeHandleBarCodeHandlebarCodeHandle cannot be shared between two or more user's threads. Different bar code models can be used independently and safely in different threads.

Parallelization

Parameters

BarCodeHandleBarCodeHandleBarCodeHandleBarCodeHandleBarCodeHandlebarCodeHandle (input_control)  barcode HBarCode, HTupleHTupleHBarCode, HTupleHBarCodeX, VARIANTHtuple (integer) (IntPtr) (Hlong) (Hlong) (Hlong) (Hlong)

Handle of the bar code model.

GenParamNamesGenParamNamesGenParamNamesGenParamNamesGenParamNamesgenParamNames (input_control)  attribute.name(-array) HTupleHTupleHTupleVARIANTHtuple (string) (string) (HString) (char*) (BSTR) (char*)

Names of the generic parameters that shall be adjusted for finding and decoding bar codes.

Default value: 'element_size_max' "element_size_max" "element_size_max" "element_size_max" "element_size_max" "element_size_max"

List of values: 'check_char'"check_char""check_char""check_char""check_char""check_char", 'composite_code'"composite_code""composite_code""composite_code""composite_code""composite_code", 'element_height_min'"element_height_min""element_height_min""element_height_min""element_height_min""element_height_min", 'element_size_max'"element_size_max""element_size_max""element_size_max""element_size_max""element_size_max", 'element_size_min'"element_size_min""element_size_min""element_size_min""element_size_min""element_size_min", 'element_size_variable'"element_size_variable""element_size_variable""element_size_variable""element_size_variable""element_size_variable", 'max_diff_orient'"max_diff_orient""max_diff_orient""max_diff_orient""max_diff_orient""max_diff_orient", 'meas_thresh'"meas_thresh""meas_thresh""meas_thresh""meas_thresh""meas_thresh", 'meas_thresh_abs'"meas_thresh_abs""meas_thresh_abs""meas_thresh_abs""meas_thresh_abs""meas_thresh_abs", 'min_identical_scanlines'"min_identical_scanlines""min_identical_scanlines""min_identical_scanlines""min_identical_scanlines""min_identical_scanlines", 'num_scanlines'"num_scanlines""num_scanlines""num_scanlines""num_scanlines""num_scanlines", 'orientation'"orientation""orientation""orientation""orientation""orientation", 'orientation_tol'"orientation_tol""orientation_tol""orientation_tol""orientation_tol""orientation_tol", 'persistence'"persistence""persistence""persistence""persistence""persistence", 'quiet_zone'"quiet_zone""quiet_zone""quiet_zone""quiet_zone""quiet_zone", 'slanted'"slanted""slanted""slanted""slanted""slanted", 'start_stop_tolerance'"start_stop_tolerance""start_stop_tolerance""start_stop_tolerance""start_stop_tolerance""start_stop_tolerance", 'stop_after_result_num'"stop_after_result_num""stop_after_result_num""stop_after_result_num""stop_after_result_num""stop_after_result_num", 'timeout'"timeout""timeout""timeout""timeout""timeout", 'train'"train""train""train""train""train", 'upce_encodation'"upce_encodation""upce_encodation""upce_encodation""upce_encodation""upce_encodation"

GenParamValuesGenParamValuesGenParamValuesGenParamValuesGenParamValuesgenParamValues (input_control)  attribute.value(-array) HTupleHTupleHTupleVARIANTHtuple (real / integer / string) (double / int / long / string) (double / Hlong / HString) (double / Hlong / char*) (double / Hlong / BSTR) (double / Hlong / char*)

Values of the generic parameters that are adjusted for finding and decoding bar codes.

Default value: 8

Suggested values: 0, 0.1, 1, 1.5, 2, 8, 32, 45, 'true'"true""true""true""true""true", 'false'"false""false""false""false""false", 'present'"present""present""present""present""present", 'absent'"absent""absent""absent""absent""absent", 'none'"none""none""none""none""none", 'CC-A/B'"CC-A/B""CC-A/B""CC-A/B""CC-A/B""CC-A/B", 'auto'"auto""auto""auto""auto""auto", 'high'"high""high""high""high""high", 'low'"low""low""low""low""low", 'ucc-12'"ucc-12""ucc-12""ucc-12""ucc-12""ucc-12", 'zero-suppressed'"zero-suppressed""zero-suppressed""zero-suppressed""zero-suppressed""zero-suppressed"

Result

The operator set_bar_code_paramset_bar_code_paramSetBarCodeParamset_bar_code_paramSetBarCodeParamSetBarCodeParam returns the value 2 (H_MSG_TRUE) if the given parameters are correct. Otherwise, an exception will be raised.

Possible Predecessors

create_bar_code_modelcreate_bar_code_modelCreateBarCodeModelcreate_bar_code_modelCreateBarCodeModelCreateBarCodeModel

Possible Successors

find_bar_codefind_bar_codeFindBarCodefind_bar_codeFindBarCodeFindBarCode

Alternatives

set_bar_code_param_specificset_bar_code_param_specificSetBarCodeParamSpecificset_bar_code_param_specificSetBarCodeParamSpecificSetBarCodeParamSpecific

Module

Bar Code


ClassesClassesClassesClasses | | | | Operators