3. QR code creation and recognition

1. QR code

1.1. Introduction to QR code

QR code is a type of two-dimensional barcode. QR comes from the abbreviation of "Quick Response" in English, which means quick response. It comes from the inventor's hope that the QR code can allow its content to be decoded quickly. QR code not only has large information capacity, high reliability and low cost, but can also represent various text information such as Chinese characters and images. It has strong confidentiality and anti-counterfeiting and is very convenient to use. What's more important is that the QR code technology is open source.

1.2. Characteristics of QR code

The data values in the QR code contain repeated information (redundant values). Therefore, even if up to 30% of the QR code structure is destroyed, the readability of the QR code is not affected. The storage space of QR code is up to 7089 bits or 4296 characters, including punctuation marks and special characters, which can be written into QR code. In addition to numbers and characters, words and phrases (such as web addresses) can also be encoded. As more data is added to the QR code, the code size increases and the code structure becomes more complex.

1.3. QR code creation and recognition

1), source code path
2), installation package (the factory docker image has been installed)

 

3) Create QRcode_Create.py

Enter docker, open the terminal and enter,

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

image-20230426103227913

Take out your phone and try to scan the QR code that appears on the right. The scan result will be the characters yahboom.

Source code analysis,

4). Identify QRcode_Parsing.py

Enter docker, open the terminal and enter,

image-20230426105028406

After the program is run, 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 on the terminal.

Source code analysis,