Reading QR Code from Image using python

(Comments)

In this post, I will show you how to read QR Code from image using python

We will be using the open source app "qrtools" to read image.

qrtools installation:

Install zbar systemwide

sudo apt-get install libzbar-dev

Then create virtualenv and then install requirements

pip install pypng zbar pillow qrtools

Where pypng, zbar and pillow are the dependencies required by qrtools.

Code to read QR Code from Image:

import qrtools
qr = qrtools.QR()
qr.decode("QR_Code.png")
s = qr.data
print("The decoded QR code is: %s" % s)

Comments

Recent Posts

Archive

2019
2018
2017
2016
2015
2014

Tags

Authors

Feeds

RSS / Atom