Skip to content
Using Webcam to Read one-dimensional barcodes and QR codes from Python 2 and 3
Branch: master
Clone or download
Pull request Compare This branch is 22 commits ahead, 11 commits behind NaturalHistoryMuseum:master.
cuicaihao Add MIT License
Add MIT License
Latest commit 28831bb Oct 15, 2018
Type Name Latest commit message Commit time
Failed to load latest commit information.
.ipynb_checkpoints Update readme file Oct 7, 2018
Bar_Images Update jupyter notebook May 18, 2018
QR_Images Update jupyter notebook May 18, 2018
codes update readme May 18, 2018
pyzbar update May 18, 2018
.coveragerc Initial commit Nov 8, 2016
.gitignore NaturalHistoryMuseum#21 Illustrate bounding box and polygon Apr 30, 2018
.travis.yml [NaturalHistoryMuseum#9] Python 3.6 Jan 18, 2017
Lab_01_QR_Bar_Code_Detector_Basic.ipynb Update readme file Oct 7, 2018
Lab_02_QR_Bar_Code_Detector_Webcam.ipynb Update Oct 7, 2018 Update Oct 7, 2018
MIT License.txt Add MIT License Oct 16, 2018 Update readme file Oct 7, 2018
_config.yml Set theme jekyll-theme-minimal Aug 25, 2018
requirements.pip [NaturalHistoryMuseum#16] Refactor load of libdmtx shared library Mar 18, 2018
setup.cfg Initial commit Nov 8, 2016 More prep for release Mar 18, 2018
tox.ini [NaturalHistoryMuseum#9] Python 3.6 Jan 18, 2017

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


Mac OS X: Install Homebrew:

/usr/bin/ruby -e "$(curl -fsSL"

Install zbar lib:

brew install zbar


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


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).

You can’t perform that action at this time.