Eym Barcode Reader Command Line Utility v1.3

 

EymBCrdCMD.exe is a shareware command line utility based on the Eym Barcode Reader OCX, which performs all necessary image processing and decoding stages to locate and read a variety of standard 1D barcodes from a bitmap.

This utility locates and decodes 1D barcodes from image files that are provided to it. The result is returned on standard output in the form of a self explanatory XML object. This tool is particularly well adapted to cases when a user might want to analyze a batch of image files.

Without purchasing a license key EymBCrdCMD.exe may still be used as a full-featured demo. Ran as a demo the utility will periodically prompt a nag screen. Disabling this nag screen requires the purchase of a license key.

 

·          EymBCrdCMD usage

o    Output format

o    Examples

·          Functionality and supported standards

o    Supported image file formats

o    Supported barcode standards

Revision notes:

Version 1.0 - first release based on v2.3 of the EymBarcode OCX

Version 1.1 – Integration of v2.4 of the EymBarcode OCX and addition of three configuration parameters: -maxnbcodes, -expdpi and –granularity

Version 1.2 – Filtering of XML illegal characters from the reported barcode raw payload in order to avoid syntax errors in the XML output.

Version 1.3 – Further filtering of XML illegal characters from all reported fields in order to avoid syntax errors in the XML output.

EymBCrdCMD usage

 

EymBCrdCMD.exe [options] <image_file_mask>

Where:

·          <image_file_mask> is either a file’s name or a mask matching multiple files using wild characters “*”. NOTE: As for most command line utilities if the provided mask contains space characters, it should be encapsulated by double quotes.

·          [options] is configuration string consisting of <flag> <value> pairs, where <flab> can be either of the following:

o    –minconf                     Minimum confidence level - This value tells the system how confident it should be about its decoding results before deeming them as successful. This value lives between 0.0 (very loose) and 1.0 (virtually unattainable). By default and if no value is explicitly set on the command line, this threshold value is set to 0.81 (i.e. 81% confidence required in order to report any decoding result).

o    –mincontrast               Minimum contrasts level - This value tells the system to only pay attention to areas of the image that score above that threshold value in terms of contrast and high spatial frequency energy. This parameter is a number between 0.0 and 1.0. By default and if no value is explicitly set on the command line, this threshold is 0.07 (i.e. 7% of the input image’s color range).

o    –maxnbcode               Expected/max number of barcodes per image - In version 1.1 the system was further optimized and it you may further speed up the process if you know in advance how many barcodes are contained within the image and tell the system about it using this flag.

o    –expdpi                      Expected image resolution - Originally the system was targeting image resolutions in the 100 to 200 dpi. As it turns out many users are using images that were scanned at much higher resolution. The system doesn’t need to know exactly what the image resolution is but you can help it do a better and faster job by providing a fair guess using this flag.

o    –granularity                Barcode search granularity - Although EymBarcode doesn’t do a traditional “scan-line” process, there is still a concept of search granularity when it first analyses the provided image in order to assess where potential barcodes might live. If you deal with large and high-resolution images, you can get away with a coarser granularity (i.e. larger number), which will subsequently speed up the process.

o    –bctypes                     Binary mask describing the list of barcode protocols the control should be looking for. This binary mask is composed of the following:

   

Value

Protocol

1

EAN-13 and UPC-A + 2/5 digits extensions

2

CODE128 - includes code types UCC/EAN-128

4

CODE-39

8

CODE-93

16

EAN-8

32

UPC-E

64

UPC extensions (2 or 5 digits supplements)

128

Interleaved 2 of 5

256

CODABAR (aka Ames Code/USD-4/NW-7/2 of 7)

512

Patch Codes (1, 2, 3, 4, 6 and T)

These values are combined to provide a binary mask describing any subset of enabled protocols. For example, in order to enable EAN13, EAN8 and UPC-E and disable all other protocols, we would set the binary mask property to: (1 + 16 + 32) = 49.

By default and if no value is explicitly set on the command line, this mask is set to 959, enabling all of the protocols except UPC extensions when they stand by themselves.

Output format

Provided with one of multiple files, the utility consolidates its results in a single XML output packet, which it writes to standard output.

XML packet name: An output WILL be encapsulated within the <EymBCrdCMDOutput> </EymBCrdCMDOutput> tags.

Time stamp: An output WILL include a time stamp encapsulated by the <Timestamp> </Timestamp> tags.

Version: An output WILL include a version reference encapsulated by the <Version> </Version> tags.

File analysis results: An output MAY contain one or more analysis result packets, each one corresponding to an image file that matches the input file mask. Each file analysis result packet is encapsulated by the <EymBCrdResult> </EymBCrdResult> tags. Each file analysis result packet consists of the following fields:

·          File name: A file analysis result WILL contain a file name encapsulated by the <FileName> </FileName> tags. This file name will be recorded with its full path.

·          Status: A file analysis result WILL contain a status string encapsulated by the <Status> </Status> tags. This status string will either be “OK” or a string starting with “ERROR” and further error description.

