An Assessment of Recognition under Scaling, Rotation and Cylindrical Warping Andrei de A. Formiga Steven J. Simske Marcelo Thielo Rafael D. Lins Gary Dispoto HP Brazil R&D, UFPE, Recife, Brazil HP Labs., Palo Alto, USA Porto Alegre, Brazil [email protected] {steven.simske, [email protected] [email protected] gary.dispoto}@hp.com

ABSTRACT 2. THE DATA MATRIX SYMBOLOGY Data Matrix is a 2D barcode with high information density and Bi-dimensional barcode symbologies have higher information wide applicability. When printed in documents or used for density than the more traditional linear barcode representations, labeling products, the barcode may be subject to deformations. and often include more sophisticated error-correcting schemes [3]. This looks at the recognition of Data Matrix is Specified by an international standard [1], Data Matrix is a 2D under scaling, rotation and cylindrical warping. The results barcode with high information density and good error-correcting suggest that the readability of Data Matrix barcodes is immune to capabilities. Data Matrix can encode numerical digits, alphabetic rotation transformations and responds well to scaling, while it is characters and symbols in an efficient manner using selectable more seriously impaired by cylindrical warping. encoding schemes.

Categories and Subject Descriptors A Data Matrix barcode is a collection of square modules, each one I.4.9 [Image Processing and Computer Vision]: Applications. representing a single of information, usually black for a bit with value 1 and white (or the background color) for a 0 bit. The General Terms modules are contained in a frame that contains a finder pattern, Measurement, Documentation, Performance, Reliability, Security. used in scanners to locate the barcode; the finder pattern is the outermost square of modules in the barcode. Data Matrix barcodes Keywords can have different sizes, depending on how much data must be DataMatrix, barcode, image warp, cylindrical warp, barcode encoded, and all Data Matrix codes include error correction. An reading. example of Data Matrix barcode used in the tests reported herein is shown in Figure 1, which contains the phase from the Latin 1. INTRODUCTION poet Virgil: “Libertas quae sera tamen”. Barcodes are widely used for conveying information in compact form, including uses in documents and product labeling. Data Matrix is a 2D barcode which provides high information density and error-correcting capabilities [1]. When used in documents or product , a single Data Matrix barcode may be read under a variety of conditions, some of which may be easily modeled as affine transformations applied to the barcode prior to reading. In this paper, the effects of three classes of transformations on Data Matrix barcode reading recognition are investigated: rotation, scaling (both affine transformations) and cylindrical warping (a non-affine transformation). The tests reported here were Figure 1: “Libertas quae sera tamen” in Data Matrix barcode conducted using libdmtx [2], a software implementation of Data Matrix. The results obtained on the Data Matrix 2D-barcode have shown to be orientation-independent, and thus their readability is 3. EXPERIMENTS PERFORMED not affected by pure rotations. The barcodes are also readable in In order to test the recognition of Data Matrix barcodes in many smaller scales. However, the geometric distortion imposed different conditions, a small set of barcode images was generated, by a cylindrical warping of the barcodes significantly impairs assuming the codes printed over a white, matte background. The their recognition, especially for barcodes occupying a larger area. images span different sizes and data payload types, and were subjected to the transformations of interest: rotation, scaling, and mapping the barcode to a cylindrical surface. Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are Figure 1 shows the smallest of the test images used in the not made or distributed for profit or commercial advantage and that experiment. The largest of the barcodes tested for recognition copies bear this notice and the full citation on the first page. To copy contains the soliloquy from Shakespeare´s Hamlet “To be or not otherwise, or republish, to post on servers or to redistribute to lists, to be…” and comprises 1493 alphanumeric characters. All test requires prior specific permission and/or a fee. images were generated using libdmtx [2] at 72 dots per inch (dpi).

SAC’11, March 21-25, 2011, TaiChung, Taiwan. Figure 2 shows a DataMatrix barcode mapped onto a cylinder. Copyright 2011 ACM 978-1-60558-638-0/10/03…$10.00.

266 allowing to state that Data Matrix is orientation-independent; under scaling and rotation combined, even if the barcode is scaled to half its original size it is still recognizable in most angles. However, for cylindrical warping, the results show a non-linear distortion indicated by a steep growth of the minimum radius with the size of the barcode.

80% 60% Figure 2: Euler’s number, mapped on a cylinder 40% 20% 0% 4. RESULTS AND ANALYSIS Five barcode images were tested under the transformations described in the previous section. Table 1 shows the features of the test images. The first column indicates the content of the barcode in the image, the second column provides the size of the barcode in modules, the third shows the total size of the barcode image in millimeters, the fourth one presents the amount of padding added for each barcode, in bytes, and the fifth and last Scaling factor Recognition rate column exhibits the percentage of error correction in the symbol, in relation to the total payload. Figure 3: Minimum size for 50% or higher recognition rates Table 1. Features of the barcodes generated for testing for the various barcodes (and the associated recognition rate) Contents Modules Total size Padding ECC (mm) (bytes) (%) Table 3. Minimum radius for recognition in warping Libertas… 16x16 45.86 6 43.8 Barcode Size Radius π to 400 digits 52x52 98.78 2 29.3 Libertas… 45.86 mm 27.42 mm Soliloquy (1493 144x144 261.05 65 28.5 π to 400 places 98.78 mm 196.51 mm characters) Soliloquy 261.05 mm 400 cm e to 120 digits 32x32 63.50 0 36.7 e to 120 places 63.50 mm 50.3 mm π to 1400 digits 104x104 190.50 114 29.2 π to 1400 places 190.50 mm 182.3 cm

The results for rotation and scaling are summarized in Figure 3, 6. REFERENCES while the results for cylindrical warping are shown in Table 2. [1] International Standard ISO/IEC 16022 – Information Figure 3 shows the minimum scaling factor that can be applied to Technology – Automatic Identification and Data Capture each of the barcodes to get 50% or better recognition at all angles Techniques – Data Matrix Bar Code Symbology of rotation. As can be seen in the results, most of the barcodes can Specification, 2nd ed. ISO/IEC, 2006. be scaled by 0.5 (a reduction of ¾ in area) and still be recognized in most angles. Table 3 shows the minimum radius of the cylinder [2] libdmtx – Open Source Data Matrix Software. that still allows the barcode mapped onto it to be recognized, http://libdmtx.org/ Retrieved 2009-06-05. along with the barcode size; bigger barcodes have more trouble to [3] Palmer, R. C. The Bar Code – A Comprehensive Guide be recognized, even considering the size proportionality. to Reading, , Specifying, Evaluating, and Using Bar Code and Other Machine-Readable Symbols. 5th edition. 5. CONCLUSION Trafford Publishing, 2007. This paper shows the result of assessing the conditions under [4] M Vans, SJ Simske, JS Aronoff, "Barcode Structural Pre- which Data Matrix barcodes can be recognized. In order to model Compensation Optimization", Proc. NIP25, ISBN/ISSN:978- real world situations but isolating important factors, a group of 0-89208-287-2, Louisville KY, USA, pp.167-169, 2009. barcode images was tested for recognition after transformations of interest that may model conditions in real applications. The [5] A Study on Video Browsing Strategies. Technical Report transformations included scaling, rotation and their combinations. UMIACS-TR-97-40, University of Maryland, College Park, The results show that rotations pose no problems to recognition, MD, 1997

267