ClassesClassesClassesClasses | | | | Operators

gen_1d_bar_code_descr_genT_gen_1d_bar_code_descr_genGen1dBarCodeDescrGengen_1d_bar_code_descr_genGen1dBarCodeDescrGenGen1dBarCodeDescrGen (Operator)

Name

gen_1d_bar_code_descr_genT_gen_1d_bar_code_descr_genGen1dBarCodeDescrGengen_1d_bar_code_descr_genGen1dBarCodeDescrGenGen1dBarCodeDescrGen — Generate a generic description of a 1D bar code.

Warning

gen_1d_bar_code_descr_gengen_1d_bar_code_descr_genGen1dBarCodeDescrGengen_1d_bar_code_descr_genGen1dBarCodeDescrGenGen1dBarCodeDescrGen is obsolete and is only provided for reasons of backward compatibility. New applications for reading bar codes should use the functionalities in the chapter Identification / Bar Code instead (see create_bar_code_modelcreate_bar_code_modelCreateBarCodeModelcreate_bar_code_modelCreateBarCodeModelCreateBarCodeModel).

Signature

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

Herror T_gen_1d_bar_code_descr_gen(const Htuple MinCodeLength, const Htuple MaxCodeLength, const Htuple ElementSizes, const Htuple StartElement, const Htuple StopElement, const Htuple MaxSizeRatio, const Htuple DiscreteCode, Htuple* BarCodeDescr)

Herror gen_1d_bar_code_descr_gen(const HTuple& MinCodeLength, const HTuple& MaxCodeLength, const HTuple& ElementSizes, const HTuple& StartElement, const HTuple& StopElement, const HTuple& MaxSizeRatio, const HTuple& DiscreteCode, HTuple* BarCodeDescr)

void HBarCode1D::Gen1dBarCodeDescrGen(const HTuple& MinCodeLength, const HTuple& MaxCodeLength, const HTuple& ElementSizes, const HTuple& StartElement, const HTuple& StopElement, const HTuple& MaxSizeRatio, const HTuple& DiscreteCode)

void Gen1dBarCodeDescrGen(const HTuple& MinCodeLength, const HTuple& MaxCodeLength, const HTuple& ElementSizes, const HTuple& StartElement, const HTuple& StopElement, const HTuple& MaxSizeRatio, const HTuple& DiscreteCode, HTuple* BarCodeDescr)

void HOperatorSetX.Gen1dBarCodeDescrGen(
[in] VARIANT MinCodeLength, [in] VARIANT MaxCodeLength, [in] VARIANT ElementSizes, [in] VARIANT StartElement, [in] VARIANT StopElement, [in] VARIANT MaxSizeRatio, [in] VARIANT DiscreteCode, [out] VARIANT* BarCodeDescr)

VARIANT HBarCode1DX.Gen1dBarCodeDescrGen(
[in] Hlong MinCodeLength, [in] Hlong MaxCodeLength, [in] Hlong ElementSizes, [in] VARIANT StartElement, [in] VARIANT StopElement, [in] double MaxSizeRatio, [in] BSTR DiscreteCode)

static void HOperatorSet.Gen1dBarCodeDescrGen(HTuple minCodeLength, HTuple maxCodeLength, HTuple elementSizes, HTuple startElement, HTuple stopElement, HTuple maxSizeRatio, HTuple discreteCode, out HTuple barCodeDescr)

Description

gen_1d_bar_code_descr_gengen_1d_bar_code_descr_genGen1dBarCodeDescrGengen_1d_bar_code_descr_genGen1dBarCodeDescrGenGen1dBarCodeDescrGen 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_descrgen_1d_bar_code_descrGen1dBarCodeDescrgen_1d_bar_code_descrGen1dBarCodeDescrGen1dBarCodeDescr but nonetheless has to be found by using the operators find_1d_bar_codefind_1d_bar_codeFind1dBarCodefind_1d_bar_codeFind1dBarCodeFind1dBarCode or find_1d_bar_code_regionfind_1d_bar_code_regionFind1dBarCodeRegionfind_1d_bar_code_regionFind1dBarCodeRegionFind1dBarCodeRegion. Note that in this case the bar code cannot be deccoded by decode_1d_bar_codedecode_1d_bar_codeDecode1dBarCodedecode_1d_bar_codeDecode1dBarCodeDecode1dBarCode. Thus in this case the decoding has to be done by the user.

