A universal algorithm for discretizing bichromatic two-dimensional graphic codes

Cover Page

Cite item

Full Text

Open Access Open Access
Restricted Access Access granted
Restricted Access Subscription Access

Abstract

Mathematical foundations and algorithms for recognizing bichromatic two-dimensional graphic codes, regardless of their type (QR codes, DataMatrix, GridMatrix, etc.) are presented. The stages of achieving the result include detecting the code, localizing it within an arbitrary quadrilateral, transforming the quadrilateral to a canonical square, constructing a grid of elements (modules) of the square code, and filling it with a sequence of bits. It is shown that perspective transformation formulas make it possible to transform localized quadrangular regions to canonical squares with an acceptable error level for further processing. A flat grid of square code elements is formed based on the search for extrema of the derivatives of the pixel intensity distribution of the square image along the axes x and y. The algorithm for filling grid cells (code modules) with a sequence of zeros and ones uses information about the average intensity of each such cell. At the end of the paper, the algorithms are tested on a variety of real images of two-dimensional codes, and the limitations of the proposed algorithms are examined.

Full Text

Restricted Access

About the authors

A. A. Trubitsyn

Ryazan State Radio Engineering University named after V.F. Utkina; Kvantron Group LLC

Author for correspondence.
Email: assur@bk.ru
Russian Federation, 59/1 st. Gagarina, Ryazan, 390005; 28a st. Engelsa, room. H2, Ryazan, 390010

M. V. Shadrin

Kvantron Group LLC

Email: m.shadrin@kvantron.com
Russian Federation, 28a st. Engelsa, room. H2, Ryazan, 390010

S. I. Holkin

LLC “Operator-CRPT”

Email: assur@bk.ru
Russian Federation, 15 Rochdelskaya st., building 16A, premises I, Moscow, 123376

References

  1. Trubitsyn A.A., Shadrin M.V., Serezhin A.A. Localization of image fragments with high frequency intensity oscillation. Journal of Autonomous Intelligence. 2023. V. 6. № 2. P. 1–16.
  2. Trubitsyn A.A., Shadrin M.V. Obnaruzheniye, lokalizatsiya i transformatsiya dvumernogo graficheskogo koda (Detection, localization and transformation of two-dimensional graphics code). GraphiCon 2023: 33rd International Conference on Computer Graphics and Computer Vision, September 19–21, 2023, Institute of Control Problems. V.A. Trapeznikov Russian Academy of Sciences, Moscow, Russia. 2023. P. 509–516.
  3. Karrach L., Pivarciova E. Options to use data matrix codes in production engineering. Management Systems in Production Engineering. 2018. V. 26. № 4. P. 231–236.
  4. Yamaguchi et al. Code type determining method and code boundary detecting method. US Patent 2005/O121520 A1. 09.06.2005.
  5. Szentandrási I., Herout A., Dubská M. Fast detection and recognition of QR codes in high-resolution images. SCCG '12: Proceedings of the 28th Spring Conference on Computer Graphics March. 2013. P. 129–136.
  6. Lin J.A., Fuh C.S. 2D barcode image decoding. Mathematical Problems in Engineering. 2013. 2013: 848276.
  7. Heckbert P.S. Fundamentals of texture mapping and image warping [M.S. thesis]. Department of Electrical Engineering, University of California, Berkeley, Calif, USA. 1989.
  8. Gonzalez R, Rafael R. Digital image processing. NY: Pearson. 2018. 1168 p.
  9. Abramowitz M., Stegun I.A. Handbook of Mathematical Functions: With Formulas, Graphs, and Mathematical Tables. NY: Dover Publications Inc. 1965. 1046 p.
  10. Otsu N.A. Threshold Selection Method from Gray-Level Histograms. IEEE Trans. Sys. Man. Cyber. 1979. V. 9. № 1. P. 62–66.
  11. Koleda P, Hrčková M. Global and Local Thresholding Techniques for Sawdust Analysis. Acta Facultatis Technicae. 2018. Vol XXIII. No 1. P. 33–42.
  12. Trubitsyn A., Grachev E. Switching median filter for suppressing multi-pixel impulse noise. Computer Optics. 2021. V. 45. № 4. P. 580–588.

Supplementary files

Supplementary Files
Action
1. JATS XML
2. Fig. 1. Transformation of a quadrilateral (1ʹ2ʹ3ʹʹ) into a square (1234): (a) diagram of the inverse transformation, (b) diagram of pixel intensity calculation.

Download (103KB)
3. Fig. 2. Transformation of a QR code (a), previously localized by a quadrangle (1234) on the upper face of a cube according to the formulas: (b) – (2), (c) – (3).

Download (247KB)
4. Fig. 3. Transformation and discretization of DataMatrix: (a) – original localized code for processing, (b) – result of transformation of quadrangle (1234) into canonical square, (c) – average modulus of derivative with respect to y of intensity of square code and piecewise linear background, (d) – average modulus of derivative after subtracting piecewise linear background, (d) – overlay of grid with n × n = 24 × 24 cells, (e) – code with binary modules.

Download (312KB)
5. Fig. 4. Processing of two-dimensional codes: (a) – Aztec, (b) – GridMatrix. Top row 1 – original images, middle row 2 – result of detection, localization, transformation into a canonical square and discretization into modules of two-dimensional code, bottom row 3 – result of binarization of code modules (two-dimensional sequence of 0 and 1).

Download (334KB)
6. Fig. 5. Results of a full cycle of low-quality DataMatrix recognition: (a) – original image of the code on a tin can, (b) – code after detection and localization, transformation and discretization, (c) – binarized canonically oriented code.

Download (163KB)
7. Fig. 6. Effect of QR code defocusing: (a) – ideal code and intensity profile of the selected line (σ = 0.49), (b) – defocused code and intensity profile of the selected line (σ = 0.20).

Download (185KB)

Copyright (c) 2024 Russian Academy of Sciences