Journal of Electrical and Computer Engineering
Volume 2017 (2017), Article ID 4613628, 15 pages
https://doi.org/10.1155/2017/4613628

Research Article

Binary Large Object-Based Approach for QR Code Detection in Uncontrolled Environments

Omar Lopez-Rincon, Oleg Starostenko, Vicente Alarcon-Aquino, and Juan C. Galan-Hernandez

Department of Computing, Electronics and Mechatronics, University de las Americas Puebla, 72810 San Andrés Cholula, PUE, Mexico

Correspondence should be addressed to Oleg Starostenko; oleg.starostenko@udlap.mx

Received 10 April 2017; Revised 16 June 2017; Accepted 21 June 2017; Published 26 July 2017

Academic Editor: Lei Zhang

Copyright © 2017 Omar Lopez-Rincon et al. This is an open access article distributed under the Creative Commons Attribution License, which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited.

Abstract.

Quick Response QR barcode detection in nonarbitrary environment is still a challenging task despite many existing applications for finding 2D symbols. The main disadvantage of recent applications for QR code detection is a low performance for rotated and distorted single or multiple symbols in images with variable illumination and presence of noise. In this paper, a particular solution for QR code detection in uncontrolled environments is presented. The proposal consists in recognizing geometrical features of QR code using a binary large object- (BLOB-) based algorithm with subsequent iterative filtering QR symbol position detection patterns that do not require complex processing and training of classifiers frequently used for these purposes. The high precision and speed are achieved by adaptive threshold binarization of integral images. In contrast to well-known scanners, which fail to detect QR code with medium to strong blurring, significant nonuniform illumination, considerable symbol deformations, and noising, the proposed technique provides high recognition rate of 80%–100% with a speed compatible to real-time applications. In particular, speed varies from 200 ms to 800 ms per single or multiple QR code detected simultaneously in images with resolution from 640 × 480 to 4080 × 2720, respectively.

1. Introduction

Quick Response (QR) codes are widely used for tracking labeled industrial and commercial products, advertising and marketing, sale of goods, identification of business cards, bank accounts, immigration stamps, post mailing, virtual store, and entertainment and, in general, in many situations, where sharing information about any object is required. With the development of wearable and ubiquitous smartphones, QR code scanners are available anytime and anywhere providing quick high density data storage and retrieval of data, which is based on the arrangement of multiple simple geometric shapes over a fixed space. It is very cheap, reliable, and secure way to include information on objects that can be exploited by augmented and mixed reality systems with low requirements to their computational power. Since February 2015, the QR code is regulated by ISO/IEC 18004:2015 standard clarifying previous 4 standards (1997–2006) and contains detailed information about automatic identification, data capture techniques, and QR symbol specifications of modern versions [1].

It seems that there exists a tacit assumption that problem of QR code detection and recognition is already solved. However, well-known applications still lack high precision, when the QR code is captured in uncontrolled environments frequently under weak and nonuniform illumination, with significant symbol deformation, rotation, occlusion, noising, and distortion due to perspective. Moreover the detection and recognition of QR code become more challenging, when multiple symbols are present on a given scene.

Most of available commercial applications for QR code identification are very efficient in processing only high quality images, sometimes with slight symbol inclination and distortion. Unfortunately, invariance to symbol rotation and scaling is resolved by manual adjustment and framing by the user as well as simultaneous processing of multiple QR codes with low contrast, variable illumination, and significant distortion is still open problems [2–5].

A standard structure of QR code ensures compatibility of the information storage and recognition. In Figure 1, the basic control patterns used for QR code detection are presented. In order to improve performance of QR code scanners, in this paper, a particular attention is given to symbol detection and alignment using primary position detection patterns (PDP) surrounded by separators for position detection patterns (SPDP) [1, 6, 7]. Thus, into QR symbol, the PDP-SPDP patterns situated on its three corners are used for detection of QR code position and orientation in image.

Figure 1: Structure of generic QR code with finding (PDP and SPDP), alignment, and timing patterns.

Alignment and timing pattern are used as marker points in order to identify and scan a QR code. Encoded binary data and error correction codewords as a set of small white and black squares are placed into region depicted in gray for simplicity (see Figure 1).

The main goal of this paper is to improve the most critical processes of single and multiple QR codes identification and alignment in images with variable illumination, presence of noise, and significant distortions of QR symbols. The particular task of QR code content analysis is not considered in this paper. After the position and orientation of QR code is found in image, any standard algorithm may be used for data decoding including if necessary Reed-Solomon error correction [1, 7]. In order to speed up discovering and alignment of QR codes, only three finding patterns will be processed, reducing complexity of detection procedure and providing high precision of identifying multiple QR symbols in images captured in uncontrolled environments. Additionally, the white four-module-wide quiet zone (margin) at all sides of the symbol for its separation from background is not required in the proposed approach.

