Herror ::find_1d_bar_code_region (
    Hobject Image,
    Hobject *CodeRegion,
    const HTuple &BarCodeDescr,
    const HTuple &GenericName,
    const HTuple &GenericValue,
    double *Orientation
)
Herror ::find_1d_bar_code_region (
    Hobject Image,
    Hobject *CodeRegion,
    const HTuple &BarCodeDescr,
    const HTuple &GenericName,
    const HTuple &GenericValue,
    HTuple *Orientation
)

Look for multiple barcode regions in an image.

::find_1d_bar_code_region looks for multiple barcodes in the image. In contrast to ::find_1d_bar_code this operator is used if an image contains more than one barcode. Here only the regions but not the widths of the elements are extracted. For every region the orientation in radians is calculated.

The control of the image processing is identical to ::find_1d_bar_code. The description of the parameters GenericName and GenericValue can be found at this operator.


Parameters

Image (input_object)
image -> Hobject: HImage
Image with barcodes inside.

CodeRegion (output_object)
region(-array) -> Hobject * : HRegion(Array)
Regions of barcodes.

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: 'amplitude_sobel', 'min_size_element', 'max_size_element', 'angle_range', 'correct_angle', 'dilation_factor', 'sum_angles'

GenericValue (input_control)
number(-array) -> HTuple.double / long / char *
Values of optional parameters.
Default value: '[]'

Orientation (output_control)
real(-array) -> (HTuple.) double *
Orientation of bar code.


Example
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);
}

Result

The operator ::find_1d_bar_code_region returns the value H_MSG_TRUE if the parameters are correct and at least one barcode is found.


Possible Predecessors

::gen_1d_bar_code_descr, ::gen_1d_bar_code_descr_gen


Possible Successors

::get_1d_bar_code, ::count_obj, ::select_obj, ::reduce_domain


Alternatives

::find_1d_bar_code


See also

::sobel_dir


Module

Barcode reader



Copyright © 1996-2002 MVTec Software GmbH