The values for DiscreteCodeDiscreteCodeDiscreteCodeDiscreteCodeDiscreteCodediscreteCode and ElementSizesElementSizesElementSizesElementSizesElementSizeselementSizes 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.

Parallelization

Parameters

MinCodeLengthMinCodeLengthMinCodeLengthMinCodeLengthMinCodeLengthminCodeLength (input_control)  integer HTupleHTupleHTupleVARIANTHtuple (integer) (int / long) (Hlong) (Hlong) (Hlong) (Hlong)

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

MaxCodeLengthMaxCodeLengthMaxCodeLengthMaxCodeLengthMaxCodeLengthmaxCodeLength (input_control)  integer HTupleHTupleHTupleVARIANTHtuple (integer) (int / long) (Hlong) (Hlong) (Hlong) (Hlong)

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

ElementSizesElementSizesElementSizesElementSizesElementSizeselementSizes (input_control)  integer HTupleHTupleHTupleVARIANTHtuple (integer) (int / long) (Hlong) (Hlong) (Hlong) (Hlong)

Number of different element sizes.

Default value: 2

List of values: 1, 2, 3, 4, 5, 6, 7

StartElementStartElementStartElementStartElementStartElementstartElement (input_control)  integer(-array) HTupleHTupleHTupleVARIANTHtuple (integer) (int / long) (Hlong) (Hlong) (Hlong) (Hlong)

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]

StopElementStopElementStopElementStopElementStopElementstopElement (input_control)  integer(-array) HTupleHTupleHTupleVARIANTHtuple (integer) (int / long) (Hlong) (Hlong) (Hlong) (Hlong)

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]

MaxSizeRatioMaxSizeRatioMaxSizeRatioMaxSizeRatioMaxSizeRatiomaxSizeRatio (input_control)  number HTupleHTupleHTupleVARIANTHtuple (real) (double) (double) (double) (double) (double)

Maximum ratio length to height.

Default value: 2.5

List of values: -1.0, 2.0, 3.0, 4.0, 5.0, 6.0

DiscreteCodeDiscreteCodeDiscreteCodeDiscreteCodeDiscreteCodediscreteCode (input_control)  string HTupleHTupleHTupleVARIANTHtuple (string) (string) (HString) (char*) (BSTR) (char*)

Discrete code (ignore white elements).

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

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

BarCodeDescrBarCodeDescrBarCodeDescrBarCodeDescrBarCodeDescrbarCodeDescr (output_control)  barcode_1d HTupleHTupleHBarCode1D, HTupleHBarCode1DX, VARIANTHtuple (string / integer / real) (string / int / long / double) (HString / Hlong / double) (char* / Hlong / double) (BSTR / Hlong / double) (char* / Hlong / double)

Description of a bar code class.

Example (C++ (HALCON 5.0-10.0))

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_gengen_1d_bar_code_descr_genGen1dBarCodeDescrGengen_1d_bar_code_descr_genGen1dBarCodeDescrGenGen1dBarCodeDescrGen returns the value 2 (H_MSG_TRUE) if the transfered values are correct.

Possible Successors

find_1d_bar_codefind_1d_bar_codeFind1dBarCodefind_1d_bar_codeFind1dBarCodeFind1dBarCode, find_1d_bar_code_regionfind_1d_bar_code_regionFind1dBarCodeRegionfind_1d_bar_code_regionFind1dBarCodeRegionFind1dBarCodeRegion

Alternatives

gen_1d_bar_code_descrgen_1d_bar_code_descrGen1dBarCodeDescrgen_1d_bar_code_descrGen1dBarCodeDescrGen1dBarCodeDescr

Module

Bar Code


ClassesClassesClassesClasses | | | | Operators