Transcript
Page 1: i COMPUTER VISION BASED BARCODE READER FOR HALAL

i

COMPUTER VISION BASED BARCODE READER FOR HALAL JAKIM

VERIFICATION SYSTEM

MOHD NIZAR BIN ZAINUN

This Report Is Submitted In Partial Fulfillment of Requirements For

The Bachelor Degree in Electronic Engineering (Computer Engineering)

Fakulti Kejuruteraan Elektronik dan Kejuruteraan Komputer

Universiti Teknikal Malaysia Melaka

June 2014

Page 2: i COMPUTER VISION BASED BARCODE READER FOR HALAL

ii

Page 3: i COMPUTER VISION BASED BARCODE READER FOR HALAL

iii

“Saya akui laporan ini adalah hasil kerja saya sendiri kecuali ringkasan dan petikan yang

tiap-tiap satunya telah saya jelaskan sumbernya.”

Tandatangan : ………………………………………..

Nama Penulis : MOHD NIZAR BIN ZAINUN

Tarikh : 6 JUNE 2014

Page 4: i COMPUTER VISION BASED BARCODE READER FOR HALAL

iv

“Saya/kami akui bahawa saya telah membaca karya ini pada pandangan saya/kami karya

ini adalah memadai dari skop dan kualiti untuk tujuan penganugerahan Ijazah Sarjana

Muda Kejuruteraan Elektronik (Elektronik Komputer).”

Tandatangan : ……………………………………………...

Nama Penyelia : NORHASHIMAH BINTI MOHD SAAD

Tarikh : 6 JUNE 2014

Page 5: i COMPUTER VISION BASED BARCODE READER FOR HALAL

v

To my beloved parents Zainun Barahim and Maimunah Chin, my family and all my

fellow friends.

Page 6: i COMPUTER VISION BASED BARCODE READER FOR HALAL

vi

ACKNOWLEDGEMENT

Alhamdullillah, firstl I am grateful to Allah S.W.T because with His blessing, at

last I have finished my Projek Sarjana Muda 2 (PSM 2) together with my thesis without

any problem. To my beloved parent, Zainun Bin Barahim and Maimunah Binti Chin

and the entire of my family members, thank you very much for all of their moral support

during the entire of my learning journey in UTeM.

To my supervisor, Norhashimah bte Mohd Saad for her guidance, advices and

her ideas during my PSM session thus making me improve my knowledge, thank you

very much. To all of my friends that helping me out together with their moral

support. Finally, to all individuals who involved in this PSM 2 which I have not

mentions their name. Without all of you, this report will never finished succesfully.

Thank you.

Page 7: i COMPUTER VISION BASED BARCODE READER FOR HALAL

vii

ABSTRACT

At present, many people are looking for applications that can facilitate and

launch their daily life. The industry technology began to pay more attention to barcode

application for domestic users need. This thesis describes an android application for

Muslims to identify the Halal Status (prepared in accordance to Islamic law) of the

product. The barcode images is need for preprocessing in order to extract the barcode

into the database and also barcode recognition process. A Computer Vision Based

Barcode Reader For Halal Jakim Verification System is a low cost barcode reader,

which is develop by using Android developer. Barcode are a class of the simplest printed

patterns that can be reliably recognize by a computer vision or an any operating system.

These codes consist of sequence of parallel, light and dark stripes printed on papers.

This is a real time application that requires high processing time. This is the main reason

for using the language JAVA for the development this project.The objective is supported

by several sub-objectives, namely to gain knowledge of Java Eclipse, Android versions

and able the development of an algorithm for Smartphone on Android. This project

consists of analysis, scematic design, system development and testing. The purpose is to

determine the basic flow and system testing of the barcode scanner. The halal jakim

database is also develop in this system. In conclusion, a new system for Halal status

checking was develop for new android application.

Page 8: i COMPUTER VISION BASED BARCODE READER FOR HALAL

viii

ABSTRAK

Pada masa kini, ramai orang yang mencari aplikasi yang dapat memudahkan dan

melancarkan kehidupan harian mereka. Teknologi industri mula menumpukan aplikasi

barcode. Tesis ini menerangkan applikasi android untuk umat Islam mengenalpasti

status Halal (sesuai dengan undang-undang Islam) sesuatu produk. Gambar kod bar

digunakan untuk teknik preprocessing untuk mengekstrak kod bar tersebut ke dalam

pengkalan data dan proses pengecaman. Sistem Visual Komputer Berdasarkan Pembaca

kod bar untuk Pengesahan Status Halal Jakim merupakan sistem kos rendah yang dibina

menggunakan pembina android. Kod bar adalah bahan yang paling mudah dicetak oleh

komputer atau mana-mana sistem operasi. Kod-kod ini terdiri dari rangkaian selari,

garis-garis terang dan gelap dicetak di atas kertas. Ini adalah aplikasi masa nyata dan

memerlukan masa proses yang tinggi. Sistem ini menggunakan perisian JAVA dalam

melaksanakan projek ini. Objektif disokong oleh beberapa sub-objektif, iaitu menimba

ilmu mengenai Java Eclips,versi android dan algorithma untuk Android. Projek ini

terdiri daripada analisis, reka bentuk skematik, pembangunan system dan ujian.

Tujuannya adalah untuk menentukan aliran dan sistem ujian asas pengimbas kod bar.

Pengkalan data halal JAKIM juga dibina di dalam sistem. Kesimpulannya, system baru

untuk semakan status halal telah dilaksanakan.

Page 9: i COMPUTER VISION BASED BARCODE READER FOR HALAL

ix

CONTENTS

CONTENT TITLE PAGES

PROJECT TITLE i

DECLARATION ii

DEDICATION v

ACKNOWLEDGEMENT vi

ABSTRACT vii

ABSTRAK viii

CONTENTS ix

LIST OF TABLE xiii

LIST OF FIGURES xiv

LIST OF ABBREVIATION xvi

I INTRODUCTION 1

1.1 Project Background 1

1.2 Problem Statement 2

1.3 Objective 3

1.4 Scope of Project 3

1.5 Methodology of Project 3

1.6 Thesis Organization 4

Page 10: i COMPUTER VISION BASED BARCODE READER FOR HALAL

x

II LITERATURE REVIEW 5

2.1 Introduction 5

2.2 Catogories of Barcodes 7

2.2.1 One Dimensional Barcodes 7

2.2.2 Two Dimensional Barcodes 13

2.3 Available System For Halal Checking in Malaysia 14

2.4 Platform For Barcode Scanner 15

2.5 JAVA Language 16

2.6 JAVA Development Platform 17

III METHODOLOGY 18

3.1 Overview 18

3.2 Analysis 19

3.2.1 Research and Side Visit 19

3.2.2 Observation 20

3.2.3 View Existing Documentation 20

3.3 Scematic Design 20

3.3.1 Android Manifest.xml 21

3.3.2 Activity 22

3.3.3 Intent 23

3.3.4 SQLite Database 24

3.4 System Development 25

3.4.1 Development Tools 26

3.4.1.1 Adope Flash Builder 4.6 26

3.4.1.2 Eclipse IDE for Java Developers 27

3.4.1.3 Install ADT Plug-in and Android SDK 28

3.4.1.4 Manual Installation of the Android SDK 30

3.4.2 Main Screen Activity 32

Page 11: i COMPUTER VISION BASED BARCODE READER FOR HALAL

xi

3.4.3 Scan Barcode Activity 33

3.4.4 Halal Status Activity 35

3.4.4.1 Add Detail Database 35

3.4.4.2 Database Handler 35

3.4.4.3 Read Database 36

3.4.5 Link to Web Pages Activity 36

3.5 System Testing 37

3.5.1 Testing Approach 38

3.5.1.1 Functional Test 38

3.5.1.2 Unit Testing 38

3.5.1.3 Integration Testing 38

IV RESULT AND DISCUSSION 39

4.1 Overview 39

4.1.1 Use Case Diagram 40

4.1.2 Sequence Diagram 41

4.2 Graphical User Interface (GUI) 42

4.2.1 Function Button 42

4.2.1.1 Scan Barcode Button 43

4.2.1.2 Halal Status Button 44

4.2.1.3 Hyperlink Button 45

4.3 Analysis Result 46

4.3.1 Analysis Scanner To Different Condition 46

4.3.2 Performance Analysis 50

Page 12: i COMPUTER VISION BASED BARCODE READER FOR HALAL

xii

V CONCLUSION AND RECOMMENDATION 51

5.1 Overview 51

5.2 Recommendation 53

5.2.1 Develop with online database storage 53

5.2.2 Compatible with all Android version 53

5.2.3 Compatible with other OS 53

