0% found this document useful (0 votes)
256 views5 pages

An Image Binarization Algorithm For Scratches Removal and Restoration of QR Code Using Spatial Point Processing Threshold

The QR Code usage is increased every day. The QR Code Images are damaged by scratch or scribbling on it. The intention of this paper is to remove scratches on The QR Code images using Spatial Thresholds. This algorithm is a pre-process of decoding the QR Code. It is to restore the various scratched QR Codes. According to the experimental evaluation, it gives 98% of the damaged QR Code images have been restored and decoded successfully.

Uploaded by

ijsret
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
256 views5 pages

An Image Binarization Algorithm For Scratches Removal and Restoration of QR Code Using Spatial Point Processing Threshold

The QR Code usage is increased every day. The QR Code Images are damaged by scratch or scribbling on it. The intention of this paper is to remove scratches on The QR Code images using Spatial Thresholds. This algorithm is a pre-process of decoding the QR Code. It is to restore the various scratched QR Codes. According to the experimental evaluation, it gives 98% of the damaged QR Code images have been restored and decoded successfully.

Uploaded by

ijsret
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

International Journal of Scientific Research Engineering & Technology (IJSRET), ISSN 2278 0882

Volume 5, Issue 9, September 2016

An Image Binarization Algorithm for Scratches Removal and Restoration of


QR Code Using Spatial Point Processing Threshold
N.Poompavai1, Dr.R.BalaSubramanian2
1