The rest of the paper is structured as follows. Firstly, an overview of recent advances and trends for QR code detection, processing, and recognition is presented. Then, following the introduced methodology that integrates existing and novel techniques for QR code identification and alignment, a novel approach is proposed and discussed. Based on results obtained in multiple tests with ad hoc designed framework, the assessment of approach functionality and ability to identify single and multiple QR codes in changing ambient conditions is given. Finally, a critical discussion of performance of the proposed approach, its comparison to recently reported methods, contributions, and future works are presented.

2. Modern Techniques for QR Code Detection and Recognition

The basic standard procedure for detecting QR code consists of several steps. It is important to select the more critical steps and analyze existing technical difficulties for accurate QR code detection, alignment, and recognition. This information will be used for novel proposals looking for performance improvement of modern QR code processing tool.

As usual, the first step consists in the mapping intensity of each color pixel to more appropriate array. Therefore, the functions for this mapping include image size normalization, contrast enhancement, noise reduction, pseudocolored gray scale or integral image generation, local or global image feature extraction in space, frequency, or other domains [8–10]. In this step, the selection of particular image preprocessing technique determines the expected complexity of QR code scanner as well as precision and speed of symbol detection and recognition. Because QR code consists of black squares on a white background, the binarization of image captured by code scanner is required for fast symbol processing. This step directly defines accuracy of symbol detection and analysis. Due to the fact that QR processing tool will operate in uncontrolled conditions, the binarization methods must be invariant to changes in illumination and nonsensitive to noise. Although there are many high performance image processing techniques for solution of this problem, modern QR code scanners still fail during detection and interpretation of blurred, low contrast, and significantly uneven illuminated symbols [2, 5, 10–12].

The next step consists in finding the position detection patterns PDP of QR code, symbol alignment, and correction of distortions that in practice are caused by symbol rotation, skewness, slope, or occlusion. Unfortunately, modern commercial applications used for QR code recognition lack automatic detection of rotated symbols (symbol must be manually framed) and they fail when even slight deformations of QR symbol dimensions are presented [13–16]. Solution of this problem is a challenging task that should improve existing equipment for QR code processing. Finally, decoding and visualization of stored in QR code information are provided by using Reed-Solomon error correction procedure that supports accurate data recognition even though 7%, 15%, 25%, or 30% of bits of symbol are damaged [7, 17, 18].

Nowadays, the most widely used approaches for QR code detection and recognition may be subdivided into knowledge-based, feature invariant, template matching, and appearance-based methods. The first group of these approaches includes several methods based on dimensionality reduction, which consider a region of interest as whole entity and try to localize its core components. The use of formalism for knowledge representation and reasoning for solution of complex problems improves accuracy, recall, and increments speed of these methods. Under controlled conditions, they provide good results, but often they are sensitive to rotation and scaling as well as requiring a structured environment [10, 19, 20].

The second group of techniques uses local features of single pixel or small region (color, gradient, gray value, dimensionality, texture, etc.) invariant to alteration of illumination, noise, scale, orientation, and changes in viewing direction providing robust pattern recognition under different conditions. These techniques are known as Scale Invariant Feature Transform (SIFT), Difference of Gaussian Points (DoG), Entropy Based Salient Region detector (EBSR), Harris and SUSAN corner detectors, Intensity Based and Edge Based Regions, Gradient based algorithms, and others. However, the computational complexity of these approaches frequently is too high in real-time applications and, in general, ideal distinctive properties of local features cannot be reached due to the simplicity of features themselves [9, 21, 22].

The template matching techniques involve the evaluation of similarity of predefined template with image regions during translation of template to every possible position in that image. If the correlation between test region and template is large enough, then detector returns an exact position of region of interest within an image with description of shape and orientation similar to template [2, 23]. Various formal metrics are frequently used to find the location of region of interest into image. The most popular quantitative similarity measures are the Sum of Absolute Differences (SAD), the Sum of Squared Difference (SSD), and the Normalized Cross Correlation (NCC). The SAD and SSD do not require complex computation providing fast and simple template searching process. However, for these measures, some factors like tolerance to deformation, robustness against noise, feasibility of template matching during image distortion, and other factors must be taken into account because they are sensitive to occlusions and variations within template. On the other hand, the NCC measure is more accurate and robust for images under nonuniform illumination, but it is much slower than previous approaches in matching process and it requires high computational efforts if exhaustive search is applied [23–25].

Within the group of appearance-based object recognition methods only pattern appearance is used, which is commonly captured by different two-dimensional views of that tested pattern. In some scientific reports the local and global appearance-based approaches are distinguished. The local approaches are used to process regions of interest characterized by corners, edges, and shapes, while the global approaches use color, entropy, moments, and sometimes semantics, which in formal manner may be described by feature descriptors or vectors [26, 27]. The obtained feature vectors are compared to descriptors of previously preprocessed images during recognition and classification processes. In contrast to local approaches, the global approaches transform the whole input image onto a suitable lower dimensional data set that does not require complex and time-consuming processing. Among the global appearance-based approaches the well-known and widely used techniques vary from simple histogram-based statistical ones to more sophisticated dimensionality reduction approaches such as Principle Component Analysis (PCA) or Karhunen-Loève transformation (KLT), Independent Component Analysis (ICA), and Nonnegative Matrix Factorization (NMF). Although, in global methods, the information about image structure can be modeled and processed in more suitable and simple way, the encoding size of dimensional data sets is enlarged considerably and the required iterative training and the evaluation processes limit use of these methods in real-time applications [26, 28, 29].

