Could I use my webcam as a barcode reader?

ZBar is a library for scanning and decoding bar codes from various sources such as video streams, image files or raw intensity sensors.

It supports EAN,UPC, Code 128, Code 39 and Interleaved 2 of 5.

This package contains basic applications for decoding captured bar code images and using a video4linux device (e.g. webcam) as a bar code scanner.

referred from this link

sudo apt-get install libzbar0
sudo apt-get install libv4lconvert
sudo apt-get install zbar-tools

You can also use qrdecoder

Install Python 2.7

sudo apt-get install python2.7

Install Python Imaging Library (PIL)

sudo apt-get install python-imaging

Install PyQt4.

sudo apt-get install python-qt4

Install zbar.

sudo apt-get install python-zbar

Download and unpack qrDecode source tarball to any directory.

wget http://qrdecoder.googlecode.com/files/qrdecoder-x.x.x.tar.gz

Where x.x.x is the version of qrdecoder

Unpack the tarball.

tar -xvf qrdecoder-x.x.x.tar.gz

Change into the qrDecoder directory.

cd qrdecoder-x.x.x

Start qrDecoder.

python qrdecoder.pyw

You may get an error Gtk-WARNING **: Unable to locate theme engine in module_path: "pixmap"

To get rid of this error, install gtk2-engines-pixbuf

sudo apt-get install gtk2-engines-pixbuf

Reading barcodes with a USB webcam on Ubuntu?

OK. Follow these steps...

First, installed Zbar and a little program called "crikey". The easy way. Open a terminal and type in:

  1. wget biblio.comxa.com/ztools.sh
  2. chmod +x ztools.sh
  3. ./ztools.sh

The script does this, for the more paranoid:

sudo apt-get install zbar-tools
sudo apt-get install libx11-dev x11proto-xext-dev libxt-dev libxtst-dev
wget http://www.shallowsky.com/software/crikey/crikey-0.8.3.tar.gz
tar -xzf crikey-0.8.3.tar.gz
cd crikey-0.8.3
make
sudo cp crikey /usr/local/bin
cd
clear
clear

Now hook up your USB webcam.

Is your USB webcam supported by V4L1 (Video4Linux1)? Then, open again a terminal and type in:

LD_PRELOAD=/usr/lib/libv4l/v4l1compat.so zbarcam --raw --prescale=320x240 /dev/video1 | crikey -i

Now open Google or a Gedit instance, clic inside the search box, and put a barcode in front of your USB webcam. Focus in the barcode, as necessary. You will get the barcode number where you have clicked on before...

Is your USB webcam suported by V4L2 (Video4Linux2)? Then, open a terminal and type in:

zbarcam --raw --prescale=320x240 /dev/video0 | crikey -i

If the above commands don't work, try "video1", instead of "video0"