Camera Based EAN-13 Barcode Verification with Hough Transform and Sub-Pixel Edge Detection

Similar documents
Reading Barcodes from Digital Imagery

Automatic License Plate Recognition System using Histogram Graph Algorithm

Blur Estimation for Barcode Recognition in Out-of-Focus Images

Detection and Verification of Missing Components in SMD using AOI Techniques

Adaptive use of thresholding and multiple colour space representation to improve classification of MMCC barcode

Spring 2005 Group 6 Final Report EZ Park

8.2 IMAGE PROCESSING VERSUS IMAGE ANALYSIS Image processing: The collection of routines and

Wheeler-Classified Vehicle Detection System using CCTV Cameras

An Improved Bernsen Algorithm Approaches For License Plate Recognition

Introduction to DSP ECE-S352 Fall Quarter 2000 Matlab Project 1

Digital Image Sharing and Removing the Transmission Risk Problem by Using the Diverse Image Media

Abstract. 2. SmartCamBCR: A Low Cost Barcode Reader. 1. Introduction

APPLICATION OF COMPUTER VISION FOR DETERMINATION OF SYMMETRICAL OBJECT POSITION IN THREE DIMENSIONAL SPACE

Lane Detection in Automotive

Finger rotation detection using a Color Pattern Mask

AN EFFICIENT APPROACH FOR VISION INSPECTION OF IC CHIPS LIEW KOK WAH

Lab/Project Error Control Coding using LDPC Codes and HARQ

Image Smoothening and Sharpening using Frequency Domain Filtering Technique

An Effective Method for Removing Scratches and Restoring Low -Quality QR Code Images

Face Detection System on Ada boost Algorithm Using Haar Classifiers

CIS581: Computer Vision and Computational Photography Homework: Cameras and Convolution Due: Sept. 14, 2017 at 3:00 pm

Multimedia-Systems: Image & Graphics

Machine Vision for the Life Sciences

Evaluating Barcode Reading Technologies

A Review of Optical Character Recognition System for Recognition of Printed Text

Image Enhancement using Histogram Equalization and Spatial Filtering

Vehicle Number Plate Recognition with Bilinear Interpolation and Plotting Horizontal and Vertical Edge Processing Histogram with Sound Signals

Automated Driving Car Using Image Processing

Identification of Fake Currency Based on HSV Feature Extraction of Currency Note

Study and Analysis of various preprocessing approaches to enhance Offline Handwritten Gujarati Numerals for feature extraction

The Use of Border in Colour 2D Barcode

Real-Time License Plate Localisation on FPGA

Development Of A Novel Finder Pattern For Effective Color 2D-Barcode Detection

UNIVERSITY OF UTAH ELECTRICAL AND COMPUTER ENGINEERING DEPARTMENT

Preprocessing and Segregating Offline Gujarati Handwritten Datasheet for Character Recognition

AUTOMATIC NUMBER PLATE DETECTION USING IMAGE PROCESSING AND PAYMENT AT TOLL PLAZA

Programing the Datalogic Gryphon scanner. Page 26 scan Enter/Exit Programming Mode, Country Mode=U.S., Enter/Exit Programming Mode

Project: Sudoku solver

Digital images. Digital Image Processing Fundamentals. Digital images. Varieties of digital images. Dr. Edmund Lam. ELEC4245: Digital Image Processing

10 GRAPHING LINEAR EQUATIONS

dlsoft Barcode Analyser By dlsoft

Proposed Method for Off-line Signature Recognition and Verification using Neural Network

International Journal of Digital Application & Contemporary research Website: (Volume 1, Issue 7, February 2013)

MAV-ID card processing using camera images

IMAGE PROCESSING FOR EVERYONE

Images and Graphics. 4. Images and Graphics - Copyright Denis Hamelin - Ryerson University

Image Extraction using Image Mining Technique

SECTION I - CHAPTER 2 DIGITAL IMAGING PROCESSING CONCEPTS

Visual Cryptography. Frederik Vercauteren. University of Bristol, Merchant Venturers Building, Woodland Road, Bristol BS8 1UB.

Vehicle License Plate Recognition System Using LoG Operator for Edge Detection and Radon Transform for Slant Correction

Digital Arts I - Course Outline

(Refer Slide Time 00:44) So if you just look at this name, digital image processing, you will find that there are 3 terms.

Raster Based Region Growing

Mobile SuDoKu Harvesting App

Implementation of License Plate Recognition System in ARM Cortex A8 Board

Visual Search using Principal Component Analysis