Taking into account the mentioned classification of modern efficient pattern recognition methods, the following recent and relevant scientific reports for analysis of QR codes are distinguished. One of the common approaches for QR symbol detection is based on analysis of regular component-connected regions in arbitrarily acquired images using intensity of pixel as discriminator for searching particularly, QR position detection patterns (PDPs) [2, 8, 9]. Then each connected region is labeled using geometrical restrictions among detected components finding the presence of three corners with PDPs. For example, Belussi and Hirata in [8] report the achieved detection rate about 90% on a speed compatible with real-time applications.

The accuracy of QR code detection mostly depends on quality of binarization process. In order to provide invariance of binarization to nonuniform illumination, the statistical-decision Otsu’s thresholding method is widely used [13, 30]. For example, Gu and Zhang in [13] proposed fast approach that provides QR symbol detection with its geometric correction of tilt and orientation in images with variable illumination. The recognition rate depends on used binarization and feature extraction techniques. So, using Otsu’s method, the approach achieves 90% of recognition rate with average time about 6 ms, while bimodal histogram method assures recognition rate about 80%. Much slower are code detectors implemented using genetic algorithm with average time about 20 ms and adaptive threshold method required 220 ms [10, 13].

In fact, the approach based on processing image histogram is frequently used for feature extraction. For example, Ciazynski and Fabijanska in [31] propose to exploit correlation between reference and input images of QR code. Firstly, an image is divided into blocks used to build binary map of regions similar and dissimilar to QR code in terms of histogram. Finally, morphological operations are applied to binary map for identifying the QR code in images with different lighting condition, resolution, symbol geometric distortion, and orientation. The achieved recognition rate about 82% and the required average time of 800 ms significantly depend on symbol illumination and orientation.

Some recent methods exploit combination of well-known approaches with the principal purpose to increment recognition rate and processing speed. For instance, Kong in [15] introduces an algorithm for detection of QR symbol with distortion applying perspective correction. High recognition rate of 88.5% is reached using local threshold binarization method with convex hull algorithm for symbol finding and, applying Harris corner detection morphological filtering, the extraction of outline of code is provided with correction of symbol orientation and perspective.

Waghmode and Chhajed in [32] propose interesting solution for treatment of images with low resolution acquired from mobile cameras, where QR code is affected by noise, nonuniform illumination, and distortion. In order to adjust distortions due to perspective, the inverse perspective transformation prior to binarization is applied and then using method of dynamic window is suggested. It provides detection of objects of different sizes and uneven illumination with 100% of recognition rates. Unfortunately, there are no precise specifications of conducted tests for substantiation of such accuracy of QR code detection and recognition.

Due to standard geometry of QR code, the most popular approach for symbol detection is Hough transform [11, 30]. For example, Zhao et al. in [33] propose using Hough transform and Sobel operator to extract edges and find QR code. Next, a space transformation to correct image distortion is applied, achieving precision of recognition about 98.57% with the average time equal to 38 ms. Similarly, the proposal of Chou et al. in [34] consists in localization and segmentation of QR codes with Hough transform, applying then a convolutional neural network used for symbol recognition in images with blur, rotation, and uneven illumination reaching correct detection rate about 95.2%. More similar to the proposed approach, in this paper, it consists of multistage classifier based on Hough transform that improves QR code detection by relying only on the geometry of symbol and its deterministic properties without using complex filters [28]. Its principal advantage is the ability to detect multiple QR codes at random places on arbitrary position and rotation in integral images with correct detection rate at least 95% with average recognition time about 100 ms.

In general, most of mentioned evaluated approaches detect and recognize QR code with sufficiently high accuracy and speed with low impairments in controlled environments. However, they fail with medium to strong blurring, significant nonuniform illumination, symbol deformation, and noising and the simultaneous detection of multiple QR symbols in image is still open problem.

3. Proposed Approach for QR Code Detection

The methodology for designing high efficient QR code detection and recognition approaches is established by definition of necessary technical requirements, using analysis of applicability of evaluated previously pattern recognition methods as well as taking into account the expectations of conceptual and practical contributions. The main objective is to find PDP (position detection pattern) into SPDP (separator for position detection pattern) within QR code in image (see Figure 1) with high speed and precision even though QR symbol may be rotated, partially occluded, distorted (in perspective), or affected by low, nonuniform illumination and noise into uncontrolled environments. The proposed solution consists in generation of regions called binary large objects (BLOBs) of 8 connected pixels. Then BLOB iterative filtering is applied to remove those regions that are not geometrically similar to PDP into SPDP of standard QR code. The proposed approach is described in four steps which are introduced as follows.

