Barcode Scanner v0.2

A couple of weeks ago a former colleague of mine asked me if it would be possible to integrate the barcode scanner application into his application which does not use any Java.

Well, of course this is possible! Flex can call Javascript methods given in the surrounding HTML so I created the Barcode Scanner v0.2 which just calls a Javascript method after barcode recognition.
Of course I didn’t invent the wheel again and enhanced the already existent application. The recognition engine still uses the ZXing library to do the base barcode recognition.

(click here to see the running application)

While testing the first version of Barcode Scanner v0.2 my colleague reported some serious problems with the recognition rate. I owe a webcam including autofocus but if someone uses a fixfocus webcam the barcode becomes blurred and the recognition does not work.

My attempt to fix this issue was to implement a digital zoom to the application. I hope this helps to increase the recognition rate. Maybe you can drop me a line if the zoom helped?

If the recognition was successful the Flex application calls the Javascript method which opens an altert showing the detected barcode number. In an AJAX application a backend call could be triggered to run a kind of price comparation or whatever 😉

As you can see it is not necessary to have a Java backend to integrate Flex into your application.


5 thoughts on “Barcode Scanner v0.2

  1. Hi, there! if you’ve got a machine running Ubuntu and a USB webcam with manual focus, try this…

    Open a terminal and type in the following commands:

    > wget
    > chmod +x
    > ./

    Once everything is installed, hook up your USB webcam and type in this command line

    > zbarcam –raw –prescale=320×240 /dev/video0 | crikey -i

    Now open a Gedit window or Google search box, show your webcam a barcode, and click where you want the barcode to be displayed…

    If it doesn’t work, maybe your USB webcam uses V4L1 module, so type in this command:

    > LD_PRELOAD=/usr/lib/libv4l/ zbarcam –raw –prescale=320×240 /dev/video1 | crikey -i

    If you still have got any problem, send me an email at fmft71 (at) yahoo (dot) es, and I try to help you.

    Sorry! I don’t use Windows!

  2. WARNING! Before “raw” and “prescale” you have to type in 2 –
    – – raw – – presccale, but one after the other, not separated…

    1. Hi,

      thanks for your help.

      My problem was not to have no Webcam image. That worked always perfectly. The problem is using a fixfocus camera the minimum distance to the lens which is needed at least to have a sharp image. In my testcases the distance was to long so the barcode was to small for the application to read the barcode.

      Your approach is surely good to get a USB webcam running on a Linux box.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s