bardecode 

Overview

bardecode -f image_file -t barcode_types [options]

Bardecode scans TIF and JPG files for barcodes and prints the results to standard output. The source code for this tool is included with the toolkit.

Options

image_file image_file can be of type TIF or JPG. JPG files must use the extension ".jpg" or ".jpeg"
-c min_length Minimum length of barcode
-C max_length Maximum length of barcode
-d scan_direction Scan direction mask 1 = Left to Right, 2 = Top to Bottom 4 = Right to Left and 8 = Bottom to Top. default is 15. The scan direction mask controls the directions in which. the barcode reader will look for a barcode. With this version it it now possible to scan for barcodes in any rotation with one call to the reader.
-i page_index Page number of image indexed from 1
-j jump Frequency at which scan lines are sampled, default is 1
-k skew tolerance 0 = off ranging to 5 = any angle
-L oversample_sep Distance between the line samples when over-sampling is used. Default value is 3.
-m Scan for multiple barcodes
-n noise_reduction Noise Reduction level (0 = off, typical value is 20)
-N noise_reduction Advanced Noise Reduction (0 = off, typical value is 20)
-o min_occurs Minimum number of matching scan lines, default 2
-O Sample the scan lines in blocks of 3 with each line separated by oversample_sep lines (see below).
-p pref_occurs Preferred number of matching scan lines, default 5
-P Show page numbers
-q quiet_size Number of pixels wide for the quiet zone around bar code
-S file_template Split a multi-page TIF file into smaller TIF files. The first page of each new file will contain a barcode The template must include %d to index the files e.g. file%d.tif. Must be used with -m flag.
-t barcode_types Specifies the types of barcodes to read, barcode_types is one or more of "code39", "code128", "upca", "upce", "ean8", "code25", "ean13" and "codabar" joined together with the | character.
-t any Searches for a barcode of any type.
-T color threshold Set the color threshold. Ranges from 0 to 255. Default is 128.
-w Print TIF Warnings to STDERR
-u upper_ratio Upper limit of ratio between narrow and wide lines , default is 4.0 (Code 39 only)

Examples

Scan for a Code 39 barcode in a portrait orientation image:

bardecode file.tif -t code39 -d 5

Scan for a Code 39 barcode in a landscape orientation image:

bardecode file.tif -t code39 -d 10

Scan for a Code 128 or UPC-A barcode in an image of poor quality:

bardecode -n 20 file.tif -t "code128|upca"

Split a multi-page TIF file into smaller files, each with a barcode on page 1

bardecode -t code39 -m -S output%d.tif multipage.tif