Welcome to Scribd, the world's digital library. Read, publish, and share books and documents. See more
Standard view
Full view
of .
Look up keyword
Like this
0 of .
Results for:
No results containing your search query
P. 1
Recognition & Conversion of Barcode using Camera Image

Recognition & Conversion of Barcode using Camera Image

Ratings: (0)|Views: 883 |Likes:
Published by chachunasayan
Term Project Report of Recognition & Conversion of Bar code using Camera Image. Implementation was done on Matlab2009. Report written in IEEE publication format.
Term Project Report of Recognition & Conversion of Bar code using Camera Image. Implementation was done on Matlab2009. Report written in IEEE publication format.

More info:

Published by: chachunasayan on Mar 06, 2011
Copyright:Attribution Non-commercial Share Alike


Read on Scribd mobile: iPhone, iPad and Android.
download as PDF or read online from Scribd
See more
See less



In this report we present the method of deciphering the barcode using image processing, andits implementation on
. 1D barcode labelingis a commercial method to store information about aproduct for the checkout systems of large marts andshopping centers. Nearly all products are labeledwith barcodes at the time of their manufacturing andsometimes shop owners label products using theirown barcodes. The conventional bar code scannersare not portable as they need both a power sourceand a computer with the database of the product, tobe read. Also they are not readily available. It wouldbe convenient for the costumers to read and decipherthese barcodes using their portable devices such asdigital cameras and mobile phones, In order to gainthe specific information about the product providedby the manufacturer. Our aim in this project was totake those barcode images taken by cameras anddecipher them. We used edge detection to find theedges of barcode and through the knowledge of thestandard that the barcode is encoded in; we convertthe image into the decimal
Barcodes is a machine readable encoding process. It isbeing used extensively throughout the world. There aredifferent standards of the barcode, each having its pros andcons. The latest barcode standard is
, which was formerlyknown as
“European Article Number”
but now is called
“International Article Number”.
But we have chosen
Universal Product Code
, because it is the most widely usedbarcode and has an error detection mechanism in it, which aidsthe deciphering process.Barcodes are used to encode specific information about theproduct, for the ease of consumers and shopkeepers. Severaltypes of devices are there to read these barcodes, e.g., LEDscanners, Laser scanners etc. These devices are cumbersome touse and are neither readily available nor mobile. This limits theproduct information to the shop owners only, to aid costumersin extracting this information, portable solution to thedeciphering of barcodes must be provided. One of thesesolutions is the deciphering of the barcode using handhelddevices such as mobile phones and digital cameras. Thesedevices take the picture of the barcode and then use either anonline platform to extract the information about the product oruse some other kind of connectivity to the database containingthe information about the product. Retrieval of suchinformation is vital for people with medical afflictions towardssome products and for the validation of price and legitimacy of the product. Many efforts have been made to achieve thedeciphering using images of camera phone (
see references for details).
These methods may be more accurate but they arecomputationally expensive and time consuming. So we havedeveloped a method of robust deciphering
of the barcodewhich is a practically viable solution. The details of ourmethod and its
implementation are discussed next.
The main objectives of our project were:Read a Barcode from a camera imageDecode the barcodeRemove any type of noise that may occur
Recognition & Conversion of Barcode usingCamera Image
Amna Meer
Reg. No
Aneeba Masood
Reg. No
Asadullah Hussain
Reg. No
Rahma Shaukat Gill
Reg. No
The first step in the deciphering is the detection of barcode.This can be easily achieved by several edge detectiontechniques. We have employed the fact that barcode is anintensity image. It contains vertical strips of black and whitelines. So we use the gray thresh value of the image to detectthe start and the end of the barcode strips. This can beachieved by the
wavelet transform method 
[3] or by
morphological operations
[10] but we want a method that isboth quick and efficient so we use scanline based approach.This method uses the fact that a horizontal scanline is at thecenter of the barcode. If the image of barcode is not centeredor the center region contains distortions then the algorithm willsimply shift the scanline above or below the center of theimage until we get non distorted region. The
 implementation is given in