Aesthetically Pleasing Azulejo Patterns

Automatic Electricity Meter Reading Based on Image Processing

Quality Control of PCB using Image Processing

Solving Equations and Graphing

World Journal of Engineering Research and Technology WJERT

Foundations of Multiplication and Division

Finger print Recognization. By M R Rahul Raj K Muralidhar A Papi Reddy

A QR Code Image Recognition Method for an Embedded Access Control System Zhe DONG 1, Feng PAN 1,*, Chao PAN 2, and Bo-yang XING 1

Demosaicing Algorithms

Background. Computer Vision & Digital Image Processing. Improved Bartlane transmitted image. Example Bartlane transmitted image

A robust method for deblurring and decoding a barcode image

PLazeR. a planar laser rangefinder. Robert Ying (ry2242) Derek Xingzhou He (xh2187) Peiqian Li (pl2521) Minh Trang Nguyen (mnn2108)

FREDRIK TUFVESSON ELECTRICAL AND INFORMATION TECHNOLOGY

Machine Vision for General Cameras for Quality Testing and Dimension Calculations

Automatic optical measurement of high density fiber connector

(Refer Slide Time: 01:45)

LAB MANUAL SUBJECT: IMAGE PROCESSING BE (COMPUTER) SEM VII

Study & Analysis the BER & SNR in the result of modulation mechanism of QR code

An Efficient Color Image Segmentation using Edge Detection and Thresholding Methods

Automatic Licenses Plate Recognition System

Robust Invisible QR Code Image Watermarking Algorithm in SWT Domain

Diversity Image Inspector

TurboDrive. With the recent introduction of the Linea GigE line scan cameras, Teledyne DALSA is once again pushing innovation to new heights.

A novel method for accurate and efficient barcode detection with morphological operations

LINEAR EQUATIONS IN TWO VARIABLES

Image Processing for feature extraction

Lane Detection in Automotive

Chapter 6. [6]Preprocessing

RESEARCH PAPER FOR ARBITRARY ORIENTED TEAM TEXT DETECTION IN VIDEO IMAGES USING CONNECTED COMPONENT ANALYSIS

DSP First Lab 06: Digital Images: A/D and D/A

MULTIMEDIA SYSTEMS

The Scientist and Engineer's Guide to Digital Signal Processing By Steven W. Smith, Ph.D.

Implementation of Barcode Localization Technique using Morphological Operations

George Mason University ECE 201: Introduction to Signal Analysis

Research on Pupil Segmentation and Localization in Micro Operation Hu BinLiang1, a, Chen GuoLiang2, b, Ma Hui2, c

Preprocessing of Digitalized Engineering Drawings

Coding for Efficiency

ECC419 IMAGE PROCESSING

HUFFMAN CODING. Catherine Bénéteau and Patrick J. Van Fleet. SACNAS 2009 Mini Course. University of South Florida and University of St.

Traffic Sign Recognition Senior Project Final Report

Exercises to Chapter 2 solutions

Image Enhancement in Spatial Domain

Label and Barcode Detection in Wide Angle Image

Noise Reduction Technique in Synthetic Aperture Radar Datasets using Adaptive and Laplacian Filters

Transcription:

