Extract the widths of the elements inside a barcode region.
::get_1d_bar_code extracts the widths of the elements of a barcode inside the specified region.
The control of the processing is identical to ::find_1d_bar_code. The description of the parameters GenericName and GenericValue can be found at this operator.
|
BarCodeRegion (input_object) |
image -> Hobject: HImage |
| Region of bar code. | |
|
BarCodeDescr (input_control) |
string-array -> HTuple.char * / long / double |
| Description of a bar code class. | |
|
GenericName (input_control) |
string(-array) -> HTuple.char * |
| Names of optional parameters. | |
| Default value: '[]' | |
| List of values: 'sigma_project', 'amplitude_project', 'width_project', 'add_length_project', 'interpolation_project' | |
|
GenericValue (input_control) |
number(-array) -> HTuple.double / long |
| Values of optional parameters. | |
| Default value: '[]' | |
|
Orientation (input_control) |
angle.rad -> HTuple.double |
| Orientation of bar code. | |
|
BarCodeElements (output_control) |
number-array -> HTuple.double * |
| Widths of elements. | |
HTuple empty; // empty list of values
HTuple BarCodeDescr;
HTuple Orientations, Elements;
HTuple Characters,Reference,IsCorrect;
Hobject Image,CodeRegions,CodeRegion,GrayRegion;
long num;
gen_1d_bar_code_descr("code 39",4,15,&BarCodeDescr);
find_1d_bar_code_region(Image,&CodeRegion,BarCodeDescr,empty,empty,
&Orientations);
count_obj(CodeRegions,&num);
for (long i=0; i<num; i++)
{
select_obj(CodeRegions,&CodeRegion,i);
reduce_domain(Image,CodeRegion,GrayRegion)\:
get_1d_bar_code(GrayRegion,BarCodeDescr,empty,empty,Orientations[i],
&Elements);
decode_1d_bar_code(Elements,BarCodeDescr,
&Characters,&Reference,&IsCorrect);
}
The operator ::get_1d_bar_code returns the value H_MSG_TRUE if the parameters are correct.
::find_1d_bar_code_region, ::select_obj, ::reduce_domain
Barcode reader