Barcode Reader

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

Participation wanted!

  Software license: Apache 2.0

Documentation

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: https://github.com/glassechidna/zxing-cpp
    The original sample program which inspired this can be found here: http://www.idealsoftware.com/opensource/scan-1d-2d-barcodes-webcam-zxing-opencv-visual-c.html


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: http://www.baslerweb.com/en/products/cameras/area-scan-cameras/dart
    Driver details: http://www.baslerweb.com/en/support/downloads/software-downloads


It also uses OpenCV 2.4.10 for image Display and some processing.
    http://opencv.org/

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 libzxing-cpp-master.zip
    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 libzxing-cpp-master.zip
    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 opencv-2.4.10.zip
    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 libopencv_core.so.2.4.10, libopencv_highgui.so.2.4.10, libopencv_imgproc.so.2.4.10 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"): https://zxing.github.io/zxing/license.html (Apache 2.0)
- Zxing-cpp: https://github.com/glassechidna/zxing-cpp/blob/master/COPYING (Apache 2.0)
- Barcode Reader project (Ideal Software): see PylonSample_Barcode.cpp (BSD License)
- OpenCV: see opencv.org (BSD License)

 

Finally added to a github repo!

2017-08-29 19:31:38 UTC mattb - 87 points

 
Does this project pique your interest?
Login or register on Imaginghub to join or follow this project.