Skip to content

Using Webcam to Read one-dimensional barcodes and QR codes from Python 2 and 3

Notifications You must be signed in to change notification settings

cuicaihao/Webcam_QR_Detector

 
 

Repository files navigation

Bar and QR code detector

Life is short, use Python

This project is forked from zbar library, I added few modifications, so webcam can be used as an image reader to detect QR and Bar codes.

  • Pure python
  • Works with PIL / Pillow images, OpenCV / numpy ndarrays, and raw bytes
  • Decodes locations of barcodes
  • No dependencies, other than the zbar library itself
  • Tested on Python 2.7, and Python 3.4 to 3.6

Here is a quick look of the final output:

webcam QR detection

Installation

Mac OS X: Install Homebrew:

/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

Install zbar lib:

brew install zbar

Linux:

sudo apt-get install libzbar0

Install this Python wrapper; use the second form to install dependencies of the command-line scripts:

pip install pyzbar
pip install pyzbar[scripts]

Jupyter Notebook:

Go to see the Jupyter Notebook for more details.

  1. QR_Bar_Code_Detector_Basic
  2. QR_Bar_Code_Detector_Webcam

License

pyzbar is distributed under the MIT license (see LICENCE.txt). The zbar shared library is distributed under the GNU Lesser General Public License, version 2.1 (see zbar-LICENCE.txt).

About

Using Webcam to Read one-dimensional barcodes and QR codes from Python 2 and 3

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Jupyter Notebook 93.7%
  • Python 6.3%