1 – The Code is illuminated.
The first step in the process is where the QR code is illuminated. On some devices this is done using an infrared light, however if you are scanning a QR code using your smartphone then it may use the in-built flash, or simply rely on ambient light.
2 – The light hits the image and then bounces back
The emitted light hits the image, with the darker parts of the image absorbing more light. The light the bounces back.
3 – The returning light hits the lens in the scanner and is focused onto the surface of a Charge Coupled Device
The returning light arrives at the scanner lens where the light is focused onto a CCD. The CCD is a 2 dimensional array of millions of photo sensitive cells. Each cell varies the electrical signals that it outputs depending on the amount of light that hits the cell.
4 – The electrical signals are converted to digital by the ADC
The electrical signals from the cells are passed onto an Analogue to Digital Convertor, which convert the signal into digital form.
5 – The scanner combines the digital data into an image
The digital signals are combined into a matrix of digital values, creating a digital version of the QR code.
6 – The image is processed by the scanner
The scanner now processes the image, using image recognition and manipulation software. This is the stage where the position and alignment data is used.
This includes:
Rotating the QR code so that it is the correct way up
Warping the image so that any distortion is removed
Altering the contrast and exposure of the image so that it can be decoded.
7 – The data is read from the QR code
Now the data can be read from the QR code, line by line in a zig-zag manner, until all the data is read. Once read the error detection and correction algorithms are applied.
This stage is where the version, format and timing data are used.
8 – The data is used by the device / software
Finally software on the device processes the QR code data as required (such as opening up an URL in a web browsers if opening a QR code on your phone).