Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

One day I read an article about reading barcode using my webcam in Ubuntu 12.04 by a some software which I don't remember now.

Can anybody help?

What software could help me by reading a barcode using a webcam?

share|improve this question

2 Answers 2

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"

share|improve this answer
    
It might be best to explain what crikey does? I'm not familiar with it, but it seems that it's some sort of shortcut maker for the drivers you want to load? –  Nanne Nov 11 '12 at 18:48
up vote 9 down vote accepted

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
share|improve this answer

protected by fossfreedom Oct 18 '13 at 15:00

Thank you for your interest in this question. Because it has attracted low-quality answers, posting an answer now requires 10 reputation on this site.

Would you like to answer one of these unanswered questions instead?