vii LIST OF CONTENTS CHAPTER CONTENT PAGE DECLARATION DEDICATION ACKNOWLEDGEMENTS ABSTRACT ABSTRAK LIST OF CONTENTS LIST OF TABLES LIST OF FIGURES LIST OF NOTATIONS LIST OF ABBREVIATIONS LIST OF APPENDICES ii iii iv v vi vii x xi xiv xv xvi CHAPTER I INTRODUCTION 1 1.1 Introduction 1 1.2 Limitations of Conventional Barcode Readers 3 1.3 Objectives 5 1.4 Scope of Project 5 1.5 Project Outline 6
CHAPTER II REVIEW OF LITERATURE STUDIES 8 viii 2.1 Introduction 8 2.2 Barcode Readers 8 2.3 Vision Based Barcode Readers 10 2.3.1 Barcode Localization 10 2.3.2 Barcode Reading 12 2.4 The Anatomy of EAN-13 and UPC-A 13 2.4.1 Barcode Size and Color 15 2.4.2 Barcode Structure 16 2.4.3 Encoding 18 2.4.4 Check Digit Calculation 20 2.5.5 Decoding 21 CHAPTER II I THEORETICAL BACKGROUND 22 3.1 Introduction 22 3.2 Imaging Devices 22 3.2.1 Field of View & Angle of View 23 3.2.2 Resolution 28 3.2.3 Depth of View 29 3.2.4 Lighting 34 3.2.5 Distortion 37 3.2.5 Blurring & Motion Tearing 38 CHAPTER IV ALGORITHMS & IMPLEMENTATIONS 40 4.1 Introduction 40 4.2 Overall System Design 40 4.3 Preprocessing 41 4.3.1 Grayscaling 42 4.3.2 Filtering 43
ix 4.3.3 Thresholding 44 4.4 Decoding 48 4.4.1 Scanning 48 4.4.2 Barcode Identification & Extraction 50 4.4.3 Decoding 54 4.5 Height Extraction Algorithm 60 4.6 Program Architecture 62 CHAPTER V RESULT 75 5.1 Introduction 75 5.2 Uneven Illumination, Shadow and Glare 75 5.3 Barcode Orientation 78 5.4 Tests on Various Object Shapes 79 5.5 Multiple Barcodes in a Scene 82 5.6 Product Comparison 82 5.6.1 Recognition Rate/Accuracy 84 5.6.2 Performance Comparison 86 5.7 Discussion 88 CHAPTER VI CONCLUSION & SUMMARY 90 6.1 Summary 90 6.2 Conclusion 90 6.3 Recommendations for Future Work 91 REFERENCES 93 APPENDIX 97
x LIST OF TABLES TABLE TITLE PAGE 2.1 Specification for EAN-13 & UPC-A barcodes 15 2.2 Parity encoding table 20 2.3 Character encoding table 20 3.1 Approximation of FoV for various CCD sizes 27 3.2 Type of illumination for different application requirements 35 4.1 The normalization and rounding process 56 4.2 Normal barcode (left to right) 57 4.3 Flipped or mirrored barcode 57 4.4 Height extraction reference table 61 5.1 Feature comparison 83 5.2 Test of accuracy 84-85
xi LIST OF FIGURES FIGURE TITLE PAGE 1.1 Common one-dimensional barcodes 2 1.2 Two-dimensional barcodes, (a) 3-DI and (b) Array Tag, (c) 3 PDF417, (d) Data Matrix, (e) MaxiCode and (f) Aztec Code 2.1 Shows different types of barcode readers, (a) a Pen-type reader, 9 (b) a Laser scanner and (c) a CCD scanner 2.2 (a) UPC-A barcode, (b) equivalent EAN-13 barcode, with the 14 first character set to zero, and (c) an EAN-13 with an additional digit used 2.3 Actual sizes of EAN-13/UPC-A barcodes 16 2.4 Encoding the number 5 19 3.1 Comparison of AoV between a 25mm and a 35mm camera lens 24 3.2 Projection of AoV and FoV in the horizontal and vertical 24 directions 3.3 Projection of FoV at a distance of do 25 3.4 FoV for a (a) 35mm lens, (b) 25mm lens shows the amount of 26 information can be captured 3.5 Aspect ratio of various industry standard CCD sensors 27 3.6 Nothing smaller than the physical size of two pixels can be 30 resolved. 3.7 DoV is larger when the aperture opening is small (large f-stop) 31 3.8 DoV can be increased by adjusting the aperture 32 3.9 Insufficient DoV will cause barcodes with odd placement 33 unreadable 3.10 DoV at various object-to-lens distances for 35mm and 25mm camera lens at f/1.3, f/2 and f/4 34
xii 3.11 Barcode inspection under (a) highly directional light source and 36 (b) diffuse lighting [20] 3.12 (a) Directional lighting, (b) diffuse lighting, (c) ring guide and 37 (d) diffuse axial lighting 3.13 Radial distortion on the KPC-S38CZV camera 38 3.14 Motion tear 39 4.1 Block diagram of project 41 4.2 Spatial filters (a) Gaussian Blur, (b)laplacian (c) Sharpen (d) 43 Unsharpen Mask 4.3 (a) Global, (b) segmented, (c) local (Chow & Kanenko), (d) and 45 (e) algorithmic adaptive thresholding based on variance [23] 4.4 (a) Actual gray-level image, (b) manually selected global 47 threshold of 114, (c) global heuristic threshold, (d) local neighborhood of 5x5 with max-min threshold (e) local neighborhood (max-min) of 5x5 and Tg=3, (f) segment (heuristic) of 10x10 (g) segment (heuristic) of 10x10 with Tg=12 (h) algorithmic adaptive thresholding based on variance 4.5 Execution time of different thresholding methods on a 512x512 48 gray-level image 4.6 Scan directions implemented 49 4.7 Skewed barcodes at different angles, where it is picked up by 50 several scan lines (a) horizontal and diagonal, (b) diagonal (c) vertical scan lines. 4.8 Steps to identify and extract the UPC-A and EAN-13 barcodes 51 4.9 Predictive decoding tree for character determination 59 4.10 Predictive tree to determine the symbology and the 1st character 59 4.11 Performance comparison between predictive and exhaustive 60 decoding 4.12 Height extraction state machine 61 4.13 Comparison between SISD and SIMD (MMX) architectures 63 4.14 Program screenshot 64 4.15 Program flowchart 66 4.16 Barcode detection process 67
xiii 4.17 Scanning algorithm 68 4.18 Quiet zone detection algorithm 69 4.19 Algorithm for guard bars detection 70 4.20 Checking the equality of the guard bars 71 4.21 Algorithm for obtaining the height and width of a bar 71 4.22 Algorithm for obtaining all the remaining bars of the EAN-13 72 and UPC-A symbologies 4.23 The normalization process 73 4.24 The error detection and correction process 74 5.1 Shows how adaptive local thresholding is capable of 76 successfully thresholding an image which is affected by severe uneven illumination; (a) actual image affected by uneven illumination, (b) global thresholding, (c) local thresholding 5.2 Glare and shadowing on a specular surface 77 5.3 Elimination of glare through local thresholding; (a) glare 78 affected region of a barcode, (b) missing bars due to global thresholding, (c) local thresholding able to recover missing bars (d) successful decoding process 5.4 Barcodes at different orientation (angle) 79 5.5 Barcode orientation on (a) flat surfaces, (b) along the 80 circumference of a cylinder or curved object, (c) along the axis of a cylinder, and (d) on irregular surfaces 5.6 Barcodes on flat surfaces 80 5.7 Barcodes on the circumference of cylinders 81 5.8 Barcodes along the axis of cylinders 81 5.9 Barcodes on irregular surfaces 81 5.10 Successful detection of multiple barcodes in one scene 82 5.11 Recognition accuracy 86 5.12 Decoding time for a 512x512px color image 87 5.13 The importance of optimal thresholding 89
xiv LIST OF NOTATIONS a c d i d o f H h ccd h i h o T T g T o w ccd w i w o θ h θ w Lens aperture (f-stop) Diameter of circle of confusion. Distance from the image plane to the optical center of the lens Distance from the object plane to the optical center of the lens Focal length Hyperfocal distance Height of CCD in pixels Height of image in millimeters Height of object in millimeters Threshold value Global threshold value Threshold Convergence factor Width of CCD in pixels Width of image in millimeters Width of the object in millimeters Vertical angle of view Horizontal angle of view
xv LIST OF ABREVIATIONS AoV BMP BPNN CCD CMOS CoC DoV EAN FF FoV FPS ISBN LUT MLP MMX NF PCI PDA px RBF RGBA SIMD SSE UPC Angle of View Windows Bitmap Back Propagation Neural Network Charge-Coupled Device Complementary Metal Oxide Semi-Conductor Circle of Confusion Depth of View European Article Number Far-Field Field of View Frames per Second International Standard Book Number Look-up Table Multi Layer Perceptron MultiMedia extension Near-Field Peripheral Component Interface Personal Digital Assistant Pixel Radial Basis Function Red-Green- Blue-Alpha Single Instruction Multiple Data Streaming SIMD Extensions Universal Product Code
xvi LIST OF APPENDICES APPENDIX TITLE PAGE A System Specification 97 B Scan Profiles 99 C C++ Class Declaration 100 D Test Images 110 E Results 112 F Screenshots of Commercial Test Programs 117