ClassesClassesClassesClasses | | | | Operators

decode_1d_bar_codeT_decode_1d_bar_codeDecode1dBarCodedecode_1d_bar_codeDecode1dBarCodeDecode1dBarCode (Operator)

Name

decode_1d_bar_codeT_decode_1d_bar_codeDecode1dBarCodedecode_1d_bar_codeDecode1dBarCodeDecode1dBarCode — Decoding of a sequence of elements of a bar code.

Warning

decode_1d_bar_codedecode_1d_bar_codeDecode1dBarCodedecode_1d_bar_codeDecode1dBarCodeDecode1dBarCode 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 find_bar_codefind_bar_codeFindBarCodefind_bar_codeFindBarCodeFindBarCode).

Signature

decode_1d_bar_code( : : BarCodeElements, BarCodeDescr : Characters, Reference, IsCorrect)

Herror T_decode_1d_bar_code(const Htuple BarCodeElements, const Htuple BarCodeDescr, Htuple* Characters, Htuple* Reference, Htuple* IsCorrect)

Herror decode_1d_bar_code(const HTuple& BarCodeElements, const HTuple& BarCodeDescr, HTuple* Characters, HTuple* Reference, HTuple* IsCorrect)

HTuple HBarCode1D::Decode1dBarCode(const HTuple& BarCodeElements, HTuple* Reference, HTuple* IsCorrect) const

void Decode1dBarCode(const HTuple& BarCodeElements, const HTuple& BarCodeDescr, HTuple* Characters, HTuple* Reference, HTuple* IsCorrect)

void HOperatorSetX.Decode1dBarCode(
[in] VARIANT BarCodeElements, [in] VARIANT BarCodeDescr, [out] VARIANT* Characters, [out] VARIANT* Reference, [out] VARIANT* IsCorrect)

VARIANT HBarCode1DX.Decode1dBarCode(
[in] VARIANT BarCodeElements, [in] VARIANT BarCodeDescr, [out] VARIANT* Reference, [out] Hlong* IsCorrect)

static void HOperatorSet.Decode1dBarCode(HTuple barCodeElements, HTuple barCodeDescr, out HTuple characters, out HTuple reference, out HTuple isCorrect)

Description

decode_1d_bar_codedecode_1d_bar_codeDecode1dBarCodedecode_1d_bar_codeDecode1dBarCodeDecode1dBarCode decodes a sequence of elements which have been extracted by find_1d_bar_codefind_1d_bar_codeFind1dBarCodefind_1d_bar_codeFind1dBarCodeFind1dBarCode or get_1d_bar_codeget_1d_bar_codeGet1dBarCodeget_1d_bar_codeGet1dBarCodeGet1dBarCode into a sequence of characters. As input the widths of the elements (in pixels) are used. The discrete form as it is returned from discrete_1d_bar_codediscrete_1d_bar_codeDiscrete1dBarCodediscrete_1d_bar_codeDiscrete1dBarCodeDiscrete1dBarCode can optionally be used. Otherwise decode_1d_bar_codedecode_1d_bar_codeDecode1dBarCodedecode_1d_bar_codeDecode1dBarCodeDecode1dBarCode creates the discrete form automatically.

The result of decode_1d_bar_codedecode_1d_bar_codeDecode1dBarCodedecode_1d_bar_codeDecode1dBarCodeDecode1dBarCode is a sequence of CharactersCharactersCharactersCharactersCharacterscharacters and the corresponding reference numbers (ReferenceReferenceReferenceReferenceReferencereference). In addition a parity check is applied, the result of which is returned in IsCorrectIsCorrectIsCorrectIsCorrectIsCorrectisCorrect. If all characters are used to store user data (i.e. no parity is used) the value of this parameter has to be ignored.

Attention

For bar codes of type Pharmacode the reading direction cannot be determined from the bar code data because the bar code does not specify extra characters (like start, stop, or parity check characters) that enable the determination of a reading direction, and hence the bar code can always be decoded in both directions. Therefore, for PharmaCodes the results of decoding the code in both possible reading directions are returned as two values in CharactersCharactersCharactersCharactersCharacterscharacters as well as ReferenceReferenceReferenceReferenceReferencereference. The decision which Element of CharactersCharactersCharactersCharactersCharacterscharacters and ReferenceReferenceReferenceReferenceReferencereference contains the correct reading direction must be made by the caller based on the orientation of the bar code (as returned in the parameter OrientationOrientationOrientationOrientationOrientationorientation in find_1d_bar_codefind_1d_bar_codeFind1dBarCodefind_1d_bar_codeFind1dBarCodeFind1dBarCode and find_1d_bar_code_regionfind_1d_bar_code_regionFind1dBarCodeRegionfind_1d_bar_code_regionFind1dBarCodeRegionFind1dBarCodeRegion). The respective first element of CharactersCharactersCharactersCharactersCharacterscharacters and ReferenceReferenceReferenceReferenceReferencereference corresponds to the standard reading direction in the orientation given by OrientationOrientationOrientationOrientationOrientationorientation, while the second element corresponds to the opposite reading direction. If, for example, the orientation is 0, the first element corresponds to the reading direction from right to left. If the orientation is pi / 2, the first element corresponds to the reading direction from top to bottom.

Parallelization

Parameters

BarCodeElementsBarCodeElementsBarCodeElementsBarCodeElementsBarCodeElementsbarCodeElements (input_control)  number-array HTupleHTupleHTupleVARIANTHtuple (real) (double) (double) (double) (double) (double)

Widths of the elements of the bar code.

BarCodeDescrBarCodeDescrBarCodeDescrBarCodeDescrBarCodeDescrbarCodeDescr (input_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.

CharactersCharactersCharactersCharactersCharacterscharacters (output_control)  string-array HTupleHTupleHTupleVARIANTHtuple (string) (string) (HString) (char*) (BSTR) (char*)

Decoded characters in standard interpretation.

ReferenceReferenceReferenceReferenceReferencereference (output_control)  integer-array HTupleHTupleHTupleVARIANTHtuple (integer) (int / long) (Hlong) (Hlong) (Hlong) (Hlong)

Decoded characters as numbers.

IsCorrectIsCorrectIsCorrectIsCorrectIsCorrectisCorrect (output_control)  integer HTupleHTupleHTupleVARIANTHtuple (integer) (int / long) (Hlong) (Hlong) (Hlong) (Hlong)

Information whether the bar code is correct.

List of values: 0, 1

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

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

Possible Predecessors

find_1d_bar_codefind_1d_bar_codeFind1dBarCodefind_1d_bar_codeFind1dBarCodeFind1dBarCode, get_1d_bar_codeget_1d_bar_codeGet1dBarCodeget_1d_bar_codeGet1dBarCodeGet1dBarCode

Module

Bar Code


ClassesClassesClassesClasses | | | | Operators