Step implies image preprocessing, binarization, and BLOB generation, which then is used for QR code searching according to block diagram presented in Figure 2. The input image is scaled to dimension of 640 × 480 (due to an acceptable compromise between precision and processing speed) and then the summed area table (integral image) is generated in a single pass over gray scale image according to

The summed area table represents image cumulative multidimensional probability distribution functions used for computing some features, for example, local means, variances, or Haar-based characteristics required for detection of particular regions of interest. The advantage of processing integral image is high speed of evaluated pixel intensities over any rectangular area using only four array references that are the corners of that rectangle.

Figure 2: Step : block diagram of algorithm for image preprocessing, binarization, and selection of square BLOBs.

Binarization of a gray scale image is provided according to (2), applying to integral image the adaptive thresholding with a mask of size 13 × 13 appropriate for selected image size of 640 × 480. If the value of evaluated point of integral image is equal or greater than of local mean of values under 13 × 13 mask, the white pixel is generated in this point position; otherwise a pixel is part of black background.

The coefficient restricts the number of white pixels that form connected components (BLOBs). Only 2% of points with the highest values in the integral image have been accepted for generation of relevant BLOBs useful for specific task of QR code detection. Binarization with adaptive thresholding is very efficient for gray scale images with low contrast and weak and uneven illumination as well as presence of noise [35]. Then each region formed by 8 connected white pixels the random color is assigned to a forming image of colored BLOBs. Every BLOB now may be encompassed by the smallest not rotated rectangle defined by upper left and lower right corners. The list of all BLOBs and their corresponding surrounding rectangles is stored in BlobList.

Following procedure is used for filtering BLOBs with surrounding rectangle particularly, similar to square. So, removing rectangles with height/width relation that are not equal to 1 is provided by using BLOB features as density and ratio defined by

Empirically selected limits for Density < 0.25 and for Ratio < 0.15 guarantee that filtered BLOBs will be square connected components possibly similar to QR code PDPs even though these patterns may be rotated or in perspective. In Figure 3, the results of applying the described procedures are shown.

(a)

(b)

(c)

(d)

Figure 3: Partial results of applied algorithm of step 1: (a) original image; (b) binarization with adaptive thresholding; (c) generation of colored BLOBs; (d) filtered square BLOB highlighted by red rectangle.

The last important procedure of step 1 is ordering BLOBs in the final squareBlobList according to increasing distance of particular BLOB centroid (center of rectangle that surrounds a BLOB) from origin of binary image with coordinates .

Step is used to find groups of BLOBs with similar positions of their centroids. Later they will be used to select regions similar to SPDPs that surround searched PDPs in QR code (see Figure 1). A specific order of BLOBs in squareBlobList arranged by increasing distance between BLOB centroid and image origin is used to reduce the number of grouped BLOBs with the similar distance by applying

BLOBs, which have similar position of their centroids, correspond to situation that smaller BLOB lies into bigger BLOB as PDP lies into SPDP in QR code. Equation (4) groups BLOBs with similar centroid and removes single BLOBs. The final procedure of step 2 selects groups of BLOBs with similar centroid position and labels, which is the biggest and the smallest BLOB comparing their width. The BLOBs in group are ordered from the biggest to smallest one. In Figure 4, the block diagram of algorithm for grouping BLOBs with similar centroids is shown.

Figure 4: Step : block diagram of algorithm for searching and grouping square BLOBs with similar positions of their centroids.

Step returns groups of BLOBs with their similar distance from origin; however, now only groups of BLOBs that are surrounded by other ones must be selected. Thus, step 3 is used to found only such groups of BLOBs with similar centroid positions, where the small BLOB is surrounded by one or more BLOBs of bigger size. Solution of this problem in known approaches is done by computing a ratio between black/white/black/white/black sections of red lines that pass through center of finder pattern as shown in Figure 5(a). For any QR code, the proportions between line sections are roughly the same (1 : 1 : 3 : 1 : 1) and do not depend on the angle of line that crosses PDP-SPDP group [7]. Another approach used in Open CV consists in detection of 2D polygons applying ratio theorem and identifying three nested contours of finding patterns of QR code [36]. Then four corners of each polygon are determined by measuring the distance between each point on the perimeter and the center of pattern. In order to speed up PDP recognition process in the proposed algorithm, the dimensions of the biggest BLOB that surrounds the smallest ones are defined by three corners A, B, and C as shown in Figure 5(b). The simplest way to select groups of BLOBs similar to PDP into SPDP is to restrict the area, where smaller BLOBs may be found between horizontal lines with coordinates and and vertical lines with coordinates and of the biggest BLOB.

(a)

(b)

Figure 5: Considerations for selection of BLOB pairs similar to PDP into SPDP: (a) technique used in [7]; (b) technique of the proposed approach.

The algorithm for evaluation of possible displacement of smaller BLOB nested into bigger one defined by coordinates of lines , , , and is presented in Figure 6.

Figure 6: Step : block diagram of algorithm for detecting groups of BLOBs, where inner BLOBs are surrounded by the biggest one.

