Python 3 OpenCV to Scan & Read QRCode Image & Save the Data into Text File Using qreader Library
64 views
Jun 3, 2025
Get the full source code of application here: https://codingshiksha.com/python/python-3-opencv-to-scan-read-qrcode-image-save-the-data-into-text-file-using-qreader-library/
View Video Transcript
0:00
uh hello guys uh welcome to this video
0:02
so in this video I will show you how to
0:04
scan your QR codes inside a Python
0:07
script uh using a module a free module
0:11
which is provided by Python so we have
0:14
this QR code right here you will see
0:15
this QR code image is there and we will
0:18
scan this and uh print out whatever is
0:20
the data so once I run this script right
0:24
here you will see it will scan this QR
0:28
code and print the result in the
0:31
terminal so it will just take 5 to 10
0:34
seconds to actually scan your QR code
0:37
and then return the data which is
0:39
associated with this QR codes so it's a
0:43
very useful Python script so you will
0:45
see it has returned this URL
0:49
httpsfreemediatools.com which is my
0:50
website so we can even cross check as
0:53
well you can upload this QR
0:58
code let me
1:01
just do this so it's scanning this uh
1:04
now you can see again it comes out to be
1:07
free media tool so it is actually
1:08
returning the correct text so there is
1:12
this package here let me show you uh you
1:14
just need to first of all install this
1:16
patch package QR reader this is actually
1:19
the package
1:22
name this is actually the command is
1:25
very simple straightforward simply
1:27
execute this command pip install Q
1:30
reader q reader so once you install this
1:34
package now I will show you a very
1:36
simple example how to use this so first
1:39
of all we will import this package here
1:41
Q reader and from this we need to import
1:44
this method which is there which is Q
1:46
reader after that we will also need to
1:48
import the Open CV
1:52
library so for this project you also
1:55
need the Open CV package so just install
1:58
this package as well open CV-Python so
2:01
this is the command simply install this
2:04
command to install Open CV after that we
2:07
will simply initialize this Q
2:10
reader like this
2:18
so after that we will uh initialize the
2:21
image where this QR code is present like
2:33
this so QR code image is present right
2:36
here this as you can see result.png so
2:40
you can simply provide the path here
2:46
like this so after reading it now we
2:49
will be using this uh method which is
2:52
provided by this uh module we will
2:55
decode this QR code by using this module
2:59
it contains this function which is de
3:01
detect and decode and we will then
3:04
provide the actual
3:06
image like this
3:10
so after that we can simply print out
3:13
the decoded text that's all so very
3:16
simple script you simply use this third
3:19
party module Q reader and open CV to
3:22
load the image then we simply detect and
3:26
decode the QR code and then display it
3:29
inside the terminal so this is the very
3:32
easy way by which you can scan your QR
3:34
codes and display the result uh thank
3:37
you very much guys for watching this
3:38
video and also check out my website
3:41
freemediatools.com
3:42
uh which contains thousands of tools
#Scripting Languages
#Software