Start/end guard pattern.
Note: The end pattern is reversed because the row is reversed before searching for the END_PATTERN
Identify where the end of the middle / payload section ends.
row of black/white values to search
Array, containing index of start of 'end block' and end of 'end block'
Identify where the start of the middle / payload section starts.
row of black/white values to search
Array, containing index of start of 'start block' and end of 'start block'
The start & end patterns must be pre/post fixed by a quiet zone. This zone must be at least 10 times the width of a narrow line. Scan back until we either get to the start of the barcode or match the necessary number of quiet zone pixels.
Note: Its assumed the row is reversed when using this method to find quiet zone after the end pattern.
bit array representing the scanned barcode.
index into row of the start or end pattern.
Attempts to decode a sequence of ITF black/white lines into single digit.
the counts of runs of observed black/white/black/... values
The decoded digit
row of black/white values to search
offset of start pattern
StringBuilder to append decoded chars to
row of black/white values to search
position to start search
pattern of counts of number of black and white pixels that are being searched for as a pattern
start/end horizontal offset of guard pattern, as an array of two ints
Determines how closely a set of observed counts of runs of black/white values matches a given target pattern. This is reported as the ratio of the total variance from the expected pattern proportions across all pattern elements, to the length of the pattern.
observed counters
expected pattern
The most any counter can differ before we give up
ratio of total variance between counters and pattern compared to total pattern size
Records the size of successive runs of white and black pixels in a row, starting at a given point. The values are recorded in the given array, and the number of runs recorded is equal to the size of the array. If the row starts on a white pixel at the given start point, then the first count recorded is the run of white pixels starting from that point; likewise it is the count of a run of black pixels if the row begin on a black pixels at that point.
row to count from
offset into row to start at
array into which to record counts
Skip all whitespace until we get to the first black line.
row of black/white values to search
index of the first black line.
Generated using TypeDoc
Decodes ITF barcodes.
Tjieco