Operators |
discrete_1d_bar_code — Generate a discrete bar code from the elements widths.
discrete_1d_bar_code 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.
discrete_1d_bar_code( : : Elements, BarCodeDescr : DiscreteBarCode)
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.
List of elements widths of the bar code.
Description of a bar code class.
Widths of elements as multiple of modules.
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]; } }
The operator discrete_1d_bar_code returns the value 2 (H_MSG_TRUE) if the transfered bar code description is correct and the element list can be discretized.
find_1d_bar_code, get_1d_bar_code
Bar Code
Operators |