Skip to content

tuminguyen/QR_Barcode_Reader

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

QR Code reader

This repo using pyzbar library with opencv to read both QR and barcode. However, if you only want to read QRCode, you can simply use the built-in function in openCV (QRCodeDetector).

There are 2 modes in the project:

  • stream: real time detect via video
  • image: detect on an input image

Detected code will be displayed with a message (text) over the bounding box.

Environment

  • Ubuntu 20.04 (runnable on Raspberry Pi)
  • Python 3.7

Requirements

  • OpenCV
  • Pyzbar

Usage

IMPORTANT: Remember to install libzbar0 first, otherwise it will get error when running

sudo apt-get install libzbar0

Arguments parser

'--mode', '-m', 
    choices=['stream', 'image'],
    type=str, 
    description='choose detect mode: on streaming video or on single image')
'--img', '-i':  
    type=str
    description='image path'
'--rate', '-r':
    description:'Call read QR/Bar code after this number of frames'
    default: 1

Install all libraries

Run the program

With image

python run.py -m image -i test.png

Stream video

python run.py -m stream

About

Read QR and Barcode with Python

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages