Reading 1D Barcodes with Mobile Phones Using Deformable Templates

    16 Votes

1D BARCODES are Optical machine readable representation of data relating to the objects. In barcodes data are represented by varying the widths and spacings of parallel lines. They are often referred as linear or one-dimensional (1D). This presentation looks in to Reading 1D Barcodes with Mobile Phones Using Deformable Templates. In a deformable template each digit of the barcode, averaging over the set of all expected deformations. The success in reading those templates depends on an accurate description of the shape class.


Different types of barcode readers are 
  1. Pen type readers - Consist of a light source and photo diode that are placed next to each other in the tip of a pen. 
  2. Laser based Scanners- Laser scanners work the same way as pen type readers except that they use a laser beam as the light source.
  3. Hand held Barcode Scanners - This consists of a light source, a lens and a light sensor translating optical impulses into electrical ones.
  4. Regular Mobile Phones with Camera - Cell phone cameras taking the images of bar there are 2D barcodes which are optimized for cell phones.
  5. Mobile Phones using Deformable Templates - In this method, for barcode decoding (localization and reading) that   can deal with images that are blurred, noisy, and with low resolution.
Barcode Reading Procedure

In early days Binarization(Converting images to black and white image) and Edge Extraction (Extraction of barcode edges) was used. In this approach Localization (Identify the location of the endpoints of the barcode in the image) and Decoding ( Converting the black and while strips in barcodes to numbers) is used. Assumptions made in this approach is given below

  • No Binarization
  • No Edge Extraction 
  • Used in noise and blur images
  • Not sensitive
  • Gray level information is used
  • Optimization Procedure
  • Use particular forms of deformable Templates
  • Localization and Decoding will be used

Barcode Localization is a simple method. In this method image captured from mobile Camera is used. Here Vertical Axis is Parallel to Bars. Scanline determination will be done. Steps involved in Localization Process are

  • Smoothened Map calculation(Is(n)) - Horizontal  gradient is Strong and denoted by Ix(n). Vertical gradient is weak and denoted by Iy(n). Ie(n)=|Ix(n)|-|Iy(n)| where n = pixel. The smoothed map Is(n) with its maximum marked by a black square.
  • Binarization of Is(n) - Binarization is done using single threshold.
  • Scanline identification - Select the pixel n that maximizes Is(n). Expand a vertical  and a horizontal line from n, and form a rectangle. The horizontal line l(n) that passes through the center of this rectangle is chosen as the scanline for the analysis. First determine the intersections L and R of the scan line l(n) with the rectangle. In final localized image, the rectangle being larger than the actual barcode, we proceed inward from each end. 

Steps in decoding

  1. Spacial location computation - Compute the spatial location of each digit segment in the barcode.
  2. Intensity values comparing - Compare the intensity profile of the corresponding segment of the scanline with binary templates, each representing a symbol.
  3. Deformable template - Measure how well a deformed (shifted and scaled) template explains the observed intensity.
  4. Symbol generation - For each digit segment produce a sequence of symbols.


By this method we can decode barcode (localization and reading) images that are taken by mobile phones which are blurred, noisy, and with low resolution.


  • Highly accurate
  • No binarization is needed
  • Reduce the risk of errors
  • Use deformable templates to represent each digit of the barcode
  • Improved performance
  • Datasets implemented are given as public
  • Reading can be done in less than 0.5 seconds(Localization+Decoding)


  • Platform dependent
  • Apple iOS is not included
  • Problem  occur when phone battery goes off
  • Handset diversity
  • Continues video streaming is needed for processing
  • Pressing keys
Download this file (Reading 1D Barcodes with Mobile Phones Using Deformable Templates.ppt)Reading 1D Barcodes with Mobile Phones Using Deformable Templates.ppt[PPT Presentation]2852 Kb