Procedure for Decoding a QR Code

Blog

Decoding data from the QR code is the reverse of the encoding procedure.

Recognizing Modules

Recognize dark and light modules as an array of “0” and “1” bits by locating and getting an image of the symbol.

Extract Format Information

Decode the format information and release the masking pattern and apply error correction on the format information modules as necessary. Also obtain a mask pattern reference.

Determine Version Information

If version information is applicable, then decode it from the version information area and then determine the version of the QR code symbol.

Release Masking

In order to release the masking, XOR the encoding region bit pattern with the Mask Pattern whose reference has been extracted from the format information.

Restore Data and Error Correction Codewords

Restore the data and error correction codewords of the message by reading the symbol characters (according to the placement rules for the model).

Error Detection and Correction

By utilizing the error correction codewords, identify errors and if any error is detected, correct it.

Decode Data Codewords

Divide the data codewords into segments according to the Mode Indicators and Character Count Indicators. And finally, decode the data characters according to the mode(s) in use and output the decoded text as result.

Leave a Reply

Your email address will not be published. Required fields are marked *