·          Number of codes: A file analysis result MAY contain a number of barcodes encapsulated by the <NbCodes> </NbCodes> tags.

·          Barcode matches: A file analysis result MAY contain one or more barcode matches packets, each one corresponding to a barcode that was found within the image file. Each barcode match packet is encapsulated by the <BarcodeMatch> </BarcodeMatch > tags. Each barcode match packet consists of the following fields:

o    Raw data: A barcode match WILL contain a raw data field encapsulated by the <RawData> </RawData> tags. Any non-printable character present in the barcode’s raw data will be replaced with the “#” character in that string.

o    Symbology: A barcode match WILL contain a symbology field encapsulated by the <Symbology> </Symbology> tags.

o    Barcode type: A barcode match WILL contain a barcode type field encapsulated by the <BarcodeType> </BarcodeType> tags.

o    Data descriptor: A barcode match WILL contain a data descriptor field encapsulated by the <DataDescriptor> </DataDescriptor> tags.

o    Data: A barcode match WILL contain a data field encapsulated by the <Data> </Data> tags. This field will take into account any special data formatting associated with the data descriptor.

o    Confidence measure: A barcode match WILL contain a confidence measure (between 0.0 and 1.0) encapsulated by the <Confidence> </Confidence> tags. This value conveys a measure of certainty associated with the extraction of that barcode data from the image file.

o    Barcode location: A barcode match WILL contain barcode location information in the form of a start and a stop pixel position. These four coordinates are respectively encapsulated by the <Startx> </Startx>, <Starty> </Starty>, <Stopx> </Stopx>, <Stopy> </Stopx> tags, provided in pixel units with respect to the top left corner of the image file.

As an illustration, here is a sample output packet resulting from analyzing two image files. The first containing a single vehicle identification number (code-39) and the second containing a collection of four barcodes:

 

<EymBCrdCMDOutput>

<Timestamp>9/10/2006 5:59:06 PM</Timestamp>

<Version>1.0.0 - DEMO</Version>

<EymBCrdResult>

     <FileName>\SamplePics\18-vin.jpg</FileName>

     <Status>OK</Status>

     <NbCodes>1</NbCodes>

     <BarcodeMatch>

          <RawData>I1G8ZK8570PZ320358</RawData>

          <Symbology>CODE-39</Symbology>

          <BarcodeType>VIN</BarcodeType>

          <DataDescriptor>Vehicle Identification Number</DataDescriptor>

          <Data>WMI: 1G8; VDS: ZK857; Year: 1993; Plant: Z; Serial#: 320358</Data>

          <Confidence>0.824</Confidence>

          <Startx>49</Startx>

          <Starty>304</Starty>

          <Stopx>555</Stopx>

          <Stopy>304</Stopy>

     </BarcodeMatch>

</EymBCrdResult>

<EymBCrdResult>

     <FileName>\SamplePics\19-miscCodes.jpg</FileName>

     <Status>OK</Status>

     <NbCodes>4</NbCodes>

     <BarcodeMatch>

          <RawData>3555080041001</RawData>

          <Symbology>EAN-13</Symbology>

          <BarcodeType>EAN-13</BarcodeType>

          <DataDescriptor>Product Identifier - France</DataDescriptor>

          <Data>(35) 5508004100</Data>

          <Confidence>0.856</Confidence>

          <Startx>49</Startx>

          <Starty>120</Starty>

          <Stopx>165</Stopx>

          <Stopy>35</Stopy>

     </BarcodeMatch>

     <BarcodeMatch>

          <RawData>9780761120148 + 51995</RawData>

          <Symbology>EAN-13 + UPC Supplemental</Symbology>

          <BarcodeType>EAN-13 + 5-digit Supplement</BarcodeType>

          <DataDescriptor>International Book Serial Number + Retail Price</DataDescriptor>

          <Data>ISBN 0-7611-2014-9; $19.95 U.S.</Data>

          <Confidence>0.850</Confidence>

          <Startx>293</Startx>

          <Starty>169</Starty>

          <Stopx>474</Stopx>

          <Stopy>140</Stopy>

     </BarcodeMatch>

     <BarcodeMatch>

          <RawData>3250390004790</RawData>

          <Symbology>EAN-13</Symbology>

          <BarcodeType>EAN-13</BarcodeType>

          <DataDescriptor>Product Identifier - France</DataDescriptor>

          <Data>(32) 5039000479</Data>

          <Confidence>0.883</Confidence>

          <Startx>70</Startx>

          <Starty>225</Starty>

          <Stopx>221</Stopx>

          <Stopy>302</Stopy>

     </BarcodeMatch>

     <BarcodeMatch>

          <RawData>code128-01</RawData>

          <Symbology>CODE-128</Symbology>

          <BarcodeType>Generic</BarcodeType>

          <DataDescriptor></DataDescriptor>

          <Data>code128-01</Data>

          <Confidence>0.880</Confidence>

          <Startx>286</Startx>

          <Starty>381</Starty>

          <Stopx>513</Stopx>

          <Stopy>344</Stopy>

     </BarcodeMatch>

</EymBCrdResult>

