How are QR codes read?

2023-02-06 | 462 view
Because objects of different colors reflect different wavelengths of visible light, white objects can reflect various wavelengths of visible light, black objects absorb various wavelengths of visible light.

 

Because objects of different colors reflect different wavelengths of visible light, white objects can reflect various wavelengths of visible light, black objects absorb various wavelengths of visible light. Therefore, when the camera scans the black and white two-dimensional code, the phone uses the threshold theory of point operation to change the acquired image into a binary image, that is, the image is processed binarized, after obtaining the binary image, the expansion operation is carried out, and the expanded image edge detection is carried out to obtain the outline of the barcode area.

Then the image is binarized by a gray value calculation formula. After obtaining a standard binarized image, grid sampling is carried out on the symbol, image pixels at each intersection of the grid are sampled, and according to the threshold value, dark "1" or light "0" is determined, so as to obtain the original binary sequence value of the two-dimensional code, and then error correction and decoding are carried out on these data. Finally according to the code of logic coding rules to convert these original data into data.

What do three big black squares do? When we use the mobile phone to scan, no matter what direction, we can correctly identify the content of the two-dimensional code, because the mobile phone through the three big black blocks to identify the correct direction of the two-dimensional code.