In order to select pair of two BLOBs similar to PDP into SPDP, the relationship of their widths is evaluated (see Figures 5(b) and 6). Additionally, to assure that inner BLOB is filled and outer surrounding BLOB looks like frame, their Density features are computed as (connected pixels of blob)/(width × height). Finally, the Inner-BlobList (set of found PDPs) is generated.

However, applying the previous 3 steps to image with QR code, more than three nested PDP BLOBs with similar features may be found. Therefore, in step 4, the algorithm presented in Figure 7 filters only three PDP BLOBs required for QR code detection. The features used for filtering are computed by (5) as average size avgSize of each of BLOBs from Inner-BlobList and average of all avgSize gives sizeMean. The idea is to find size deviation of BLOB avgSize with respect to sizeMean with limits defined by geometry of standard QR code. So, the lower limit is taken as the average size of the smallest BLOB minavgSize = minavgSize and the upper limit is an average size of the biggest BLOB maxavgSize = maxavgSize .

Figure 7: Step : block diagram of algorithm for detecting three PDPs in QR code.

If avgSize of BLOB does not lie into the range limited by size deviation shown in algorithm of Figure 7, that BLOB is removed. The resulting PDP-BlobList contains three PDPs ordered by their distances to the origin. In Figure 8, some examples of applying the described steps of the proposed algorithm for PDP detection are presented. It is important to mention that approach detects PDPs invariant to rotation and distortions.

Figure 8: Detection of PDPs of QR code with variable illumination, rotation, and distortion.

In order to detect orientation of QR code based on three detected PDPs, the following procedure is proposed. In contrast to complex techniques used in well-known systems for code detection [7, 10, 14, 16, 36], the length of line segments between centers of PDPs and middle of AB, AC, and BC segments are found as shown in Figure 9(a). The shortest segment (e.g., A-MidBC) indicates that PDP A corresponds to the corner with angle of 90°. Many applications visualize the detected rectangular triangle so, in the designed application for the proposed approach, the detected triangle also is shown providing information about three detected PDPs as depicted in Figures 9(b) and 9(c).

(a)

(b)

(c)

Figure 9: (a) Detection of rectangular triangle; (b) example of detected triangle; (c) detection of multiple QR codes with corresponding triangles connecting three PDPs.

The proposed approach can find several separated QR codes in image even though they are rotated or in perspective. If the QR codes are too close to each other, algorithm may fail to distinguish them. The detailed evaluation of the proposed approach is presented in the next section.

4. Results and Discussion

In order to evaluate the proposed approach, various experiments have been conducted with the designed application (framework), whose graphical user interface is shown in Figure 10. The interface visualizes results of applying the proposed algorithms on each of four steps and it finally shows detected QR code PDPs into SPDPs. In the central part of interface, the results of applying particular steps of the proposed approach are presented. For example, in Figure 10, detected BLOBs after step 3 are depicted and the obtained Inner-BlobList is shown on the right (section BLOB COUNT). Information about input processed image and its features is presented on the left part of interface.

Figure 10: GUI of the designed application for evaluating proposed approach for QR code detection.

For analysis of precision, sensitivity, invariance to variable illumination, pattern rotation, and distortion including images with noise and blurring, particularly six sets of different tests have been conducted on the computer with Core Duo processor of 3.3 GHz with 4 GB of RAM. More than 200 images have been taken from online collections, which frequently are used in scientific reports to generate datasets for tests [2, 37]. Unfortunately, there are no standard databases for homogeneous evaluation of QR code scanning applications with similar previously labeled images. That is why different authors use proper collections of images.

In the first set of tests, the ability of the approach to detect only one complete nondeformed QR code (with size at least of 25 × 25 pixels) in focus in images of at least 70 × 70 pixels with soft constant illumination without rotation and perspective is analyzed. The approach correctly finds and detects 100% of QR codes in images. It is important to mention that approach does not require selection and alignment of QR code with particular frame, where code recognition is provided.

The sensitivity of the approach to detect patterns in images with weak or uneven illumination is defined by efficiency of used adaptive threshold binarization applied to integral images. In Table 1, the results of conducted tests with dataset containing more than 200 images with variable illumination are presented. Each column shows the representative image (generalized sample) for particular class with similar illumination, contrast, rotation, distortion, and other impairments. Additionally, the average QR code detection rate per class in whole dataset is presented.

Table 1: Results of conducted experiments: QR code average detection rates in images with variable illumination.

Weak contrast
Very low contrast
Significant variation of illumination
Nonuniform illumination
Strong nonuniform illumination
Significantly noised image

100%
98%
70%
98%
20%
56%

It can be seen that the ability of approach to detect QR code in image with significant illumination variations is very high. Another advantage of the approach is high recognition rate of QR code with rotation and deformation and in perspective as long as the frames of SPDP have no breaks. In Table 2, some representative examples of tests for evaluation of the approach capability to detect QR codes with distortion are presented.

Table 2: QR code average detection rates in images with rotation, distortion, and blur and in perspective.

Rotated QR code
Rotation and weak distortion
Significant distortion
Strong distortions and lack of focus
In perspective with low slope
In perspective with 45° < slope < 60°

