10/11/24 · Technology

A method to help read QR codes on irregular surfaces has been devised

Researchers at the UOC and the University of Barcelona have found a mathematical solution to help read these two-dimensional codes on irregular surfaces such as delivery parcels or food packaging

The researchers have published a technological solution to read digital data by combining a general-purpose method with 2D barcodes
QR on a bicycle

This open-access research is part of the doctoral thesis of researcher Ismael Benito (photo: Adobe)

Despite the good digital cameras on smartphones, attempts to read QR codes sometimes fail. This is usually because the image is of poor quality or the QR code has been printed on a non-flat surface – one that is distorted or seemingly random in shape – such as a delivery parcel or food packaging. A team of researchers at the UOC (Universitat Oberta de Catalunya) and the UB (University of Barcelona) have designed a method to help read QR codes in more challenging physical environments.

It is a general-purpose method that does not fully rely on the underlying topography and can be used for QR codes on tube-shaped surfaces (bottles), food packaging, etc. This is the first technological solution to combine a general-purpose method with 2D barcodes to help read digital information.

“Currently, an insufficiently flat surface that is not parallel to the plane of capture will also make the code harder to read”

The first author of the study, which has been published in open access in the journal Pattern Recognition Letters, is Ismael Benito, a professor and researcher at the UOC's Faculty of Computer Science, Multimedia and Telecommunications and the UB's Faculty of Physics and Department of Electronics and Biomedical Engineering. He was assisted, as co-authors, by the researchers Cristian Fàbrega, Joan Daniel Prades, Hanna Lizarzaburo-Aguilar and David Martínez-Carpena, also from the UB and its smart labelling spin-off ColorSensing S.L.

 

Why are some QR codes hard to read?

QR (Quick Response) codes are a variation on traditional barcodes that are able to encode information in computer language in a 2D matrix of black and white pixels that can then be read by scanning them with a reading device. They provide easier access to useful data, saving time and resources (such as paper), and have transformed the way digital information is obtained.

However, barcodes can sometimes be difficult to scan "due to poor image quality, which is why, even though many people now have good digital cameras, it's not always possible to get a good scan of a QR code. Secondly, the quality of the printing or the colours used (good contrast is needed) is not always satisfactory. Finally, an insufficiently flat surface that is not parallel to the plane of capture will also make the code harder to read," said the researcher, who is also affiliated with the Artificial Intelligence for Human Well-being (AIWELL) group at the eHealth Center.

"For example, all these factors come into play if you try to read a Bicing (Barcelona's public bicycle rental service) QR code using the service's mobile app: The code is on a surface that is not flat, it's cylindrical. If you try to read it from close up, e.g. 5-10 cm, the shape of the surface will cause the reading attempt to fail. If you try from too far away, e.g. 1 m, the code becomes too small to read. If you hold your phone from a middle distance, e.g. 30-50 cm, the surface appears less distorted and the QR code can be read."

 

An algorithm that takes advantage of QR codes' properties

The project, which is part of Ismael Benito's doctoral thesis, presents a new algorithm that uses QR codes' own features (i.e. their internal patterns) to extract the underlying surface on which they have been placed.

The "texture" of this surface is recovered by means of a general-purpose adjustment based on splines, a set of mathematical functions that enable the topography of the surface to be adjusted on a local scale. "These functions 'adapt' locally to the surface's lowest and highest points, using a technique that was originally widely used in fields such as geology and photographic editing to adjust or create deformations on surfaces," said the researcher.

There are still many technological challenges when it comes to improving the QR code reading process. In the case of commercial applications in which users have their own reading devices, "the main challenge is to provide accurate and reliable readings. Extensive work to protect codes from attack by means of modification techniques (such as using a fake URL that can read data by making small changes to the code) is also being carried out. As for industrial uses, where QR codes are read in controlled environments, the main challenge is to slow down reading," said the expert.

 

This research by the UOC and the UB promotes sustainable development goal (SDG) 9: Build resilient infrastructure, promote sustainable industrialization and foster innovation.

Reference article

Benito, Ismael;  Martínez, David;  Lizarzaburu, Hanna; Fàbrega, Cristian; Prades, J. Daniel, "Reading QR Codes on challenging surfaces using thin-plate splines". Pattern Recognition Letters, June 2024. DOI: 10.1016/j.patrec.2024.06.004

 

UOC R&I

The UOC's research and innovation (R&I) is helping overcome pressing challenges faced by global societies in the 21st century by studying interactions between technology and human & social sciences with a specific focus on the network society, e-learning and e-health.

Over 500 researchers and more than 50 research groups work in the UOC's seven faculties, its eLearning Research programme and its two research centres: the Internet Interdisciplinary Institute (IN3) and the eHealth Center (eHC).

The university also develops online learning innovations at its eLearning Innovation Center (eLinC), as well as UOC community entrepreneurship and knowledge transfer via the Hubbik platform.

Open knowledge and the goals of the United Nations 2030 Agenda for Sustainable Development serve as strategic pillars for the UOC's teaching, research and innovation. More information: research.uoc.edu.

Experts UOC

Press contact

You may also be interested in…

Most popular

See more on Technology