REFERENCES 54

Page 13: i COMPUTER VISION BASED BARCODE READER FOR HALAL

xiii

LIST OF TABLE

NO TITLE PAGE

4.1 Comparison barcode scanned (full images) 46

4.2 Comparison barcode scanned (upper part masked) 47

4.3 Comparison barcode scanned (bottom part masked) 48

4.4 Over Light Condition 49

Page 14: i COMPUTER VISION BASED BARCODE READER FOR HALAL

xiv

LIST OF FIGURES

NO TITLE PAGE

2.1 The European Article Numbering (EAN)-13 barcode 6

2.2 Code 39 8

2.3 Code 93 8

2.4 Code 128 9

2.5 EAN 13 9

2.6 EAN 14 10

2.7 Codabar 11

2.8 UPC (Universal Product Code) 11

2.9 Application in Google Store 14

2.10 Barcode scanner 15

2.11 Barcode pen-scanners 15

3.1 Waterfall model used for this project 19

3.2 Manifest file 21

3.3 Method which loads the view of the xml 22

3.4 Intent Object 23

3.5 Database Management Systems 24

3.6 SQLite database code 25

3.7 Adope Flash Builder 4.6 26

3.8 Eclipse Java used for create this project 27

3.9 Configure for SDK 28

3.10 Contribute usage statistics 29

Page 15: i COMPUTER VISION BASED BARCODE READER FOR HALAL

xv

3.11 Install packages 29

3.12 Android Preferences 30

3.13 SDK Manager to Install Packages 31

3.14 SDK manager download 31

3.15 Main Screen Applications 32

3.16 Code for Each Button 33

3.17 Code for Connect class of Intengrator.java 34

3.18 Code for Connect IntenResult.java 34

3.19 Add Detail Database 35

3.20 Internet Manifest Code 36

3.21 Code in MainActivity.java 36

4.1 Perspective when application running 40

4.2 Consecutive action during usual application run 41

4.3 Main Screen Interface 42

4.4 Function of Scan Button 43

4.5 Function for Halal Status Button 44

4.7 Function for www.halal.gov.my Button 45

Page 16: i COMPUTER VISION BASED BARCODE READER FOR HALAL

xvi

LIST OF ABBREVIATION

JAKIM - Jabatan Kemajuan Islam Malaysia

1D - One dimensional

2D - Two Dimension

SQLite - Structured Query Language

EAN - European Article Numbering

UPC - Universal Product Code

JVM - Java Virtual Machine

FDS - Flex Data Services

AIR - Adobe Integrated Runtime

API - Application Programming Interface

SDK - Software Development Kit

ADT - Android Developer Tools

GUI - Graphical User Interface

IDE - Integrated Development Environment

OS - Operation System

UI - User Interface

CPU - Central Processing Unit

PIN - Personal Identification Number

PC - Personal Computer

IDE - Integrated Development Environment

JDK - Java Development Kit

Page 17: i COMPUTER VISION BASED BARCODE READER FOR HALAL

1

CHAPTER 1

INTRODUCTION

1.1 Project Background

Nowadays, almost all products have its unique barcode numbers. It represents

loads of information about a product. Many people familiar with halal food issue. Other

popular applications of bar code include the logistic industry and domestic consumer

food monitoring. The android application has the potential of changing the consumer

business landscape in the near future. Also it has opened up exciting new channels for

any type of products identification using mobile technology. Meanwhile, Halal

consumer products have become a crucial concern that affects Malaysian's Muslims as

well as around 1 .5 billion Muslim throughout the world. The word Halal is an Arabic

term meaning "permissible". It is important to understand that Halal is a unique

comprehensive Islamic concept encompasses the matters of food and drink, and all other

Page 18: i COMPUTER VISION BASED BARCODE READER FOR HALAL

2

matters of daily life. In Malaysia, Jabatan Kemajuan Islam Malaysia (JAKIM) is

responsible for Halal certification. It covers consumer products such as foods, drinks,

cosmetics, etc. Each of these must pass the JAKIM requirements for Halal Certification.

JAKIM department was provided SMS (Short Message System) to user know about the

food status only send the food barcode and get the response in real time.

For this application from this project (Computer Vision Based Barcode Reader

for Halal Jakim Verification System), user can know the food status only scan the

barcode image to capture by camera .To make food reorganization processes become

more effective, this proposed system is developed to make more systematic a