First National Conference on Algorithms and Intelligent Systems, 03-04 February, 2012 1 Camera Based EAN-13 Barcode Verification with Hough Transform and Sub-Pixel Edge Detection Harsh Kapadia M.Tech IC Scholar Faculty of Technology Dharmsinh Desai University Nadiad,Gujarat-387001 harsh291188@gmail.com Kinjal Shah M.Tech IC Scholar Faculty of Technology Dharmsinh Desai University Nadiad,Gujarat-387001 kinjal_nirmns88@yahoo.com Abstract-- This paper discuss about EAN-13 Barcode verification. The system is meant to verify Barcode on-line. It primarily focuses on two aspects of barcode verification. One is two detect the angle if barcode is skewed in the image and correct the same. The other is to detect the edges of a barcode in real time blurred image using sub-pixel edge detection. The paper also includes MATLAB implementation steps for both this methods with results. Index Terms--EAN-13, Hough Transform, Sub-pixel edge detection, Pre-processing. N I. INTRODUCTION OWADAYS immense advancement has been done in the branch of Image Processing and Computer Vision. Its applications focus on intelligent machines and systems which includes Barcode verification and recognition, Traffic control system, Security systems, Fault and Auto-rejection system etc. Image processing involves changing the nature of an image in order to either improve its pictorial information for human interpretation, or render it more suitable for autonomous machine perception. Barcodes [2] were introduced in 1960s. Their first application was in rail road cars. The invention of barcode was a result of developing an application for identifying products of all kinds, especially in super markets. Today barcodes are almost everywhere. They are more popular in consumer products. They help automate the process of production and reduce human error. Simply barcodes are formed of parallel lines which may be thick or thin depending on the data encoded in the code. There are almost dozens of barcodes currently in use such as code-11, UPC A, UPC E, EAN-2, EAN-5, EAn-8, EAN-13, JAN, QR, PDF417, Data Matrix, stacked barcode. They are of different types like one-dimensional, two dimensional, numeric codes, alphanumeric codes, industry codes depending on its need. Barcode find use where one needs to identify or track something, for example it can be helpful in a hospital. A wrist band of paper containing barcode tied on patient s hand. It can be scanned and data information of the patient will be available. Likewise in a supermarket products can be scanned using a laser barcode reader. The system is meant to verify barcode on-line. Online word here means at the time of production in the industry. Now any industry producing retails products will be having barcode generator software which generates EAN-13 barcode particular for that industry and that product. Here to verify whether the barcode generated by the software and the barcode printed are matching or not is very much important. If not verified it can create trouble in scanning at the point of sale. The work shown in the paper is the base work for the system to be made. II. ABOUT EAN-13 In EAN-13 [2][3][6], EAN stands originally for European Article Number which is now renamed as International Article Number. As the name shows it has 13 digits (12 data and 1 check) and it is a superset of original 12-digit Universal Product Code system developed in the United States. It is defined by the standards organization GS1 and is used widely to barcode the retail products. The 13 digit in the barcode has four components. 1) The number system It identifies the country numbering authority which assigns manufacture code. Any number system which starts with the digit 0 is a UPC-A barcode, e.g. 890: India, 978: International Standard Book Numbering (ISBN), 979: International Standard Music Number (ISMN). 2) The manufacturer code Next five digits indicate a unique code assigned to manufacturer. All products produced by that manufacturer will use the same manufacturer code.

2 First National Conference on Algorithms and Intelligent Systems, 03-04 February, 2012 TABLE II ENCODING SCHEME Fig.1. EAN-13 components [6] 3) The product code Next five digit set is a unique product code assigned by the manufacturer. 4) The check-sum digit Last 13th digit is an additional digit which signifies that the barcode has been scanned correctly. During scan if problem arise it leads to wrong barcode, so it is useful to verify that whether the barcode is interpreted correctly or not. The method to calculate check-sum digit is described here. Odd and even positions are given to the digits of the barcode. Now odd are multiplied by 3 and even are multiplied by 1.Multiplied numbers are added. Suppose that number is 67 67 modulo 10 =7 10-7=3 So checksum digit is 3. TABLE I DIGIT PATTERN One more important thing is that this barcode contains three guard bars as shown in below figure. Fig. 2. Decoding EAN-13 III. THEORY STEPS Figure shows the main parts of the verification system. 12 Digits of barcode are divided it two groups of 6 digits. The first group can have two possible encodings while the second group has a single set of pattern. It includes the checksum digit. The 13 digits are encoded in 95 bits with each digit having 7 bit each. In this barcode, width of white space or black space can be vary from 0 to 4 i.e. maximum 0000 or 1111 can be encoded. From Table I the four columns show the respective entries of the digits and in Table II three columns show the digit pattern. Barcode 1 st digit decodes the digit pattern. Fig. 3. Block diagram of the system A. Pre-processing In pre-processing the image needs to be converted to gray scale. Thus the original image must be enhanced for accurate scanning. Now to get 95 bits from the image a single row of the barcode is extracted. And then part other than barcode is removed.