(PG & Research Department of Computer Science, J.J. College of Arts and Science, Pudukkottai, Tamil Nadu, India
2
(PG & Research Department of Computer, J.J. College of Arts and Science, Tamil Nadu, India

ABSTRACT
The QR Code usage is increased every day. The QR
Code Images are damaged by scratch or scribbling on
it. The intention of this paper is to remove scratches on
The QR Code images using Spatial Thresholds. This
algorithm is a pre-process of decoding the QR Code. It
is to restore the various scratched QR Codes.
According to the experimental evaluation, it gives 98%
of the damaged QR Code images have been restored
and decoded successfully.
Keywords - Binarization, Enhancement, Image
Binarization, Pixels, QR Code, Spatial Thresholds

I. INTRODUCTION
Bar codes are widely used to store and retrieval
information on even tiny objects, because of its
size, reading speed, accuracy, 360 degree reading
and error correction capability. 1D barcodes have
the data only in horizontal direction with limited
data capacity. But 2D (QR Code) barcodes can
hold data in both horizontal and vertical direction
of QR Image. When QR code compares with 1D
barcodes, the data capacity is more than 100 times
of a QR Code Image. QR Code is invented by
Denso Wave Corporation, Japan in 1994. The
Quick Response Code (RQC) adapted with many
Japans Company like, Automatic Identification
Manufacturers Inc, Automotive Industry Action
Group,
Japan
Automobile
Manufacturers
Association, Japan Trucking Association, etc. The
QR Code is not only the encoding and decoding
process, beyond that it is a pure image processing
oriented.
A QR code is fundamentally an Image. This
image have place many places. This QR Image
can store up to 7,089 characters (numeric). QR
Code Image is already used in Japan for various
purposes as Air Ticket, Processed Food
Traceability Chain, and Blood Test Sheet Blood
Sheet etc., In India the QR Code Images are found
on Government issued documents such as pattachitta, income Certificates, Aadhar card, etc., from
this QR Codes are widely accepted technology for

fast access data around us. In present more than


100 websites to generate QR Code for personal or
official use with free of cost.
The QRC Image is everywhere around us. It may
be damaged or scratched at any time and any
place knowingly or unknowingly. This paper is to
restore the scratched QRC Image using Spatial
Threshold Image Binarization. Binarizing an
image symbolizing conversion of the image into
black and white, the intensity information will be
decreased to only two values either 0 or 1 and
this builds the processing easier in the following
stages to consider the various components of
performing manipulations particularly on QR code
image.
II. RELATED WORK
When QR Code is introduced by Denso Wave
Corporation, it started using automotive
industries. Now the whole word started using
QRC Image in even unexpected different places.
There is no limitation to use this QRC Image.
However it should be used for meaningful places.
There are many researcher doing the work on
QRC Image Restoration, enhancement, filtering,
etc., QRC Image gives researcher to do many realtime application oriented problem.
The Related works on Binarization have done
many researchers. Chien-Hsing Chou et al. [1], A
proposed method for Binarization by dividing the
image into set of blocks and use the machine
learning rules to categorize the different blocks of
the sub images.
J. Sauvola et. al. [2] had given a method which
performs a rapid classification of the local
contents of a page to background, images and
alphabets using the soft decision and Text
Binarization methods.
Bolan Su et al., [3] had developed a method using
an adaptive contrast map of input degraded
document image. The contrast map is then

www.ijsret.org

489

International Journal of Scientific Research Engineering & Technology (IJSRET), ISSN 2278 0882
Volume 5, Issue 9, September 2016

binarized and with Cannys edge map to identify


the text stroke edges. Efthimios Badekas et al [4],
proposed a method for Binarization of colour
images using dominant colour features of the
image. In each dominant portions of image
connected components are extracted and then
filtered using grouping procedure. The approach
of connection property is used to classify the text
and non- text areas of the image.
M. Ramirez et. Al., [5] had developed a thresholdbased local algorithm for image binarization. The
main aim is to compute a transition energy using
pixel value differences taken from a
neighbourhood around the pixel of interest. B.
Gatos et al., [6] implemented a pre-processing
procedure using low pass Weiner filter that
performs a rough estimation of foreground and
back ground objects of an Image.
The balanced histogram thresholding method [7]
is a very simple method used for automatic image
thresholding similar to Otsus method.
III. PROBLEM DEFINITION
There are many methods to convert colour image
to Binary Image. It changes only Black and White
Image. Otus method is the Global threshold for
all kinds of information. However, Otus
threshold fails when histogram value is low of
Image foreground or background. It is essential to
have QRC in all the printed objects. Most of the
QRC Image is Binary but some of the cases can be
two coloured images. When QRC Image is got
scratched on it. It is not decidable by the decoding
software. Because the image is very sensitive,
even it has the 30% of Reed Solomon error
correction. The binarization techniques are very
complex and are amalgamated from filters and
existing process. At the same time many
thresholding methods are available. But it cannot
be applied to binarization problems particularly to
recognize QR code images.

the Scratched and damaged QR Code images to


restore and decode process to a better level. The
proposed algorithm is to solve the damaged
QRCode Image is able to restore automatically.
IV. PROPOSED APPROACH
The Proposed approach is to restore the damaged
QRCode image. The actual QRCode image is
small in size, compare to the ordinary picture files.
The QRC Image Binarization and restoration
process is mainly in three stages. First, it scans the
complete damaged QRCode Image as RGB Color
Format and converted to Binary image according
to the RGB Pixel value. In Second stage, scan the
QRC Binary Image pixel by pixel, threshold value
is automatically calculated according the
neighborhood RGB Pixel values. The Third Step
is to build the new Binarized and Restored Image
for equal size of the input Image. The figure 1 and
figure 2 shows the pixel and neighborhood pixels.
But the border of the image pixel does not have
pixels around the pixel (in figure 2). The effective
Binarization and restoration process has done
using the spatial point processing method. In
figure 5, the flow of process for the proposed
approach is shown clearly.

The QRCode is powerful and convenient to store


data and read data often, because of its data
capabilities and Quick Reading. If it is damaged
like scratched or scribbled in any part of QRCode.
It cannot be read by the scanning software. It
possible to restore by using some photo-edit
software tools, however need some more time to
spend to do manual restoration. This paper
assures with a new approach for Binarization of
www.ijsret.org

Figure 1: Image Pixels (x, y)

Figure 2: Pixel and Neighborhoods Pixels

490

International Journal of Scientific Research Engineering & Technology (IJSRET), ISSN 2278 0882
Volume 5, Issue 9, September 2016

Consider the pixel (x,y) of an Image, the


neighborhood pixels can be retrieved from the
following formulas from its position of the pixel
value.
Each pixel has around pixels of (x,y) => { (x-1, y1), (x-1, y), (x-1, y+1), (x, y-1), (x, y+1), (x+1, y1), (x+1, y), (x+1,y+1)}.

Figure5: the Flow of Proposed Binarization


Figure 3: Calculations of Neighborhood Pixels of
(x, y)

V. PROPOSED ALGORITHM
Function QRCBinarization(Image img)
INPUT: Damaged image img
OUTPUT: Binarized and Restored QRC Image
BEGIN:

Figure 4: Neighborhood Pixels of top Left Corner


Pixel (x,y)
The figure 3 illustrate the neighborhood pixels
around the pixel(x,y) and figure 4 shows the
actual beginning of Image neighborhood pixels.
The same way neighborhood pixel value is
calculated. For Restoration, Scratches Removal
and binarization threshold value is deliberate by
comparing all the neighborhood pixel values with
the current pixel value. The nearest maximum
pixel value is taken to actual (x, y) point position.
This is done by sequentially all the pixel value in a
QRC Image. Because of the binary image is only
in Black and White, the RGB pixel value of Black
is -16777216 and White color RGB Value is -1.
Comparing these two values the white value is
biggest. A QRC Image does not have exactly even
numbers of pixel where the Black and white RGB
values. The clusters of Black pixels are also
having a few white pixels as well as the same in
the White cluster. The proposed approach is done
on spatial point processing method.

Load Image to Original Buffered Image Object


(RGB Image)
Get the size of image: Width as w and Height as h
of Image
Declare neighbor pixel array as na[w size]
Binarized Buffered Image Object to Binarized
Image (Binary Type)
For each pixel(x,y) in Original w and h do
else if(x!=0 && y!=0)
original.getRGB(x-1,y-1);

NeighborPixel of

else if(y!=0)
na[1]=original.getRGB(x,y-1);
else if(x!=w-1 && y!=0)
na[2]=original.getRGB(x+1,y-1);
else if(x!=0)
na[3]=original.getRGB(x-1,y);
else if(x!=w-1)
na[4]=original.getRGB(x+1,y);
else if(x!=0 && y!=h-1)
na[5]=original.getRGB(x-1,y+1);
else if(y!=h-1)
na[6]=original.getRGB(x,y+1);

www.ijsret.org

491

International Journal of Scientific Research Engineering & Technology (IJSRET), ISSN 2278 0882
Volume 5, Issue 9, September 2016

else if(x!=w-1 && y!=h-1)


na[7]=original.getRGB(x+1,y+1);
else
na[7]=original.getRGB(x,y);
If (NeighborPixels(x,y) White)
Binarized(x,y,White)
else if(NeighborPixel Black)
Binarized(x,y,Black)
else Binarized(x,y,OriginalPixel)
Next pixel(x, y)
End Loop
(b)

Write Binarized Image

Figure 6: Damaged QRC Images

END
VI. EXPERIMENTAL EVALUATION
The proposed Binarizing method is implemented
on Java programming on a personal computer of
Intel Dual core 2.66 GHz processor, 2 GB RAMS
on Windows7 Ultimate. The experimental
evaluation performed on Damaged QRCode
Image is created online for free of cost. The QRC
Image contains the data Hi! I am Poompavai.
The Input Damaged QR Code Images are shown
in figure 6. The Binarized Output Images are
shows on figure 7. From the experimental
evaluation is clearly shown output images are able
to scan QR Code by ordinary QR Code Software.

(a)

(a)

(b)
Figure 7: Output Images

www.ijsret.org

492

International Journal of Scientific Research Engineering & Technology (IJSRET), ISSN 2278 0882
Volume 5, Issue 9, September 2016

VII. CONCLUSION AND FUTURE WORK


The proposed approach is ultimately Restored and
Binarized of low quality QR Code Images like
Scratched, damaged and illuminated images. The
precision of the proposed algorithm was tested on
range of 50dpi to 96dpi images and the
experimental evaluation showcased that the
Restored and Binarized Image. The actual QRC
Image is not big size, so it does not take much
time to Binarize and Restore it. The image pixels
are sequentially scanned and changed. However it
performs sensible time duration. The proposed
approach can employ the binarization threshold in
parallel in future, in order to improve the speed of
binarization time taken.
VIII. REFERENCES
[1] M. Sezgin and B. Sankur.Survey over image
thresholding
techniques
and
quantitative
performance evaluation.Journal of Electronic
Imaging, 13:146{165, 2004.
[2] Otsu, N.: A threshold selection method
from gray-level histogram. IEEE Trans.
Syst.Man Cybern. 9(1), 6266 (1979)
[3] Chien-HsingChoua, Wen-HsiungLinb,, Fu
Chang, A binarization method with learning-built
rules for document images produced by cameras,
Pattern Recognition 43 (2010) 15181530.
[4] J. Sauvola, M. PietikaKinen, Adaptive
document
image
binarization,
Pattern
Recognition 33 (2000) 225}236.
[5] Bolan Su, Shijian Lu, Chew Lim Tan, A
Robust Document Image Binarization Technique
for Degraded Document Images, IEEE
TRANSACTION ON IMAGE PROCESSING.
[6] EfthimiosBadekas, Nikos Nikolaou, Nikos
Papamarkos, Text Binarization in Color
Documents, ' 2007 Wiley Periodicals, Inc.

Scanning, international Journal of Advanced


Technology in Engineering and Science Vol.No.4,
Special Issue No. 01, March 2016, ISSN 23487550.
[9] Ashna Thomas, Remya Paul, An Effective
Method for Removing Scratches and Restoring
Low -Quality QR Code Images, international
journal for advance research in engineering and
technology, Volume 1, Issue V, June 2013.
[10] Shraddha Bachkar, Prajakta Savkar, Sarika
Sarode, QR Images: an Automatic Method to
Embed QR codes in to Color Images,
International Journal of Computer Trends and
Technology (IJCTT) volume 23 Number 2
May 2015.
[11] Anjali Singh, Dr. Parvinder Singh, A
REVIEW: QR CODES AND ITS IMAGE PREPROCESSING METHOD International Journal
of Science, Engineering and Technology Research
(IJSETR) Volume 5, Issue 6, June 2016.
[12] Kinjal H. Pandya, Hiren J. Galiyawala, A
Survey on QR Codes: in context of Research and
Application, International Journal of Emerging
Technology and Advanced Engineering ISSN
2250-2459, ISO 9001:2008 Certified Journal,
Volume 4, Issue 3, March 2014
[13] Abhishek Mehta, QR Code Recognition from
Image, International Journal of Advanced
Research in Computer Science and Software
Engineering, Volume 5, Issue 12, December 2015
ISSN: 2277 128X.
[14] Abdulhakeem Aliyu Wara, Sunday Dugga,
Enhancing User Experience using Mobile QRCode Application, International Journal of
Computer and Information Technology (ISSN:
2279 0764) Volume 03 Issue 06, November
2014.

[7] Marte A. Ramrez-Ortegn, Ernesto Tapia,


Lilia L. Ramrez-Ramrez, Ral Rojas, Erik
Cuevas, Transition pixel: A concept for
binarization based on edge detection and grayintensity histograms, Pattern Recognition
01/2010; 43(4):1233-1243.
[8] Linda John, Debyani Mitra, Sayli More,
Automatic Toll Collection using Qr Code
www.ijsret.org

493

You might also like