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.
![](http://media.springernature.com/m312/springer-static/image/art%3A10.1134%2FS0361768824700178/MediaObjects/11086_2024_3857_Fig1_HTML.png)
![](http://media.springernature.com/m312/springer-static/image/art%3A10.1134%2FS0361768824700178/MediaObjects/11086_2024_3857_Fig2_HTML.png)
![](http://media.springernature.com/m312/springer-static/image/art%3A10.1134%2FS0361768824700178/MediaObjects/11086_2024_3857_Fig3_HTML.png)
![](http://media.springernature.com/m312/springer-static/image/art%3A10.1134%2FS0361768824700178/MediaObjects/11086_2024_3857_Fig4_HTML.png)
![](http://media.springernature.com/m312/springer-static/image/art%3A10.1134%2FS0361768824700178/MediaObjects/11086_2024_3857_Fig5_HTML.png)
![](http://media.springernature.com/m312/springer-static/image/art%3A10.1134%2FS0361768824700178/MediaObjects/11086_2024_3857_Fig6_HTML.png)
Similar content being viewed by others
Explore related subjects
Discover the latest articles, news and stories from top researchers in related subjects.REFERENCES
Trubitsyn, A.A., Shadrin, M.V, and Serezhin, A.A., “Localization of image fragments with high frequency intensity oscillation,” J. Autonomous Intell., 2023, vol. 6, no. 2, pp. 1–16.
Trubitsyn, A.A. and Shadrin, M.V, “Detection, localization and transformation of two-dimensional graphics code,” 33rd Int. Conf. on Computer Graphics and Computer Vision, GraphiCon 2023, 2023, Trapeznikov Institute of Control Problems, Russian Academy of Sciences, Moscow, Russia, pp. 509–516.
Karrach, L. and Pivarciova, E., “Options to use data matrix codes in production engineering,” Manag. Syst. Production Eng., 2018, vol. 26, no. 4, pp. 231–236.
Yamaguchi et al., “Code type determining method and code boundary detecting method,” US Patent 2005/O121520 A1, 2005.
Szentandrási, I., Herout, A., and Dubská, M., “Fast detection and recognition of QR codes in high-resolution images, Proc. of the 28th Spring Conference on Computer Graphics, SCCG '12, 2013, pp. 129–136.
Lin, J.A. and Fuh, C.S., “2D barcode image decoding,” Math. Probl. Eng., 2013, p. 848276.
Heckbert, P.S., “Fundamentals of texture mapping and image warping,” M.S. thesis, Department of Electrical Engineering, University of California, Berkeley, Calif, USA. 1989.
Gonzalez, R. and Rafael, R., Digital Image Processing, New York: Pearson, 2018.
Abramowitz, M. and Stegun, I.A., Handbook of Mathematical Functions, New York: Dover, 1965.
Otsu, N., “A. threshold selection method from gray-level histograms,” IEEE Trans. Sys. Man. Cyber. 1979, vol. 9, no. 1, pp. 62–66.
Koleda, P. and Hrčková, M., “Global and local thresholding techniques for sawdust analysis,” Acta Facultatis Technicae. 2018, vol. XXIII, no. 1, pp. 33–42.
Trubitsyn, A. and Grachev, E., “Switching median filter for suppressing multi-pixel impulse noise,”. Comput. Optics, 2021, vol. 45, no. 4, pp 580–588.
Funding
This work was supported by ongoing institutional funding. No additional grants to carry out or direct this particular research were obtained.
Author information
Authors and Affiliations
Corresponding authors
Ethics declarations
The authors declare that they have no conflicts of interest.
Additional information
Translated by A. Klimontovich
Publisher’s Note.
Pleiades Publishing remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.
Rights and permissions
About this article
Cite this article
Trubitsyn, A.A., Shadrin, M.V. & Kholkin, S.I. A Universal Algorithm for Discretizing Bichromatic Two-Dimensional Graphic Codes. Program Comput Soft 50, 366–375 (2024). https://doi.org/10.1134/S0361768824700178
Received:
Revised:
Accepted:
Published:
Issue Date:
DOI: https://doi.org/10.1134/S0361768824700178