Professional Documents
Culture Documents
the 2D barcode realm we have: DataMatrix, QR code, EZ code, Smart code, etc. Each type of barcode is called a
symbology, and there is a corresponding standard that defines the symbol and how to decode and encode the
symbol.
1D barcodes are mostly used when space isn't an issue and messages are short. They are cheaper since the
technology to decode them is easier, which is why they are more commonplace than 2D barcodes. Barcodes are
much cheaper than employing another technology, such as RFID. RFID requires purchase of tags, whereas barcode
technology requires just inking costs. Thus from a cost point of view, it makes sense to use barcodes. Additionally,
barcodes are already widely available in the marketplace. Since our main use case was to be able to add items to a
shopping list, we decided to focus on a 1D barcode reader/scanner. Currently, UPC labels are located on the back of
most consumer products whereas 2D barcodes are not as readily available. This means we can find many more
sample products to use as test cases.
There are several libraries available to decode barcode symbologies. A select few of these libraries are open source.
One prominent open source library is the ZXing project. [2] It has the capability to read not just 1D barcodes but
also 2D barcodes and is based on the Android platform. Although this library is widely used and has a tremendous
amount of technical support, we decided not to use it because of the large framework (Android) that we would need
to install and the risk that came with this. We vetoed the JJIL project [9] for a similar reason; it required the
installation of J2ME. Also, we wanted a library that was much more portable and light weight, without requiring us
to install additional platforms. Libraries that fell into this category included: libdatamatrix, libdecodeqr, and QrCode
but these were limited by the barcodes they could actually read, which were only 2D formats. Zebra turned out to be
the best library because it is a C/C++ library that doesn't require a special run-time environment to be installed over
Linux , was high speed with small memory footprint and code size (< 1k lines of code) , and had the ability to read a
wide range of 1D barcodes that are essential to complete the main use case.
II. Project Description
A. Project Goals
Our project has three main goals. The first goal is to replicate a commercial barcode scanner on the Intel PXA27x
device. Milestones include configuring the on-board camera and installing image manipulation and barcode
decoding libraries. Our second goal is to decode the barcode images in real-time, quickly and efficiently. This
involves improving the image decoding algorithms and choosing efficient image manipulation and barcode libraries.
Our final goal is to connect to the web to access an online database. Milestones include installing the browser,
configuring proper network settings, and finally creating an online shopping application and database.
Our main use case will involve adding items to a Christmas shopping list. The user will pick up an item that he
desires in the store and then take a picture of its barcode. Afterwards, the barcode contents will be decoded and the
product name is found within a UPC database. The user will then be redirected to an online shopping list, with the
current item added.
There are many possibilities for what could be stored in a barcode. We could denote movie information, website
links, a save state or item in a video game, etc. Whatever the case may be, it can be thought of as linking information
using photos taken on a common handheld device. Thus, we have streamlined the transfer of data in a simple and
elegant manner.
B. Project Implementation
Our system architecture can be organized into five main components: A camera, an image manipulation library, a
barcode decoder, a web browser, and an online shopping application. To capture camera images, we used the camera
available on board and modified the ci-capture program. We installed the image manipulation library, ImageMagick
[10] to adjust the taken images for quality and convert into desired format. For the barcode decoding libraries, we
used Zebra [1]. We also installed a free open source graphics and text mode browser called LINKS[8][7]. Finally,
we created a web application which simulated an online shopping list.
The use case sequence, in relation to the five main components, is as follows: A user will utilize the modified cicapture program to take a picture of a barcode, which is held in front of the camera to capture. Using ImageMagick
libraries, this saved .yuv is converted into a .gif, cleaned up, and passed to the barcode decoder library. The
decoding result is passed to the web browser, and a textual page rendered to simulate adding the item to a user's
shopping list. The typical use case is displayed in Figure 2.
PCMCIA support. We were able to rebuild the Linux kernel and recognize the card with our controller, but unable to
bring up the wireless interface with ifconfig. With a little more time, this problem would have been solved but our
priority was getting the camera and decoder to recognize our barcodes efficiently. For our experiments, the addition
of a wireless connection was not given much precedence since it is something we already know works. Additionally,
a database and webpage were set up to replicate an online shopping cart, but because we were unable to set up our
wireless connection they could not be used by our application.
IV. Future Work
There is a lot of future work that can be done with this project. The user experience could be improved upon. It
would greatly increase our success rate if the user were given visual or auditory clues on how to align the barcode
image for best image capture and barcode scan. We would like to add a better camera with higher resolution, autofocus, and or macro lens to obtain accurate and fast decoding. Besides adding new hardware, we could also improve
the image capture of the camera. For example, we could combine multiple low-resolution, blurred image captures
from the camera into one super high resolution image. This improved image would be sharper and cleaner, thus
allowing us to decode the barcode despite image restrictions.
Beyond the camera, we have challenges such as efficiency of algorithms and power consumption for the device. The
barcode reader requires a lot of image processing and file input and output. This requires a huge amount of heap
memory to filter and alter the image. Currently we are using BLOB (binary large object representation) which
allocates a large buffer for the image. In the future, we would optimize the buffer size for this during image
manipulation and barcode scanning. We would also perform benchmarking during maximum memory utilization (ie:
several worst case memory consuming applications) to make sure we don't overstep the bounds on memory
allocation.
V. Conclusion
The barcode scanner works very close to how we expected. Because the provided camera has neither autofocus nor
flash, it was often difficult to determine the exact cause of problems. However, after extensive testing we were able
to produce a working scanner with good results. Thanks to efficient image conversion and decoding processes, the
entire process runs predictably within reasonable time constraints; roughly a few seconds. As far as resources are
concerned, waste is kept low thanks to our pipelined data processing approach. Although decoding often takes up
the majority of the process, the time it takes is usually constant. Therefore, the network connection can be
considered the major bottleneck since it may produce uncontrollable results. Barcode decoding with mobile devices
is definitely possible with the correct implementation. Yet in practice, results are dependent on the quality of the
camera as well as the speed of the network connection.
VI. References
1. Zebra. http://zebra.sourceforge.net/
2. Zxing. http://code.google.com/p/zxing/
3. Rigal, Daniel. Barcode. http://en.wikipedia.org/wiki/Barcode
4. Information TechnologyAutomatic Identification and Data Capture TechniquesQR Code 2005 Bar Code
Symbology, ISO/IEC 18004, Int'l Organization for Standardization, 2006.
5. Understanding 2D Symbologies: Detailed Information on Barcodes, Japan Automatic Identification Systems
Assoc., 2004.
6. T.-D. Han et al., Machine Readable Code Image and Method of Encoding and Decoding the Same, US Patent
7,020,327, US Patent and Trademark Office, 2006.
7. Ihmig, M. 2005. Porting Linux to Intel's Glencoe Platform. Web site:
http://www.cs.cmu.edu/~rtmach/mainstone/glencoe.pdf.
8. LINKS. http://links.sourceforge.net/
9. John's Java Imaging Processing Library. http://code.google.com/p/jjil/w/list
10. ImageMagick. http://www.imagemagick.org/script/index.php