3. QR code creation and recognition

1 QR Code

1.1 QR Code Introduction

QR code is a kind of two-dimensional barcode, QR comes from the abbreviation of English "Quick Response", that is, the meaning of quick response, originated from the inventor hopes that the QR code can let its content be decoded quickly.QR code not only has large information capacity, high reliability and low cost, but also can represent a variety of textual information such as Chinese characters and images, its QR code not only has large information capacity, high reliability, low cost, but also can represent many kinds of text information such as Chinese characters and images, its confidentiality and anti-counterfeiting is strong and very convenient to use. What's more, QR code technology is open source.

1.2 Structure of QR Code

image-20230426101118368

1.3. Characteristics of QR codes

Data values in QR codes contain repeated information (redundant values). Therefore, even up to 30% of the QR code structure is destroyed without affecting the readability of the QR code.QR codes have a storage space of up to 7,089 bits or 4,296 characters, including punctuation marks and special characters, which can be written into the QR code. In addition to numbers and characters, words and phrases (such as web addresses) can be encoded. As more data is added to the QR code, the code size increases and the code structure becomes more complex.

1.4, QR code creation and recognition

1) Source code path
2) Installation package

The factory docker image is already installed.

3) Create QRcode_Create.py

Go to docker, open a terminal and type.

After the program is run, you will be prompted to enter the generated content, and the Enter key will confirm the content. Here we create the string "yahboom" as an example.

image-20230426103227913

The QR code appears on the right side, take out your cell phone and try to scan it, the result will be yahboom characters.

Source code analysis.

4) Recognize QRcode_Parsing.py

Go to docker, open a terminal and type.

image-20230426105028406

After the program runs, we place the QR code in front of the camera, the program will recognize the content of the QR code, mark it on the picture and print out the recognized content in the terminal.

Source code analysis.