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
)
Generate a generic decscription 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 barcode 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 barcode 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 -> HTuple.long
|
|
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 -> HTuple.long
|
|
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 -> HTuple.long
|
|
Number of different element sizes. |
|
Default value: 2 |
|
List of values: 1, 2, 3, 4, 5, 6, 7 |
StartElement (input_control)
|
integer(-array) -> HTuple.long
|
|
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) -> HTuple.long
|
|
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 -> HTuple.double
|
|
Maximum ratio length to height. |
|
Default value: 2.5 |
|
List of values: -1, 2, 3, 4, 5, 6 |
DiscreteCode (input_control)
|
string -> HTuple.char *
|
|
Discrete code (ignore white elements). |
|
Default value: 'false' |
|
List of values: 'true', 'false' |
BarCodeDescr (output_control)
|
string-array -> HTuple.char * / long * / double *
|
|
Description of a bar code class. |
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 ::gen_1d_bar_code_descr_gen returns the value H_MSG_TRUE
if the transfered values are correct.
Possible Successors
::find_1d_bar_code,
::find_1d_bar_code_region
Alternatives
::gen_1d_bar_code_descr
Module
Barcode reader
Copyright © 1996-2002 MVTec Software GmbH