Thumb b5b32895 7776 479c bff4 5a1fa89e900c

Barcode Reader

Barcode Reader using Basler Dart USB camera and Raspberry Pi 2 (also for Windows)

Project State

Public Project Participation icon Participation wanted


Software Licence: Apache 2.0
Hardware Licence: Project has no hardware

Project Tags




sai manoj

Does this project pique your interest?

Login or register to join or follow this project.

Barcode Reader (mbreit 2016-09-23)

This project uses the zxing ("Zebra Crossing") library to automatically identify and decode various 1D and 2D barcodes.
    The latest C++ port can be found here:
    The original sample program which inspired this can be found here:

It uses a Basler dart USB camera and Basler Pylon 5.0.5 drivers for image acquisition and enhancement (to offload some host processing).
    Camera details can be found here:
    Driver details:

It also uses OpenCV 2.4.10 for image Display and some processing.

Running the Windows_Project:
1. All you should have to do is build and run the program in visual studio.
2. The required headers and libraries for OpenCV and zxing are pre-built and included in the /lib and /include folders.
3. The libraries are statically linked, so you should just have one .exe file to run.

Running the Linux-x86 Project:
1. This is similar to the windows project. It contains headers and prebuilt OpenCV/zxing libraries for Linux Mint 17.2 (ubunutu).
2. The makefile will look at /include and /lib
3. If that doesn't work, you need to build the zxing and opencv libraries for your machine. **

Running the Linux-RPi Project:
1. This requires you to build the libraries (we've included a prebuilt zxing library you can try though).
2. The makefile expects to see the zxing library (libzxing.a) in /lib and the OpenCV libraries in /usr/lib.
3. To install the zxing library:
    1. unpack
    2. Go to this folder, create 'cpp/build' folder
    3. run 'cmake -G "Unix Makefiles" ..'
    4. Go to cpp/build and run 'make'
    5. Grab a coffee (on RPI est. 20 minutes to build)
    6. Find libzxing.a in cpp/build. Copy it to PylonSample_Barcode/lib
4. To install the OpenCV libraries:
    1. Shortcut: See the attached application note to install prebuilt rpi libraries (building on device can take hours!).

** Building and adding libraries for the Linux-x86 Project:
(There are other ways to do this of course, this is just one example :))
To install the zxing library:
    1. unpack
    2. Go to this folder, create 'cpp/build' folder
    3. run 'cmake -G "Unix Makefiles" ..'
    4. Go to cpp/build and run 'make'
    5. Find libzxing.a in cpp/build. Copy it to PylonSample_Barcode/lib
To install the OpenCV libraries:
    1. unpack
    2. go to this folder and create a folder named 'release'
    3. go to the release folder and run 'cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local ..'
    4. run 'make'
    5. run 'sudo make install'
    6. Copy,, from XXXXX to PylonSample_Barcode/lib
       (or modify the makefile to point to /usr/lib)
    7. Copy the appropriate headers to /include, or modify the makefile to point to the opencv installation

License Info:
- Zxing ("Zebra Crossing"): (Apache 2.0)
- Zxing-cpp: (Apache 2.0)
- Barcode Reader project (Ideal Software): see PylonSample_Barcode.cpp (BSD License)
- OpenCV: see (BSD License)


GitHub Repository


pushed ac83ded25a9d0b5f6a50963eccd3a6c27c3f39b5
added notice file.
2017-08-30 20:45:11 UTC
pushed 6b39ee95d16a4f64e4b0d8399067ffb30ea654e2
License change to Apache 2.0
2017-08-30 20:40:42 UTC
pushed cc05cd1e8a046a34e1bb576aeed91085edc3bf45
added new git ignore file.
2017-08-29 19:32:03 UTC
pushed 4f9518d73a3f74f7207b4399306b9a0f93df014f
adding linux x86 and windows x64 libraries
2017-08-29 19:28:37 UTC
pushed 8a01c62d7406f190c411d46569ba6297245d1cda
First code commit
2017-08-29 19:20:32 UTC
Matthew B
pushed 96f3c5288241cf5d49c7a2d2a6ea068c5a160832
Initial commit
2017-08-29 17:23:26 UTC
Title Description Format
Source code Sample projects for Windows, Linux, and RPi zip
Screenshot Windows Screenshot jpg
Screenshot 2 Linux screenshot jpg
Screenshot 3 Raspberry Pi screenshot JPG
Updated Source Code Cleaned up a lot of code. See forum for details cpp
Task Owner Creation Date
Add safety code to handle camera disconnects, errors, etc.
Add support for saving images
Add support for logging data
Add support for Adafruit 2.5" TFT touchscreen


mattb report abuse

Finally added to a github repo!