First National Conference on Algorithms and Intelligent Systems, 03-04 February, 2012 3 B. Angle correction [7][8][9][11] In any image containing barcode, there can be a possibility that the barcode is skewed. So the angle at which the barcode is skewed must be found and corrected. It is done using Hough Transform [8][9].The Hough Transform patented by Paul Hough in 1962 is basically a feature extraction method used to detect lines and finding arbitrary shapes position in the image and is used in the field of computer vision and image processing. As barcode contains straight lines, they can be detected and corresponding to those lines angles can be found. A line can be described in the image space as (1) All straight lines passing through point (x, y) satisfy that equation but the values of slope m and intercept c may vary. Now instead of considering the point (x, y), parameters (m, c) are considered to understand the characteristics of straight lines in the image. This is the main idea in Hough Transform. If vertical lines are present in the image the values of m will be infinity, so use parameters (r, ). The parameter r represents the distance between line and origin, is the angle of the vector from origin to this point. So the new rearranged equation becomes (2) For any arbitrary point in the image plane coordinates, e.g. (x1, y1) the lines that go through are (3) This forms a sinusoidal curve in the (r, ) plane, which is unique for that particular point. Now, more generally a set of points which form a straight line will produce curves which cross at the (r, ). The result of the Hough transform is stored in a matrix that often called an accumulator. One dimension of this matrix is the values (angles) and the other dimension is the r values (distances), and each element has a value telling how many points/pixel that lie on the line with the parameters (r, ). So the element with the highest value tells what line that is most represented in the input image. Hough Transform has an advantage which is that the point need not all be continuous. This can be really helpful if line is broken due to noise. One more factor to be considered is the efficiency which depends on the quality of input data. It also has an importance in the skew correction of documents and characters, finding shapes like rectangle, circle, ellipse etc in the image. C. Scanning In scanning problem arises when the barcode image is blurred. And one more constraint is that the space for barcode on the product surface is small. So we get a small image. If the barcode is generated by any barcode generating software, it will be an ideal image. And to deal with that ideal image is not a problem. But the real image is mostly blurred. So in order to scan that image some operations must be carried out to accurately scan it. One solution can be increasing the resolution of the image using Super-resolution method. Other can be detecting barcode edges at sub-pixel level using Sub-pixel Edge Detection method. Sub-pixel edge detection simply means that detecting edges at sub-pixel level. The problem is that if the barcode image is blurred than the width of white space and black space gets merged. So it becomes a tough task to find out the edges at pixel level. Hence sub-pixel edge detection method is preferred to detect edges in barcode. When a white line is viewed on black background, the pattern obtained is an ideal step-shaped waveform. But in real life the image is blurred so the waveform is not ideal. This blurring will result into a Gaussian curve. And to detect positive and negative edges in that is too complex. Fig. 4. Ideal and blurred barcode sample Now the effect of blurred edges will be fading of sharp edges in derivative signal. So to locating edges becomes even more difficult. Edges can be located but in barcode scanning precision is needed then only we can get true 13 digit barcode. Sub-pixel edge detection will give better precision. The algorithm is described below. 1) Part-1 As in the theoretical case, the point-to-point derivate function is calculated. This function has only valid values on the sample moments of the original values. 2) Part-2 Calculate the second order derivative. 3) Part-3 The cubic interpolation technique is used to create a continuous function out of the sample values obtained in part- 2. 4) Part-4 To know the exact position of the positive and negative edge, the zero-crossing position for the function from part 3 has to be determined. The goal here is to determine the exact edges in a blurred barcode image. In the method is to take out sample-view of cross sections of an arbitrary line which have a single row containing barcode. Then next step is to calculate the first order derivative of the sample points and it is shown in figure by pink points. The edges are located at the

4 First National Conference on Algorithms and Intelligent Systems, 03-04 February, 2012 maximum and minimum of this derivative function. These positions are determined by calculating second order derivative shown in figure by green points. Here the edges are located at zero crossings of this function. To determine those positions with precision this function is interpolated in the next part which is shown in figure 6.In that red lines shows the zero crossings. Fig. 5. First and second derivative of barcode function look-up tables are necessary which are shown in Table I and Table II. And correcting measures are taken to avoid wrong answer. Calculation of check-sum digit is done to verify that the barcode is perfectly scanned. Function takes 95 bits as input and gives 13 digits. To create it following steps is performed. 1) step-1 Define look-up table for L, G, R and patterns. 2) step-2 Get each 7 bit from input 95 bits. 3) step-3 Get the pattern for first group of 6 digits. 4) step-4 Compare the bits one by one with the respective entries in the look-up table defined earlier. 5) step-5 Define a barcode matrix and divide it into 5 parts.3 for guard bars and 2 for two groups of digits. 6) step-6 Calculate check-sum digit and verify the answer. B. Angle Detection and Correction MATLAB has inbuilt function for Hough transform which are hough, houghpeaks and houghlines. They are able to detect angle within the range -90 to 90. There can be two cases possible for angle, one is barcode is skewed from 0 to 90 and other is from 90 to 180 as the range here is limited to - 90 to 90. The steps are shown in the below figure. Fig. 6. Interpolation and zero crossing IV. IMPLEMENTATION STEPS The implementation is done in MATLAB. The steps that I followed to build this system are mentioned below. 1) step-1 Form a MATLAB function to get 13 digits of the barcode by giving 95 bits as input. 2) step-2 Skewed barcode angle detection and correction using Hough Transform. 3) step-3 Implementation of sub-pixel edge detection and get 95 bits by scanning a single row of barcode. A. Function This function forms the basis of the system software as it gives the final 13 digits as an answer. Now to build this Fig. 7. Flowchart for angle correction

