discrete_1d_bar_code ( : : Elements, BarCodeDescr : DisrecteBarCode )

Generate a discrete bar code from the elements widths.

discrete_1d_bar_code converts the list of element widths (output from find_1d_bar_code or get_1d_bar_code) into a discrete bar code. Thus every element is then represented by its number of modules (1,2,..) and no longer as its width in pixels.

This operator is used if the bar code type is not available so that decode_1d_bar_code cannot be applied, thus the user wants to find the bar code with the help of HALCON operators and then himself decode the bar code. To create the bar code description the operator gen_1d_bar_code_descr_gen is used and with find_1d_bar_code the element widths are extracted. Then discrete_1d_bar_code is used to create the list of the multiple of the modules.


Parameters

Elements (input_control)
number-array -> real
List of elements widths of the bar code.

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

DisrecteBarCode (output_control)
number-array -> integer
Widths of elements as multiple of modules.


Example
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 discrete_1d_bar_code returns the value 2 (H_MSG_TRUE) if the transfered bar code description is correct and the the element list can be discretized.


Parallelization Information

discrete_1d_bar_code is reentrant and processed without parallelization.


Possible Predecessors

find_1d_bar_code, get_1d_bar_code


See also

decode_1d_bar_code


Module

Barcode reader



Copyright © 1996-2005 MVTec Software GmbH