100%
100%
80%
20%
100%
85%

Obviously, the more unexpected advantage of the proposed approach is detection of multiple QR codes simultaneously. In Table 3, the results of tests with images containing multiple QR codes are presented. If codes lie too close one to each other, the approach fails to distinguish them. This is due to the fact that the proposed approach has not been designed for detection of multiple codes. This problem may be solved by surrounding each QR code with corresponding rectangle, which will restrict a list of inner PDPs of each code.

Table 3: QR code average detection rates in images with rotations, distortions, and variable illumination.

Correct detection of multiple codes in high quality images with week distortion
Correct detection of significantly distorted codes but failure for incomplete one
Correct detection of multiple QR codes with variable illumination
Incorrect selection of PDPs from different QR codes
Incorrect interpretation of PDPs that belongs to different QR codes

100%
95%
100%
—
—

As it has been mentioned previously, there is not any standard labeled image database for evaluation of well-known or new applications for QR code detection. However, in order to compare the performance of the proposed approach with modern relevant applications, the following experiments have been carried out. They consist in a comparison of capabilities of the proposed and different commercial applications to detect single or multiple QR codes with rotation, distortion, and variable illumination.

The obtained results are resumed in Table 4, where in the first row the images used in tests are shown. In the 2nd, 3rd, and 4th rows, the results obtained by using commercial QR code scanners are presented. In general, the most applications require manual fitting of rotated QR codes and all of the tested apps cannot resolve QR code with significant distortions or multiple symbols.

Table 4: Results of QR code detection using the proposed and well-known commercial applications.

Rotated

Nonuniform light

Blurred

In perspective

Distorted QR

Multiple QR

Android [16]
No
Yes
Yes
Yes after manual fit
No
Only one symbol per time

iOS [5]
Yes, after manual fit
Yes
No
Yes after manual fit
No
Only one symbol per time

iOS [2]
Yes after manual fit
Yes
Yes
Yes after manual fit
No
Only one symbol per time

Qrafter [14]
Yes, invariant to rotation
Yes
Yes
Yes invariant to rotation
No
Only one symbol per time

Proposed application

Yes

Yes

Yes

Yes

Yes

Yes

Additionally, the time for detection of single or multiple QR codes in images with different dimensions has been evaluated. The obtained results presented in Figure 11 show that the detection time of one QR symbol is in the range of 250–450 ms for images with dimensions from 480 × 420 to 2048 × 1600, respectively. Almost double increment of the detection time (740 ms) is required for images with size 4080 × 2720. The QR code detection time is divided into the time interval for integral image generation, binarization, and PDP detection (about 200 ms) and the time interval for image scaling to dimensions 640 × 480 in step 1 of the proposed approach (which depends on size of original input image). There is no significant difference in detection time between one or more QR symbols. The increment of the time for detecting two, three, or more QR code is about 5% per additional symbol. A designed application based on the proposed approach in average requires 0.5 s for detection of either single or multiple QR symbols that is quite reasonable time for QR code scanners used by human for quick data storage and retrieval.

Figure 11: Required time for detection of single or multiple QR symbols in images with different dimensions.

The proposed binary large object-based algorithm may be useful in many applications, where recognition of geometric patterns is required. For example, 2D geometric patterns may be considered as particular texture that contains 2D grid of easily recognized texture primitives (i.e., PDP in QR code). Using the proposed approach, some experiments have been conducted for association of Microsoft Texture2D resource (set of 2D grid patterns) with 3D models of Microsoft XNA Framework Content Pipeline for generation of 3D scenes as part of developing videogames or generating augmented reality objects [38]. After recognition of a particular pattern, for example, as shown in Figure 12(a) or 12(b), the selected 3D models are associated (see Figures 12(c), 12(d), and 12(e)). The capability of the proposed algorithm to recognize geometric patterns with presence of significant variation of illumination, skewness, rotation, and distortion assures correct association of 3D objects with pattern in different positions.

Figure 12: (a) and (b) diverse 2D geometric patterns; (c), (d) associated Microsoft XNA 3D model with pattern (a); (e) associated Microsoft XNA 3D model with pattern (b) [38].

5. Conclusion

