Sometimes we try to capture a QR code with a good digital camera on a smartphone, but the reading ends up failing. This usually happens when the QR code itself is of poor image quality or if it has been printed on surfaces that are not flat (distorted or have irregularities of unknown pattern), such as packaging a courier package or a tray of prepared meals.
Today, a team from the University of Barcelona and the Universitat Oberta de Catalunya has designed a methodology that makes it easier to recognize QR codes in physical environments where reading is more complicated. The article is published in the journal Pattern recognition letters.
The new system is completely independent of the underlying topography and is applicable to QR codes that can be found on tubular surfaces (bottles), food trays, etc. This is the first technological proposal capable of combining a general and two-dimensional methodology. barcodes to facilitate recognition of digital information.
The first author of the study is Professor Ismael Benito from the Faculty of Physics and the Department of Electronics and Biomedical Engineering of the UB and the Department of Computer, Multimedia and Telecommunications Studies of the UOC. All authors participated in different positions in the creation of ColorSensing, SL, a UB spin-off company in the field of smart labeling.
Why are some QR codes difficult to read?
QR codes are a variation of the typical barcode, capable of collecting information in computer language (in a two-dimensional matrix of black and white pixels) when scanned with a scanning device. They make it easier to access interesting data, save time and resources such as paper, and have revolutionized the way users access information in the digital domain.
However, it is sometimes difficult to scan a barcode correctly. According to Benito, of UB’s Department of Electronics and Biomedical Engineering and former CTO of ColorSensing, this happens “first of all because of the quality of the image. Even though many people today have access to good digital cameras, they cannot always capture the QR image well.
“Secondly, the printing quality of the QR code and the colors used, with good contrast, are sometimes not satisfactory. Finally, if the printing surface is not flat enough and is not parallel to the capture plane, it is also difficult to capture the information. in the code.”
“For example, all of these factors come into play when trying to capture a QR Bicing with the mobile app: the surface is not flat, it’s a cylinder, and if we try to capture the QR too close, surface deformation becomes evident and reading fails — 5 to 10 centimeters; if we move too far away, the QR becomes too small and the capture is not good — 1 meter if we are in an intermediate range, the apparent distortion of the surface is reduced; and the quality is suitable for capturing it: 30 to 50 centimeters,” explains Benito.
An algorithm that exploits the properties of QR codes
The study, which is part of Ismael Benito’s doctoral thesis at UB, presents a new algorithm that takes advantage of the QR’s own characteristics, i.e. the internal models of the code, to extract the underlying surface on which the code is positioned.
The texture of this surface is recovered by a general adjustment based on mathematical functions called splines, which make it possible to locally adjust the topography of the surface. Benito points out that “these are functions that locally adapt to the ups and downs of the surface and constitute a technique originally widely used in fields such as geology or photo editing to adjust or generate deformations of surfaces “.
There are still many technological challenges to overcome to improve the entire QR code recognition process.
In the case of commercial applications activated by the user’s code reader, the expert explains that “the main challenge is to be able to provide correct and reliable readings. We also work hard to ensure that codes cannot be attacked by modification techniques, for example, with a fake URL that can capture data with small changes to the code.”
“In the case of industry, where captures are made in controlled environments, the main challenge is to reduce the speed of capture,” explains Benito.
More information:
Ismael Benito-Altamirano et al, Reading QR codes on difficult surfaces using thin plate splines, Pattern recognition letters (2024). DOI: 10.1016/j.patrec.2024.06.004
Provided by the University of Barcelona
Quote: New algorithm allows QR codes to be read on uneven surfaces (October 11, 2024) retrieved October 11, 2024 from
This document is subject to copyright. Except for fair use for private study or research purposes, no part may be reproduced without written permission. The content is provided for informational purposes only.