vii LIST OF CONTENTS CHAPTERS CHAPTER 1 TITAL PAGE DECLARATION ii DEDICATION iii ACKNOWLEDGEMENTS iv ABSTRACT v ABSTRAK vi TABLE OF CONTENTS vii LIST OF TABLES xi LIST OF FIGURES xii LIST OF ABBREVIATIONS xv LIST OF APPENDICES xvii INTRODUCTION 1 1.1 Overview 1 1.2 Personal Digital Assistant (PDA) 2 1.2.1 Pocket PC 3 1.3 Plam 4 1.4 Smartphones 4 1.5 Camera used with PDA 5 1.6 Windows Mobile 5 1.7 PDA using a camera 6 1.8 Limitation of conventional barcode readers 7 viii CHAPTER 2 1.9 Objective of Project 8 1.10 Scope of Project 8 1.11 Project outline 8 LITERATURE REVIEW 10 2.1 Introduction 10 2.2 A bit of history 11 2.3 Types of Barcodes 11 2.3.1 One Dimensional barcodes 12 2.3.2 Two - Dimensional barcodes 13 2.4 2.5 2.6 CHAPTER 3 The Physical Reader 13 2.4.1 Input Device 14 2.4.2 Decoder 18 2.4.3 Barcode Reading 19 The Barcode Recognition System 21 2.5.1 EAN-13 Barcode Image Recognition 21 2.5.2 Barcode symbologies 21 2.5.3 Barcode Size and Color 22 Encoding Rule of Structure of an EAN barcode 23 2.6.1 The X-dimension 24 2.6.2 Quiet zone 24 2.6.3 Guard bars 25 2.6.4 Right & left hand side digits 26 2.6.5 How to calculate the checksum 27 2.6.6 Encoding 28 2.6.7 Decoding 31 METHODOLOGY 32 3.1 Introduction 32 3.2 Barcode Image Devices 33 ix 3.3 Image Capturing 33 3.4 Barcode processing in PDA 34 3.4.1 35 Searching for barcode image automatically 3.4.2 Identification of the Bars and Spaces 36 3.4.3 Estimating How Correctly the Elements 36 Have Been Identified 3.4.4 3.5 Decoding the Barcode 37 Pre-Processing 38 3.5.1 39 The RGB color model 3.5.2 Gray scaling 40 3.5.3 41 Image Enhancement 3.6 Scanning Direction 42 3.7 Barcode Identification & Extraction 44 3.8 Program Architecture 45 3.8.1 45 Overview of Programming Languages Used For PDA 3.8.2 3.9 CHAPTER 4 Program Build on PDA 46 Program screenshot 46 3.9.1 Program interface 47 3.9.2 Using the HP Photosmart Mobile Camera 48 RESULT 50 4.1 Introduction 50 4.2 Uneven Resolution, Shadow, Shake and 50 Illumination 4.3 Tests of Barcode Orientation 51 4.3.1 52 Computing the orientation of the barcode 4.4 Show scan diagonal read rotated barcode (offline) 53 4.5 Show scan horizontal read rotated (offline) 54 4.6 Show scan vertical read rotated barcode (offline) 54 x 4.7 Show scan horizontal read rotated barcode 55 (online) 4.8 Time Consumption 56 4.9 Performance Comparison 56 CHAPTER 5 CONCLUSION 58 5.1 Conclusion 58 5.2 Recommendations for Future Work 58 REFERENCE 59 APPENDIX 63 xi LIST OF TABLES TABLE TITAL PAGE 2.1 Specification for EAN-13 barcode 22 2.2 Total number of bars and modules for EAN-13 barcode 28 2.3 The list of oriented-modules on logic of 0-9 for A, B, C, 29 types 2.4 Result for example 30 3.1 Normal barcode (left to right) 37 3.2 Flipped or mirrored barcode 38 3.3 These are classes used in program 46 xii LIST OF FIGURES Figure TITAL PAGE 1.1 Symbol barcode 2 1.2 HP iPAQ hx4700 Pocket PC 3 1.3 Palm 4 1.4 Smartphone 4 1.5 Digital camera card (HP Photosmart mobile camera) 5 1.6 Different devices used windows CE 6 1.7 Interfaces for windows CE 6 1.8 PDA build-in camera 7 2.1 A scheme of a bar code reading system 10 2.2 Numeric barcode, 1D 12 2.3 Alphanumeric barcode, 1D 13 2.4 Some types of barcode, 2D 13 2.5 Reader (a), Laser scanner, (b) CCD scanner, (c) CCD 15 sensor by a lens. 2.6 Pen-Type readers 15 2.7 Some cameras can used to read barcode 16 2.8 These are some digital camera card (Photosmart mobile 16 camera) 2.9 The barcode reader with PDA in the shopping 17 2.10 Barcode EAN-13 21 2.11 (a) equivalent EAN-13 barcode, with the first character 22 set to zero, and (b) an EAN-13 with an additional digit used, with the first character set to not zero xiii 2.12 X-dimension barcode 23 2.13 Barcode Structure 24 2.14 Actual size of EAN-13 25 2.15 EAN-13, left and right hand 29 2.16 Barcode EAN-13 Parity Encoding 30 3.1 Architectural Overview: Our EAN-13 barcode and 33 resolution system consists of a PDA using camera and load from file application for decodes barcode 3.2 There are some progress used to read barcode 33 3.3 Image processing in PDA 34 3.4 Some symbols barcode image 35 3.5 Schematic of the RGB color cube 39 3.6 Illustrating difference between a general RGB color 40 image and a general gray scale image. 3.7 Original gray-scale image 40 3.8 A 3x3 window, for use in a windowing function, where 42 the z-values corresponds to the gray-scale values of the original image 3.9 Spatial filters (a) Gaussian Blur, (b) Laplacian (c) 42 Sharpen (d) Unsharpen Mask 3.10 Scan 4 directions implemented 43 3.11 These are some direction of a barcode at different angles, 43 (a) Horizontal (b). Vertical (c) Diagonal (d) invest horizontal 3.12 Illustrating how the barcode's angle µ is derived using the 44 vector displacement, k, the distance d between two vectors, and basic trigonometry. 3.13 Steps to identify and extract the EAN-13 barcodes 44 3.14 program interface 47 3.15 Getting Acquainted 48 xiv 4.1 These are some samples for barcodes image are not clear, 51 all of them (uneven resolution and shake) 4.2 Some types of barcode all of them very clear 51 4.3 Some types of barcode all of them not clear 51 4.4 Shows the output from the localization algorithm. Angle 52 α is the angle of the bar code. The angle is also given by 90 - β 4.5 Rotation 53 4.6 Diagonal (+45, - 45), (a) scan consume operation 53 93ms,(b) scan consume 1482ms, (c) scan consume operation 617ms 4.7 Horizontal, (a) scan consume operation 531ms,(b) scan 54 consume 492ms, (c) scan consume operation 462ms 4.8 Vertical, (a) scan consume operation 435ms,(b) scan 55 consume 336ms, (c) scan consume operation 515ms 4.9 some tests from camera (online), (a) scan consume 55 operation 203ms,(b) scan consume 270ms, (c) scan consume operation 272ms 4.10 compare consume operation 57 xv LIST OF ABREVIATIONS PDA - Personal Digital Assistants GPS - Global Positioning System PC - Personal computer MS - Microsoft RAM - Random access memory CPU - Central processing unit GSM - Gold Standard Multimedia GPRS - General Packet Radio Service CDMA - Code division multiple access WCDMA - Wideband Code Division Multiple Access 3G - 3-Generation SD - Secure Digital MP - Micro Pixel D - One- or Two- Dimensional BMP - Windows Bitmap EAN - European Article Number UPC - Universal Product Code CCD - Charge-Coupled Devices PSA - Personal Shopping Assistant PIM - personal information manager JPEG - Joint Photographic Experts Group RGB - Red, Green and Blue SD - Secure Digital SDIO - Secure Digital Input/Output SDK - Software Development Kit xvi PCB - Printed Circuit Boards CD - Compact Disc; conjugate directions GSM - Groups :Special Mobile or Global System for Mobile SMS - Simplex Minimization Search xvii LIST OF APPENDICES APPENDIX TITAL PAGE A Camera SDIO SDK Specification 63 B Visual Studio 2005 C++ CLASS DECLARATION 70 C Some Types of digital camera card 75 D SOME BARCODE IMAGE ARE VERY CLEAR 79 E SCREENSHOTS OF COMMERCIAL TEST 80 PROGRAMS F Number System (number of countries) 82