This paper presents some advances for expanding traditional approaches for QR code detection in real-time applications. The conceptual contribution of this paper consists in development of approach for precise and fast recognition of single and multiple QR codes in images captured in uncontrolled environments, where medium to strong blurring and noising, significant nonuniform illumination, and considerable symbol deformations are presented. Taking into account the advantage of fast and low computational complexity of integral image processing, in the proposed approach, the cumulative multidimensional probability distribution functions are used for computing image local features that define particular regions of interest. Due to the binarization defining a quality of image feature extraction, the adaptive thresholding is applied to integral image with low contrast, presence of noise, and weak and uneven illumination, providing very efficient mapping pixel intensities to appropriate one-dimensional array. In order to detect and recognize QR codes under uncontrolled viewing conditions, a binary large objects- (BLOB-) based algorithm is proposed. Generated BLOBs of 8 connected regions of interest in image are filtered by subsequent iterative processes leaving only such patterns that represent standard QR code symbols. This assures the correct QR code detection, even though QR symbol may be rotated, partially occluded, deformed, skewed by perspective, or affected by illumination impairments and noise. Therefore, by the processing local geometrical features of QR code, the proposed approach achieves recognition rate from 80% to 100% for images acquired in diverse uncontrolled environments with either low or very high resolution and a speed of code detection is compatible to real-time applications. The future works are needed to extend the proposed approach and increase speed and precision of QR code detection particularly, when multiple QR symbols have considerable deformations and occlusions into images with significant uneven illumination and noise that frequently occurred in real-time QR code scanning by mobile devices. From practical point of view, the paper contributes the proposed BLOB-based approach for single and multiple QR codes detection, which may be used as promising framework for development of novel high performance systems for recognition of 2D patterns.

Conflicts of Interest

The authors declare that they have no conflicts of interest.

Acknowledgments

This research is partially sponsored by European Grant EU FP7 PEOPLE IRSES: Cloud Computing-Based Advisory Services towards Energy-Efficient Manufacturing Systems.

References

“ISO/IEC, Automatic identification and data capture techniques - QR Code bar code symbology specification, Switzerland, 2015,” https://webstore.ansi.org/Previews/PREVIEW_ISO+IEC+18004-2015.pdf.

L. F. Belussi and S. T. Hirata, “Fast QR code detection in arbitrarily acquired images,” in Proceedings of the IEEE Conference on Graphics, pp. 281–288, Patterns and Images Brazil, 2011, http://ieeexplore.ieee.org/document/6134743/.

K. R. Rajeeva and B. M. Sagar, “Quick response code for fast detection and recognition of information,” International Journal of Emerging Technology and Advanced Engineering, vol. 4, no. 2, pp. 271–275, 2014.

QR Code Scan Reader Best for iPhone (2017), https://itunes.apple.com/us/app/qr-code-scan-reader-best-for-iphone-free/id470245207?mt=8.

Scan Company, QR Code and Barcode Reader (2017), https://itunes.apple.com/us/app/scan/id411206394.

Denso Wave Incorporated, The inventor of QR code, Japan (2017), http://www.qrcode.com/en/index.htm.

U. Sinha and A. I. Shack, Anatomy of a QR code (2017), http://aishack.in/tutorials/scanning-qr-codes-1/.

L. F. Belussi and N. S. Hirata, “Fast component-based QR code detection in arbitrarily acquired images,” Journal of Mathematical Imaging and Vision, vol. 45, no. 3, pp. 277–292, 2013, http://link.springer.com/article/10.1007/s10851-012-0355-x.

I. Pitas, Digital Image Processing Algorithms and Applications, John Wiley & Sons Inc, New York, NY, USA, 2000, http://www.wiley.com/WileyCDA/WileyTitle/productCd-0471377392.html.

A. Singh and P. Singh, “A review: QR codes and its image pre-processing method,” International Journal of Science, Engineering and Technology Research, vol. 5, no. 6, pp. 1955–1960, 2016, http://ijsetr.org/wp-content/uploads/2016/06/IJSETR-VOL-5-ISSUE-6-1955-1960.pdf.

M. Dubská, A. Herout, and J. Havel, “Real-time precise detection of regular grids and matrix codes,” Journal of Real-Time Image Processing, vol. 11, no. 1, pp. 193–200, 2016.

D. Bradley and G. Roth, “Adaptive thresholding using the integral image,” Journal of Graphics Tools, vol. 12, no. 2, pp. 13–21, 2007.

Y. Gu and W. Zhang, “QR code recognition based on image processing,” in Proceedings of the IEEE International Conference on Information Science and Technology, pp. 733–736, China, 2011, http://cvl.ice.cycu.edu.tw/meeting/2012.11.06.pdf.

K. Erkan, Qrafter - QR Code Reader and Generator for iOS (2017), https://itunes.apple.com/us/app/qrafter-qr-code-barcode-reader/id416098700?mt=8&ign-mpt=uo%3D4.

S. Kong, “QR code image correction based on corner detection and convex hull algorithm,” Journal of multimedia, vol. 8, no. 6, pp. 662–668, 2013, https://pdfs.semanticscholar.org/5d4c/4f0f7ec3bd4760f9097aa58dee16b7a16547.pdf.

QR Code Reader Scan Company, Available on iOS, Android, Windows (2017), https://play.google.com/store/apps/details?id=me.scan.android.scan.

L. Li, J. Qiua, J. Lua, and C. C. Chang, “An aesthetic QR code solution based on error correction mechanism,” Journal of Systems and Software, vol. 116, pp. 85–94, 2016, http://msn.iecs.fcu.edu.tw/~ccc/profile/publish/ij_paper/20161115_An%20Aesthetic%20QR%20Code%20Solution%20Based%20on%20Error%20Correction%20Mechanism.pdf.