First National Conference on Algorithms and Intelligent Systems, 03-04 February, 2012 5 Here are MATLAB results of the implementation of angle correction using Hough Transform. Fig. 11. Result Fig. 8. Sample barcode skewed at angle 30 Below figure shows the angle correction using Hough Transform for a sample barcode which is skewed at 120. Fig. 12. Sample barcode at 120 and its result Fig. 9. Hough lines Fig. 10. Hough peaks C. Scanning Barcode Scanning of barcode is done to get 95 bits which are given to the function. And function gives 13 digits as a final result. Following are steps showing the implementation of Sub-Pixel Edge Detection method. 1) step-1 Convert sample image into grayscale image. 2) step-2 Take out a single row from the image which contains barcode and remove part of that row which does not contain barcode. 3) step-3 Find first derivative of the sample points. 4) step-4 Find second derivative. 5) step-5 Scan the second derivative for zero crossing. 6) step-6 Interpolate the points where zero crossing is located. Here we go into 10 th part of a pixel i.e. into sub-pixel level. 7) step-7 Again scan these points for zero crossing. 8) step-8

6 First National Conference on Algorithms and Intelligent Systems, 03-04 February, 2012 Check whether the width of the barcode is same of not. Check that first three bits are guard bits so it must be 101. 9) step-9 Subtraction is operated on these points to get widths. 10) step-10 Initialise a 1*95 matrix with zeros. Scan the zero crossing points and simultaneously scan the width at that pixel position. 11) step-11 Put 1 or 0 according to the width in the matrix initialised in previous step. (http://www.cvmt.dk/education/teaching/f09/vgis8/aip/hough_09gr8 20.pdf). [12] Ramtin Shams and Parastoo Sadeghi, BarCode Recognition In Highly Distorted And Low Resolution Images, ICASSP 2007. [13] Sub-pixel edge detection, Available at (http://emsys.denayer.wenk.be/emcam/subpix_eng.pdf). Fig. 13.Cubic interpolation V. CONCLUSION Some constraint occurred during this development, like if the barcode is skewed at an angle more than 180 i.e. if it is in 3 rd or 4 th quadrant then its angle detection is not done. Other important constraint is that if the size of image is changed then the software faces problems to scan the barcode. In case of ideal images the code is accurate enough to give correct 13 digits. But in case of blurred images it faces many problems. Software faces problems like changing width of white and black spaces scanned, and in some images that width is not uniform. So those widths are rounded, which creates problem while getting the barcode bits. The better part of this software can be time consumed is short. So to implement a real time on-line system time consumed is critical. One other good thing is use of Hough transform to detect and correct angle is quite accurate. VI. REFERENCES [1] Alasdair McAndrew, An Introduction to Digital Image Processing with Matlab, School of Computer Science and Mathematics Victoria University of Technology. [2] Barcode, Available at (http://en.wikipedia.org/wiki/barcode). [3] Barcode scanner, Available at (http://repairfaq.ece.drexel.edu/sam/meos/exp27.pdf). [4] Douglas Chai and Florian Hock, Locating and Decoding EAN-13 Barcodes from Images Captured by Digital Cameras, School of Engineering and Mathematics Edith Cowan University, Perth, Australia, ICICS 2005. [5] EAN-13, Available at (http://en.wikipedia.org/wiki/international_article_number_(ean)). [6] EAN-13, Available at (http://www.mecsw.com/specs/ean_13.html). [7] Ghassan Hamarneh, Karin Althoff and Rafeef Abu-Gharbieh, Automatic Line Detection, September 1999, Available at (http://www.cs.sfu.ca/~hamarneh/ecopy/compvis1999_hough.pdf). [8] Hough transform, Available at (http://en.wikipedia.org/wiki/hough_transform). [9] Jeppe Jensen, Hough Transform for straight Lines, 2007. [10] Leow Wee Kheng, Sub-pixel Algorithms, Available at (http://www.comp.nus.edu.sg/~cs4243/lecture/subpixel.pdf). [11] Line Detection by Hough transform, Available at