get_1d_bar_code_scanline ( BarCodeRegion : : BarCodeDescr, GenericName, GenericValue, Orientation, StopIfFound : BarCodeElements, ScanlineNumPoints, ScanlineDecoded, ScanlinePointsRow, ScanlinePointsColumn )
Extract the widths of the elements inside a bar code region.
Like get_1d_bar_code, get_1d_bar_code_scanline
extracts the widths of the elements of a bar code inside the
specified region, but get_1d_bar_code_scanline also returns
information about the used scanlines.
For a description of the parameters see get_1d_bar_code and
find_1d_bar_code_scanline.
Parameters
BarCodeRegion (input_object)
|
image -> object : byte / uint2
|
|
Region of bar code. |
BarCodeDescr (input_control)
|
barcode_1d-array -> string / integer / real
|
|
Description of a bar code class. |
GenericName (input_control)
|
string(-array) -> string
|
|
Names of optional parameters. |
|
Default value: '[]' |
|
List of values: 'sigma_project', 'amplitude_project', 'width_project', 'add_length_project', 'interpolation_project', 'num_scanlines', 'max_extra_elements' |
GenericValue (input_control)
|
number(-array) -> real / integer
|
|
Values of optional parameters. |
|
Default value: '[]' |
Orientation (input_control)
|
angle.rad -> real
|
|
Orientation of bar code. |
StopIfFound (input_control)
|
string -> string
|
|
Leave operator as soon as the bar code has been
decoded?. |
|
Default value: 'false' |
|
List of values: 'true', 'false' |
BarCodeElements (output_control)
|
number-array -> real
|
|
Widths of elements. |
ScanlineNumPoints (output_control)
|
number(-array) -> integer
|
|
Number of points belonging to that scanline. |
ScanlineDecoded (output_control)
|
integer(-array) -> integer
|
|
Information whether the bar code could be decoded with
that scanline. |
|
List of values: 0, 1, 2 |
ScanlinePointsRow (output_control)
|
real(-array) -> real
|
|
Row - coordinates of the the points of the scanline. |
ScanlinePointsColumn (output_control)
|
real(-array) -> real
|
|
Column - coordinates of the the points of the scanline. |
Example (Syntax: C++)
HTuple empty; // empty list of values
HTuple BarCodeDescr;
HTuple Orientations, Elements;
HTuple Characters,Reference,IsCorrect;
Hobject Image,CodeRegions,CodeRegion,GrayRegion;
long num;
HTuple ScanlineNumPoints, ScanlineDecoded, ScanlinePointsRow,
ScanlinePointsColumn;
HTuple NumScanlines, NumPoints;
HTuple j, k, indexPoint, nStart, nEnd;
HTuple WindowHandle;
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_scanlines(GrayRegion,BarCodeDescr,empty,empty,
Orientations[i],"false", &Elements, &ScanlineNumPoints,
&ScanlineDecoded,&ScanlinePointsRow,&ScanlinePointsColumn);
decode_1d_bar_code(Elements,BarCodeDescr,
&Characters,&Reference,&IsCorrect);
// display scanlines
NumScanlines = ScanlineNum.Num();
indexPoint = HTuple(0);
for (j=0; j<=NumScanlines-1; j+=1)
{
if (HTuple(ScanlineDecoded[(long)(j)[0]])==1)
{
set_color(WindowHandle,HTuple("green"));
}
else
{
set_color(WindowHandle,HTuple("red"));
}
NumPoints = HTuple(ScanlineNumPoints[(long)(j)[0]]);
nStart = indexPoint;
nEnd = (indexPoint+NumPoints)-1;
for (k=nStart; k<=nEnd; k+=1)
{
disp_circle(WindowHandle,HTuple(ScanlinePointsRow[(long)(k)[0]]),
HTuple(ScanlinePointsColumn[(long)(k)[0]]),HTuple(1));
}
indexPoint = nEnd+1;
}
}
Result
The operator get_1d_bar_code returns the value 2 (H_MSG_TRUE)
if the parameters are correct.
Parallelization Information
get_1d_bar_code_scanline is reentrant and processed without parallelization.
Possible Predecessors
find_1d_bar_code_region,
select_obj,
reduce_domain
Possible Successors
decode_1d_bar_code
Alternatives
find_1d_bar_code
Module
Bar Code
Copyright © 1996-2008 MVTec Software GmbH