consistence. It also keeps all the data about the food on the database.

By developing this system, it can upgrade to replace the current system for

example it is provide with database to store all the information about the food. The

barcode will be applied for this system and the barcode which capture by smart phones

camera to give the food status .With the barcode on food, the identification of it will be

more efficient and systematic.

1.2 Problem Statement

A lot of the existing products in the market use Halal Malaysia label without

getting the certification from JAKIM. Thus, the halal status cannot be trusted just by

looking at the label of product. In addition to this problem, some products still use the

Halal Malaysia label even though the certification has expired. JAKIM has provided e-

halal using web-portal and SMS to ascertain the halal status. However, both systems

have limitations such as the need of internet access for the web-portal, consumers must

remember the SMS number for verifying via SMS using mobile phone. Both systems are

costly and need to key-in the product barcode manually for authentication. This system

helping consumers to overcome these limitations by verifying halal status verification

easily.

Page 19: i COMPUTER VISION BASED BARCODE READER FOR HALAL

3

1.3 Objectives

The objective of this project:

1. To design barcode recognition system using image processing algorithms

2. To analyze the recognition rate of the image processing algorithm.

3. To construct Halal system verification system using the barcode images

captured.

1.4 Scope of Project

The scope of the project is as following:

1. Type of barcode use is 1D barcode.

2. This project concentrates on the process of detection barcode and calls the data.

3. Eclipse software will be used to develop the algorithms barcode scanner and

application.

4. SQLite (Structured Query Language) will be used to manage the details data.

1.5 Methodology of Project

• Analysis some related project, study and analysis the existing project.

• Design specification of detail framework that chooses in Android.

• System development of project.

• System testing the performance.

Page 20: i COMPUTER VISION BASED BARCODE READER FOR HALAL

4

1.6 Thesis Organization

This report contains five chapters. Chapter one describe about introduction of

Computer Vision Based Barcode Reader For Halal Jakim Verification System, problem

statement of the project, objective of the project, the purpose of the project that describe

the reason for developing this project, scope of the project and organization of the

report.

Chapter two is literature review about the barcode system available, types of

barcode, and Halal Jakim system available. This chapter review on previous research

about the topic related to the project. Various methods and approaches that related to the

project is discussed and reviewed.

Chapter three explains the theory of this project. This project theory includes

Java Language, Android Architecture, SQLite and algorithms. This chapter will review

the basic theory about application software, language, and management software.

Chapter four explains the methodology of the project. This project will used Java

Android algorithms techniques to read the barcode and use the SQLite database

management system to store all data. The flow chart of the project and the algorithms

use is explained in this chapter.

Chapter five is about results of the Java Android simulation and discussion

regarding the results. Analysis about scan the barcode in different condition will be

discussed. Lastly, chapter six will conclude the project findings and recommendation for

the further study.

Page 21: i COMPUTER VISION BASED BARCODE READER FOR HALAL

5

CHAPTER 2

LITERATURE REVIEW

2.1 Introduction

A barcode is an optical machine-readable representation of data relating to the

object to which it is attached. Originally barcode are systematically represented data by

varying the widths and spacing’s of parallel lines, and may be referred as linear or one-

dimensional (1D). Later, they evolved into rectangles, dots, hexagons and other

geometric patterns in two dimensions (2D). Although the 2D systems use variety of

symbols, they are generally referred to as barcodes as well. Barcodes are “printed

horizontal strips of vertical bars used for identifying specific items”[1].Barcodes

originally were scanned by special optical scanners called barcode readers. Later,

scanners and interpretive software became available on devices including desktop

printers and smart phones. Many mobile applications that incorporate barcode reader

have been developed in various areas such as blood bank [2], product recommendations

[3], and logistic [4].

Page 22: i COMPUTER VISION BASED BARCODE READER FOR HALAL

Figure 2.1

The European Article Numbering (EAN)

tagging retail goods

enormous benefits to consumer and business. As a result, the process of capturing

product data (price, etc.) is faster and more accurate. Mistakes are minimized and

managing inventory has been much easier.

EAN-13 barcode has 13 numeric characters, al

or three characters are the country code.

followed by either nine or ten characters for manufacturer code and product code. The

13t character of the EAN

Figure 2.1 : European Article Numbering (EAN)

The European Article Numbering (EAN)-13 barcode is used internationally for

[5] (figure 2.1). The usage of barcode technology has pro