Appendix A.
Fig. 1 The Scanline Approach [1]
The next step is the Binarization of the image. We have todistinguish the barcode i.e., black strips from the whitebackground i.e., spaces. First the start and the end of thebarcode is detected i.e., first black strip and last black strip.Then scanline scans the pixels from the center. Then the graythresh values are used to assign 1s to spaces and 0 s to strips.If the gray thresh is other than that of black or white. We havedefined two ranges for gray thresh values, one range is allotted1 for white and other is assigned a binary 0 for black. If thegray thresh value of a pixel lies within the white range it isassigned binary 1 i.e., we say that this pixel is white or spacebut has been discolored, if it lies in other range then it isassigned the opposite binary number i.e., 0 we say that thepixel was black but has been decolored. In this way thedecolored pixels that may arise in the barcode image areaccounted for and thus a type of noise is taken care of. Thismethod is derived from
the luminous method 
described in [1].In this method without searching for the edges the scanlinebinarizes all the pixels. The pixel selected first is the middleone. To cater for the noises first the scanline pixels aresmoothed and then the luminance value Y(x)
[0, 1] iscalculated for each pixel, whose position is given by:.Then the local minima and maxima are computed. The
implementation is described in
Appendix A.
Fig. 2 Block Diagram of our Algorithm, Input is an image of barcode.Which is detected and binatized by scanline approach, then errorcheck and decimanl conversion are applied.
Once the image has been binarized then all we have to do is touse our knowledge about the construction of the barcode, this
in our case is achieved by the knowledge of UPC‟s encoding
process. In nearly all the Barcode standards we have a total of 13 decimal digits. The last is the
parity bit 
. This digit is usedto provide the second step of the double error check.A.
The UPC standard 
barcode consists of four areas:i.
The number systemii.
The manufacturer codeiii.
The product codeiv.
The check digit
Number System
is for the class or type to which the productbelongs.
The manufacturer code
is given to each manufacturer by UCCcouncil for companies.
The product code
is a 5-digit number that the manufacturergives to his products.
The check digit 
verifies the validity of the product. It tellswhether the barcode has been scanned properly of not.
Fig.3 A standard UPC-A barcode [10]
The barcode begins & ends with a
pattern, these are also termed as g
uard bars
. Betweenthese
guard bars,
we have two blocks of black and whitestrips, separated by a central bar which is a
pattern. The two blocks on eitherside of the central bar contain the decimal code, which isdifferent for each product. Each decimal digit is encoded byusing 7 bits. Even and Odd alphabets are used for theencoding. First digit is called
the meta-number or induced digit 
Fig. 4 A typical UPC barcode. Guard bars are highlighted green [14]
To ensure that the scanline does not go outside the boundaryof the image, we set our starting position in the middle of theimage, to the value where luminance is 0 or we start with a bar(black). Then we scan left and right from this point by usingpre-determined steps or blocks of pixels. The choice of thesteps helps us in finding the guard bars, which are used for thefirst step of the error detection.The error detection is as follows:If The first 3 bits of the binarized image are equal to 101.The bit 46 is 0, 47 is 1, 48 is 0, 49 is 1 and 50 is 0.The last three bits i.e., 93, 94 and 95 are equal to 101.Then
The binarized image is a valid UPC code. If any one of theabove mentioned conditions is not satisfied then the code isnot a valid UPC code.
implementation is given in
Appendix A
For the conversion of the binarized image to the decimal weagain use our knowledge of the UPC construction. There is alookup table [14] with which we compare our bits.We ignore first and last 3 bits as they are the
guard bits
. Alsowe do not consider the central bits. As these bits are same forall the barcodes. Starting from the 4
bit (first three bits areguard bits) and selecting seven bits at a time. These seven bitsare compared with the lookup table of Figure 2 and bycomparison we allocate decimal values to the block of sevenbits. We can see from the table that if we are looking at bits tothe left of the central bits then we use the
“Left Bit Pattern”
 column to compare, while if we are looking at bits on the rightof the central bits we use the
“Right Bit Pattern”.
 Digit Left Bit Pattern Right Bit Pattern0 0001101 11100101 0011001 11001102 0010011 11011003 0111101 10000104 0100011 10111005 0110001 10011106 0101111 10100007 0111011 10001008 0110111 10010009 0001011 1110100

Activity (7)

You've already reviewed this. Edit your review.
1 hundred reads
1 thousand reads
Husni Hana liked this
Vulpe Florian liked this
Jadeja Hitendra liked this
Fahrul Proxy liked this
Farahin Bob liked this

You're Reading a Free Preview

/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->