Y. Chow, W. Susilo, and et. al. Exploiting the, “Exploiting the error correction mechanism in QR codes for secret sharing,” Lecture Notes in Computer Science, vol. 9722, pp. 409–425, 2016, http://ro.uow.edu.au/cgi/viewcontent.cgi?article=6966&context=eispapers.

C. Cruz-Perez, O. Starostenko, V. Alarcon-Aquino, and J. Rodriguez-Asomoza, “Automatic image annotation for description of Urban and outdoor scenes,” Lecture Notes in Electrical Engineering, vol. 313, pp. 139–147, 2015.

R. J. Gil and M. J. Martin-Bautista, “A novel integrated knowledge support system based on ontology learning: Model specification and a case study,” Journal Knowledge-Based Systemsvol, vol. 36, pp. 340–352, 2012.

A. C. Deshmukh, P. R. Gaikwad, and M. P. Patil, “A comparative study of feature detection methods,” International Journal of Electronic and Electrical Engineering (IJEEE), vol. 4, no. 2, pp. 1–7, 2015, http://ijeetc.com/ijeetcadmin/upload/IJEETC_5524b6e0c6527.pdf.

O. Starostenko, C. Cruz-Perez, F. Uceda-Ponga, and V. Alarcon-Aquino, “Breaking text-based CAPTCHAs with variable word and character orientation,” Pattern Recognition, vol. 48, no. 4, pp. 1097–1108, 2015.

A. Mahmood and S. Khan, “Correlation coefficient based fast template matching through partial elimination,” IEEE Transactions on Image Processing, vol. 21, Article ID 2171696, pp. 2099–2108, 2012, http://dx.doi.org/10.1109/TIP.2011.2171696.

Y. M. Fouda, “A robust template matching algorithm based on reducing dimensions,” Journal of Signal and Information Processing, vol. 6, no. 2015, pp. 109–122, 2015, http://dx.doi.org/10.4236/jsip.2015.62011.

S. Sharma, “Template matching approach for face recognition system,” International Journal of Signal Processing Systems, vol. 1, no. 2, pp. 284–289, 2013, http://www.ijsps.com/uploadfile/2013/1204/20131204100316597.pdf.

J. Rivera-Rubio, I. Alexiou, and A. A. Bharath, “Appearance-based indoor localization: A comparison of patch descriptor performance,” Pattern Recognition Letters, vol. 66, pp. 109–117, 2015.

P. M. Roth and M. Winter, “Survey of appearance-based methods for object recognition,” Tech. Rep. ICG–TR–01/08 Graz, 2008, http://machinelearning.wustl.edu/uploads/Main/appearance_based_methods.pdf.

I. Szentandrási, A. Herout, and M. Dubská, “Fast detection and recognition of QR codes in high-resolution images,” in Proceedings of the 28th Spring Conference on Computer Graphics, SCCG 2012, pp. 129–136, Budmerice, Slovakia, May 2012.

X. Liu, X. Tan, and S. Chen, “Eyes closeness detection using appearance based methods,” IFIP Advances in Information and Communication Technology, vol. 385, pp. 398–408, 2012.

X. P. Hu, Q. Dong, and Z. Yu, “QR code recognition based on image processing,” Aeronautical Computing Technique, vol. 3, no. 7, pp. 99–102, 2007.

K. Ciazynski and A. Fabijanska, “Detection of QR-codes in digital images based on histogram similarity,” Image Processing & Communications, vol. 20, no. 2, pp. 41–48, 2015, https://www.degruyter.com/downloadpdf/j/ipc.2015.20.issue-2/ipc-2015-0033/ipc-2015-0033.xml.

S. R. Waghmode and G. J. Chhajed, “Barcode detection from barcode images captured by mobile phones: an android application,” International Journal on Recent and Innovation Trends in Computing and Communication, vol. 2, no. 4, pp. 814–819, 2014, http://www.ijritcc.org/download/Barcode%20Detection%20of%20Barcode%20Images%20Captured%20by%20Mobile%20Phones%20Android%20application.pdf.

J. Zhao, H. W. Wang, S. Liu, N. Zhang, and J. Jia, “Research on QR code black line and white line defect detection algorithm,” Applied Mechanics and Materials, vol. 571-572, pp. 764–767, 2014.

T.-H. Chou, C.-S. Ho, and Y.-F. Kuo, “QR code detection using convolutional neural networks,” in Proceedings of the International Conference on Advanced Robotics and Intelligent Systems, ARIS 2015, Taipei, Taiwan, May 2015.

E. Tapia, “A note on the computation of high-dimensional integral images,” Pattern Recognition Letters, vol. 32, no. 2, pp. 197–201, 2011.

CV. OPEN, QR code detection and extraction (2014), http://dsynflo.blogspot.mx/2014/10/opencv-qr-code-detection-and-extraction.html.

QR code collection (2017), http://www.flickr.com.

Microsoft XNA Game Studio 3.1, Tutorial 1: Displaying a 3D Model on the Screen (2017), https://msdn.microsoft.com/en-us/library/bb197293(v=xnagamestudio.31).aspx.