enormous benefits to consumer and business. As a result, the process of capturing

product data (price, etc.) is faster and more accurate. Mistakes are minimized and

managing inventory has been much easier.

13 barcode has 13 numeric characters, also known as digits. The first two

or three characters are the country code. Depending on the length of the country

either nine or ten characters for manufacturer code and product code. The

13t character of the EAN-13 barcode is the checksum digit [6].

6

European Article Numbering (EAN)-13

13 barcode is used internationally for

(figure 2.1). The usage of barcode technology has provided

enormous benefits to consumer and business. As a result, the process of capturing

product data (price, etc.) is faster and more accurate. Mistakes are minimized and

so known as digits. The first two

Depending on the length of the country code; it

either nine or ten characters for manufacturer code and product code. The

Page 23: i COMPUTER VISION BASED BARCODE READER FOR HALAL

7

2.2 Categories of Barcode

Barcodes have now become an essential part of almost company. It is rarely to

find a product without a barcode tag. Different types of barcodes are used for different

purposes in business sectors. Typical usage of barcodes include tracking sale and

purchase of large number of items in an inventory, pasted on sports tickets which allow

one to enter a sports arena and often placed on gift tokens that when decoded tells

which gift that token corresponds.

2.2.1 One Dimensional Barcodes

One dimensional or linear barcodes are commonly referred as first generation

barcodes. A variety of 2D barcode shave been designed that are much better suited for

camera acquisition[7],[8], but for the next several years 1D barcode will remain the

dominant type of label for most packaged goods. These barcodes consist of vertical lines

at specific gaps resulting in a particular pattern. There has been a variety of research

done on algorithms for reading 1D barcodes, which we survey, briefly here. Most past

work has dealt with scan line data (typically acquired by a laser scanner), using

waveform analysis, debluring and other signal processing techniques to detect edges

[9],[10],[11]. Hardware scanners are used to scan these patterns and decode the

information stored in those particular patterns. These barcodes are also commonly

called discrete, one dimensional or UPC barcodes. Commonly the 1D barcodes are:

Page 24: i COMPUTER VISION BASED BARCODE READER FOR HALAL

Code 39

Code 39 (also

outside the retail area and is read by most scanners, although it is not as compact as

Code 93 or Code 128 (Figure 2.2). The normal Code 39 scheme encodes both numbers

and upper case letters, and

self-checking symbology

Some users mistake that inter

not the same size as in another barcode representing the same characters.

Code 93

Code 93 (Figure 2.3) is a variable length, continuous symbology using four

element widths with each character consisting of three bars and three spaces. Code 93

was designed to complement Code 39 and is a more compact code than the latter. Code

93 is not a self-checking symbology.Code 93 symbols include two Mod 47 check

characters.Special codes are used to allow full ASCII characters to be incorporated,

Figure 2.2: Code 39

Code 39 (also known as 3 of 9) is by far the most common barcode symbology

outside the retail area and is read by most scanners, although it is not as compact as

Code 93 or Code 128 (Figure 2.2). The normal Code 39 scheme encodes both numbers

and upper case letters, and was the first alphanumeric symbology. Code 39 is a discrete,

checking symbology - so the gap between ciphers may be larger than a unit space.

Some users mistake that inter-cipher gap for a space and become concerned because it is

in another barcode representing the same characters.

Figure 2.3: Code 93

Code 93 (Figure 2.3) is a variable length, continuous symbology using four

element widths with each character consisting of three bars and three spaces. Code 93

gned to complement Code 39 and is a more compact code than the latter. Code

checking symbology.Code 93 symbols include two Mod 47 check

Special codes are used to allow full ASCII characters to be incorporated,

8

known as 3 of 9) is by far the most common barcode symbology

outside the retail area and is read by most scanners, although it is not as compact as

Code 93 or Code 128 (Figure 2.2). The normal Code 39 scheme encodes both numbers

was the first alphanumeric symbology. Code 39 is a discrete,

so the gap between ciphers may be larger than a unit space.

cipher gap for a space and become concerned because it is

in another barcode representing the same characters.

Code 93 (Figure 2.3) is a variable length, continuous symbology using four

element widths with each character consisting of three bars and three spaces. Code 93

gned to complement Code 39 and is a more compact code than the latter. Code

checking symbology.Code 93 symbols include two Mod 47 check

Special codes are used to allow full ASCII characters to be incorporated,


Top Related