</EymBCrdCMDOutput>

Examples

EymBCrdCMD.exe myimage.jpg

This will look for all supported types of barcodes that may live in the provided JPEG image file. The result of this analysis will be written to the standard output.

 

EymBCrdCMD.exe -bctypes 6 picsFolder/*.gif

This will look for code-128 and code-39 barcodes only within all GIF files stored under the picsFolder/ directory. Here again the result of this analysis will be written to the standard output.

 

EymBCrdCMD.exe -bctypes 1 picsFolder/*.tif > results.xml

This will look for EAN-13 barcodes within all TIFF files stored under the picsFolder/ directory. This time the utility’s standard output is redirected to a file so that the result of this analysis will be stored in an XML file entitled “results.xml”

Functionality and supported standards

 

Supported image file formats

In order to parse image files this utility uses the Microsoft Windows GDI+ API, which supports the following file formats: BMP, GIF, JPEG, PNG and TIFF.

Microsoft Windows GDI+ is the portion of the Windows XP operating system or Windows Server 2003 operating system that provides two-dimensional vector graphics, imaging, and typography. GDI+ improves on Windows Graphics Device Interface (GDI) (the graphics device interface included with earlier versions of Windows) by adding new features and by optimizing existing features. – Excerpt from msdn.Microsoft.com

Supported barcode standards

This utility supports the same set of barcode standards as the EymBarcodeReader ActiveX control it is based upon. Some barcode standards are actual symbologies (i.e. means to encode data graphically) while some others are encoding systems that live on top of symbologies. The EymBarcodeReader control is aware of the following variety of symbologies and encoding systems.

 

Standard

Type

Description

EAN-13

Symbology

Used with consumer products internationally, it conveys 13 decimal digits. The code consists of a 2 to 3 digit number system that identifies a numbering authority, a manufacturer and product code, and a single check digit. The EymBarcodeReader control is aware of 89 different numbering authorities, which it will return in human readable form in its DataDescriptor property.

UPC-A

EAN-13 subset

Used in consumer products in the US and Canada. These are EAN-13 codes with number systems start with “0”. The EymBarcodeReader control is further aware of few UPC-A sub formats including UPC coupons.

JAN-13

EAN-13 subset

Used in consumer products in Japan.

ISSN

EAN-13 subset

International Standard Serial Number for periodical.

ISBN a.k.a. Bookland

EAN-13 subset

International Standard Book Numbering. The EymBarcodeReader control is further aware of the specific formatting of these numbers.

ISMN

EAN-13 subset

International Standard Music Number. The EymBarcodeReader control is further aware of the specific formatting of these numbers.

EAN-8

Symbology

Short version of the EAN-13 symbology, it conveys 8 decimal digits including a check digit.

UPC-E

Symbology

Short version of the UPC-A symbology, it conveys 8 digits including a check digit. Its data is a compressed from of a full UPC-A code. The EymBarcodeReader control will decompress that data and provide it as a standard UPC-A product identification code in its Data property.

Code 128

Symbology

High density and variable length symbology that includes a check digit. This symbology is capable of conveying a large set of characters and used extensively worldwide.

UCC/

EAN128

Encoding system

This encoding system lives on top of the Code 128 symbology. This standard is used to convey a wide range of common data including package dimensions, weights, expiration dates, coupons and more. The EymBarcodeReader control is aware of 91 different application identifiers, for which it will provide human readable descriptions in its DataDescriptor property and format its Data property appropriately.

Code 39

Symbology

Variable length alpha-numeric symbology with no enforced check digit.

Vehicle Identification Number

Encoding system

This encoding system lives on top of the Code 39 symbology. It consists of 17 alphanumerical characters that convey the manufacturer’s identification (WMI), a descriptor of the vehicle’s configuration (VDS), a check digit, the year it was built, the manufacturer’s plant identification and the vehicle’s serial number.

Code 93

Symbology

Higher density variant of Code 39. This code always includes a check digit.

Interleaved 2 of 5

Symbology

Variable length decimal symbology with no enforced check digit.

UPC 2-digit  supplemental

Symbology

Conveys 2 additional decimal digits following an EAN-13, EAN-8, UPC-A or UPC-E barcode. This information is typically intended to identify the issue number of the product.

UPC 5-digit  supplemental

Symbology

Conveys 5 additional decimal digits following an EAN-13, EAN-8, UPC-A or UPC-E barcode. This information is typically intended to convey pricing information. The EymBarcodeReader control is aware of 10 different currency codes.

Codabar

Symbology

Variable length symbology with no enforced check digit. It may encode 16 different characters, plus an additional 4 start/stop characters. This symbology is used by U.S. blood banks, photo labs, and on FedEx airbills.

Patch Codes

Symbology

Set of 6 distinct barcode patterns (1, 2, 3, 4, 6 and T) that are typically used as document separators.

Further details about these standards was graciously made available online at these sites:

VIS’ Barcode Island - http://www.barcodeisland.com/

Russ Adam’s Barcode1 - http://www.adams1.com/pub/russadam/barcode1.html