gen_1d_bar_code_descr_gen ( : : MinCodeLength, MaxCodeLength, ElementSizes, StartElement, StopElement, MaxSizeRatio, DiscreteCode : BarCodeDescr )

Generate a generic description of a 1D bar code.

gen_1d_bar_code_descr_gen generates a generic description of a one dimensional bar code. This operator is used if the bar code description cannot be generated by gen_1d_bar_code_descr but nonetheless has to be found by using the operators find_1d_bar_code or find_1d_bar_code_region. Note that in this case the bar code cannot be deccoded by decode_1d_bar_code. Thus in this case the decoding has to be done by the user.

The values for DiscreteCode and ElementSizes have to be set correctly in any case. The other values are not so important for the extraction because they can be estimated by the system automatically.


Parameters

MinCodeLength (input_control)
integer -> integer
Minimum length of the code in modules (including start and stop elements).
Default value: 30
List of values: -1, 30, 60, 90, 110, 130, 150, 200

MaxCodeLength (input_control)
integer -> integer
Maximum length of the code in modules (including start and stop elements).
Default value: 30
List of values: -1, 30, 60, 90, 110, 130, 150, 200

ElementSizes (input_control)
integer -> integer
Number of different element sizes.
Default value: 2
List of values: 1, 2, 3, 4, 5, 6, 7

StartElement (input_control)
integer(-array) -> integer
List of elements of the start sequence. The width of an element is given as the number of modules. Gaps are given as negative values.
Default value: '[1,-1]'

StopElement (input_control)
integer(-array) -> integer
List of elements of the stop sequence. The width of an element is given as the number of modules. Gaps are given as negative values.
Default value: '[1,-1]'

MaxSizeRatio (input_control)
number -> real
Maximum ratio length to height.
Default value: 2.5
List of values: -1, 2, 3, 4, 5, 6

DiscreteCode (input_control)
string -> string
Discrete code (ignore white elements).
Default value: 'false'
List of values: 'true', 'false'

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


Example (Syntax: C++)
HTuple   empty;   // empty list of values
HTuple   BarCodeDescr;
HTuple   BarcodeFound,Elements,Orientation;
HTuple   DiscreteBarCode;
Hobject  Image,CodeRegion;

gen_1d_bar_code_descr_gen(20,40,2,empty,empty,-1.0,"false",&BarCodeDescr);
find_1d_bar_code(Image,&CodeRegion,BarCodeDescr,empty,empty,
                 &BarcodeFound,&Elements,&Orientation);
if (BarcodeFound[0].l)
{
  discrete_1d_bar_code(Elements,BarCodeDescr,&DiscreteBarCode);
  for (int i=0; i<DiscreteBarCode.Num(); i++)
  {
    int NumModules = DiscreteBarCode[i];
  }
}

Result

The operator gen_1d_bar_code_descr_gen returns the value 2 (H_MSG_TRUE) if the transfered values are correct.


Parallelization Information

gen_1d_bar_code_descr_gen is reentrant and processed without parallelization.


Possible Successors

find_1d_bar_code, find_1d_bar_code_region


Alternatives

gen_1d_bar_code_descr


Module

Bar Code



Copyright © 1996-2008 MVTec Software GmbH