Read QR CodeΒΆ

The full name of QR Code is Quick Response Code, which is a coding method. It can store more information and represent more data types than the traditional Bar Code.

As a new information storage, transmission and identification technology, QR Code has attracted the attention of many countries in the world since its birth. The United States, Germany, Japan and other countries have not only applied QR Code technology to the management of various documents by public security, diplomatic, military and other departments, but also applied QR Code to the management of various reports and bills by customs, taxation and other departments , the management of commodity and cargo transportation by commercial and transportation departments, the management of postal parcels by the postal department, and the automated management of industrial production lines in the industrial production field.


Run the Code

cd /home/pi/vilibt/examples
sudo python3

View the Image

After the code runs, the terminal will display the following prompt:

No desktop !
* Serving Flask app "vilib.vilib" (lazy loading)
* Environment: production
WARNING: Do not use the development server in a production environment.
Use a production WSGI server instead.
* Debug mode: off
* Running on (Press CTRL+C to quit)

Then you can enter http://<your IP>:9000/mjpg in the browser to view the video screen. such as:


from vilib import Vilib
from time import sleep

def main():

    while True:
        text = Vilib.detect_obj_parameter['qr_data']

if __name__ == "__main__":

How it works?

Functions related to human face detection:

  • Vilib.qrcode_detect_switch(False) : Switch ON/OFF QR code detection, Returns the decoded data of the QR code.