gen_1d_bar_code_descr ( : : CodeName, MinCharacters, MaxCharacters : BarCodeDescr )

Generate a decscription of a 1D bar code.

gen_1d_bar_code_descr generates a description of a one dimensional bar code. This description is used for the search (find_1d_bar_code or find_1d_bar_code_region) and the decoding (decode_1d_bar_code) of the bar code. gen_1d_bar_code_descr is therefore the first operator in a program sequence for bar code processing. gen_1d_bar_code_descr has only to be called once at the beginning of a program. The descriptor can be used multiple times. In the case of different types of bar codes the operator has to be called once for each type.

You have to be aware that this description contains only basic informations about the bar code. Thus an arbitrary description can be used to extract almost every type of bar code. On the other hand a specific description is important for the decoding of a bar code type.


Parameters

CodeName (input_control)
string -> string
Name of bar code.
Default value: ''EAN 13''
List of values: ''2/5 Industrial'', ''2/5 Interleaved'', ''Code 39'', ''Codabar'', ''Code 128'', ''Code 93'', ''EAN 13'', ''EAN 13 Add-On 2'', ''EAN 13 Add-On 5'', ''EAN 8'', ''EAN 8 Add-On 2'', ''EAN 8 Add-On 5'', ''UPC-A'', ''UPC-A Add-On 2'', ''UPC-A Add-On 5'', ''UPC-E'', ''UPC-E Add-On 2'', ''UPC-E Add-On 5'', ''PharmaCode''

MinCharacters (input_control)
integer -> integer
Minimum number of characters (if not fixed).
Default value: 6
Suggested values: -1, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 14, 16, 18, 20, 25, 30

MaxCharacters (input_control)
integer -> integer
Maximum number of characters (if not fixed).
Default value: 10
Suggested values: -1, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 14, 16, 18, 20, 25, 30, 35, 40, 50

BarCodeDescr (output_control)
barcode_1d-array -> string / integer / real
Description of a bar code class.


Example
HTuple   empty;   // empty list of values
HTuple   BarCodeDescr;
HTuple   BarcodeFound,Elements,Orientation;
HTuple   Characters,Reference,IsCorrect;
Hobject  Image,CodeRegion;

gen_1d_bar_code_descr("EAN 13",13,13,&BarCodeDescr);
find_1d_bar_code(Image,&CodeRegion,BarCodeDescr,empty,empty,
                 &BarcodeFound,&Elements,&Orientation);
if (BarcodeFound[0].l)
{
  decode_1d_bar_code(Elements,BarCodeDescr,
                     &Characters,&Reference,&IsCorrect);
  if (IsCorrect[0].l)
    for (int i=0; i<Characters.Num(); i++)
    {
      char *value = Characters[i];
    }
}

Result

The operator gen_1d_bar_code_descr returns the value 2 (H_MSG_TRUE) if the transfered bar code name is correct.


Parallelization Information

gen_1d_bar_code_descr is reentrant and processed without parallelization.


Possible Successors

find_1d_bar_code, find_1d_bar_code_region


Alternatives

gen_1d_bar_code_descr_gen


Module

Barcode reader



Copyright © 1996-2005 MVTec Software GmbH