The zebra barcode reader is a small, layered EAN/UPC and Code 128 bar code scanning and decoding library implemented in C (C++ wrappers are also provided)
The library comes with two linux application front ends for:
decoding captured bar codes from an image file
using a video4linux device (eg, webcam) as a bar code scanner
Download the latest zebra release
zebra sourceforge project page
Post a message in the "Help" forum if you just have a question or comment.
Check on the wiki for related information. Or contribute something that others might find useful.
If you have trouble decoding an image, you may attach it to a new support request.
Refer to the API documentation to integrate a barcode scanner with your project
There are scores of commercial and shareware programs that scan many different symbologies, but the few open source image scanners I was able to find didn't meet my needs. This project aims to create a stable, robust library component that can be easily reused in a variety of applications. (and most importantly... "it sounded like fun at the time" :)
The advantages of the zebra implementation are:
high speed
small memory footprint
small code size - the core scanner and EAN decoder represent under 1K lines of C code
not limited to images
no floating point operations
suitable for embedded applications using inexpensive processors/hardware
modular components can be used together or separately
However this is not intended to be a "solve all" implementation - a few of the main disadvantages:
Does not scale to some 2D symbologies. Those which are formed by stacking 1D symbols (eg, PDF417) seem feasible and may be included in future releases. Other "true" 2D symbologies would require more image processing
Inappropriate for longer 1D symbologies - The length of a symbol (or separately identifiable section of a symbol) is limited by the ability to capture at sufficient definition and make a linear scan pass through it. As symbols become longer and the aspect ratio increases, more image pixels are required and the decode becomes increasingly sensitive to symbol orientation
Likely more sensitive to poor quality images, such as excessive noise or bad contrast (all those fancy image processing filters have to be useful for something?)
but these don't keep it from being very useful for tracking movies, music, books, etc using your webcam or homemade wand scanner =)
A common design for a bar code "image scanner" is to apply digital image processing techniques to an image containing a bar code: exact details vary, but this usually involves several filter steps to cleanup noise, sharpen and enhance contrast, edge detection and shape analysis to determine symbol location and orientation, etc. Finally the data is extracted from this pristine image. All of these processing stages require CPU cycle and memory resources and are often sensitive to various "filter parameter" configurations which are difficult for end-users to understand and setup.
The zebra library takes an approach closer to that used by "wand" and "laser" scanners: EAN/UPC bar code symbols are designed for very flexible scanning, they can be partially decoded in sections and the relative position and orientation determined after decoding. Taking advantage of this, the zebra applications make multiple scan passes over an image, decoding and assembling partial symbols on the fly. The effect is similar to the pattern you see from the laser scanner when you check yourself out.
Taking a cue from modern processing paradigms, zebra further abstracts this idea into a layered streaming model. Processing is separated into independent layers with well defined interfaces, which can be used together or individually plugged into any other system. A high-level description of the modules is provided here:
zebracam and
zebraimg are two examples of how this can be done
(UTSL).Copyright 2007-2008 (c) Jeff Brown - All Rights Reserved.
Verbatim copying and distribution of this entire article are permitted worldwide, without royalty, in any medium, provided this notice, and the copyright notice, are preserved.
Last modified: Tue Mar 4 15:31:27 EST 2008