Anda di halaman 1dari 4

HC2D Barcode Reader using Embedded Camera in

Android Phone

Puchong Subpratatsavee, Narongrit Janthong, Preeyawal Kuha, Chanchira Chintho
Faculty of Science at Si Racha
Kasetsart University Si RaCha Campus
Chonburi, Thailand
puchong.sp@gmail.com, narong.jt@gmail.com, srcpwk@ku.ac.th, amazon.hero.v6@gmail.com



Abstract The HC2D barcode is a highest capacity of 2D
barcode while it occupies a small area. The size of the HC2D
barcode is suitable for displaying on print media such as paper
and poster. But, for reading the HC2D barcode, the bit
representation of the barcode is obtained by scanning the image
of the barcode with scanner machine only. This paper shows the
implementations of image reorganization of HC2D barcodes in
mobile phones with android operating system. The mobile phone
system used here consists of a camera, mobile application and
display device, and the source image is captured by the
embedded camera device. The introduced algorithm is based on
the code area found by two vertical line, one horizontal line and
dash line detection of HC2D barcode. This algorithm is robust
for the real-time recognition of the HC2D barcodes and an
average recognition rate is 91.33%.
KeywordsHC2D barcode; android; embedded camera
I. INTRODUCTION
Nowadays, almost of mobile phones have embedded
camera devices, and some of those have more than over mega-
pixel range image sensor cameras. Also, the embedded camera
devices can be used as new input interfaces such as for symbol
recognition. In the recent, most mobile phones, with camera
devices support symbol recognition, such as 1D barcode and
2D barcode [1] (PDF417 barcode [2], data-matrix barcode [3],
and QR code [4]) and these code symbols are used for reading
URLs or plaintext. HC2D barcode [5] is largest capacity of 2D
barcode for communication, public relations, and data
transport. However, in general, the HC2D barcode can
recognition only in scanner machine.
This paper presents HC2D Barcode readers using the
embedded camera device in mobile phones. The purpose is to
design a new image recognition algorithm for read the HC2D
barcode in real time mode. This paper consists of five sections.
II. HC2D BARCODE
A HC2D barcode is a 2D barcode which consists of a black
square pattern on white background. The HC2D barcode
contains information in the vertical direction as well as the
horizontal direction. The data capacity can be the maximum of
7,250 numeric characters, 10,100 ASCII characters. HC2D
barcode use the Reed-Solomon [6] error correction which can
detect and correct multiple errors and HC2D barcode have an
option to compression data its powerful for a large of data.
HC2D barcode can be read by standard scanners machine. The
HC2D barcode is a greater capacity than other 2D barcodes.
Moreover, the shape of HC2D barcode is suitable for use with
paper documents or print media. The HC2D barcode are shown
in Fig. 1.


Fig. 1. The HC2D barcode

The HC2D barcode consists of a vertical line on the left of
the barcode and a horizontal line on the bottom. The top of the
vertical line is a detection point. Another detection point is
where the vertical line and horizontal line meet. The dash line
on the top is used for sampling column widths. The vertical
line on the right is the stop indicator. Finally, the data area is
configured as a 63x448 matrix which can store black and white
pixels up to 28,224 pixels. The characteristics of the HC2D
barcode are shown in Fig. 2.


Fig. 2. The characteristics of HC2D barcode
2014 11th International Joint Conference on Computer Science and Software Engineering (JCSSE)
254
978-1-4799-5822-1/14/$31.00 2014 IEEE
III. ERROR DETECTION AND CORRECTION
Regardless of the design of the two-dimensional barcode,
there will be errors. The image of the barcode may be
damaged or unclear. In other words, the barcode obtained
from scanning differs from the original. Therefore, it is
essential to be able to detect and correct errors which may
occur. There are many techniques for error detection and
correction. A multiple bits error correction method based on
cyclic redundancy check (CRC). The error correction which is
widely used is Reed-Solomon code. This is because it is
easier to encode than other encoding techniques and the error
correction code is small. Moreover, error detection and error
correction can be performed quickly and efficiently. Reed-
Solomon codes are prominently used in consumer electronics
such as CDs DVDs, and Blue-ray Discs. The Reed-Solomon
error correction is also used in two-dimensional barcodes such
as PDF417 barcode, Data matrix, Maxi Code, QR Code and
Aztec Code. This allows correct reading even though a
portion of the barcode is damaged.
IV. BARCODE RECOGNITION ALGORITHM
In the process of HC2D barcode recognition, researcher
suppose that each image taken by the camera device of mobile
phone should have the completed HC2D barcode for lower the
computation. The HC2D barcode expected algorithm, as
characterize in Fig. 3, is split into three section: image pre-
processing, edge detection, and image decoding.















Fig. 3. The HC2D barcode expected algorithm
A. Image Pre-processing
1)Grey-scale processing: It serves the arrangements for the
threshold of the digital image transformation. Grey characterize
any shade between black and white collectively, white, black
and the range of greys between them are known as achromatic
colors or neutral colors.
2)Image sharpening: in consideration to make the image
become clearer, researcher do some sharpening process to the
blurred HC2D barcode image. The significance of the blurred
image is the attenuating of the high frequency component. So
researcher apply laplacian [7] sharpening algorithm to sharpen
the grey scale image. Laplacian operator is generally used
image sharpening technicians, it can be described by this
formula.

Where explains the pixel value of a grayscale
image. From above formula, the Laplacian operator indicate
the kind of one pixel relation to its enclosing four pixels. When
it is used to get the sharpened image, the sharpened pixel value
is


Where k is parameter about with scatter effect, and it
should be chosen reasonably conforming to the practice
situations, since it affects the sharpening effect directly.
3)Image binarization: its means that researcher should
convert the grayscale image into binary image through the
threshold conversion ideas. For the binarization a dynamic
threshold is needed, also, it is very essential. Researcher are
most involved about the HC2D barcode in the entire image, so
researcher get an image of 80*80 pixels in the canter, after that
researcher get the grey histogram, finally, researcher get the
threshold T through the two-peak method. The threshold T can
productively divide bars and empty bars of the HC2D barcode.
In conformity with the following formula researcher will get
the binary image g(x,y).

4)Median filtering: There are a lot of noise in the binary
image because the brightness of the master image are not well-
formed and the background images are not the identical, not
only in the area of the barcode, but also in the outside of the
area. For obtain the appropriate barcode, then researcher use
some filter processing. Since the characteristic of the HC2D
barcode, median filtering is a good method. First of all,
researcher get another four pixels approximately the pixel
which will be processed, two in the above and two in the
following; then, researcher sort the five pixels; at last,
researcher use the median instead of the current pixel. In this
way, salt and pepper noise is eliminated, and background area
of the noise can be quiet.
B. Edge Detection
Edge detection is a basic tool used in most image
processing applications to get data from the frames as a
predecessor step to feature extraction and object segmentation.
Since the characteristic of the HC2D barcode, researcher use
vertical-based edge detection and horizontal-based edge
detection operators. The pixel which will be detected is
determined by ten nearness pixels. The value of S(x,y) is
Edge
Detection
Image pre-
processing
Image
Decoding
Data
Barcode image

2014 11th International Joint Conference on Computer Science and Software Engineering (JCSSE)
255
complete of the sum of ten modules. Since the edge detection
image is a binary image, ether white (255) or black (0),
researcher set the criterion t = 255 X 4 = 1020, so if the pixel
is called an edge, there are must at least four black and white
mutations in this nearness. In conformity with the following
formula researcher obtain the binary image h(x,y).



After detected edge of HC2D barcode, then go to the top
of left edge and read the dash line on the top of HC2D barcode
for sampling the column width.
C. Image Decoding
For reading the HC2D barcode, the bit representation of the
barcode is obtained by scanning the image of the barcode by
camera device of mobile phone and converting the image.
After obtaining the barcode which may be damaged, the Reed-
Solomon error correction is performed. If the original data was
previously compressed, the resulting data is then
uncompressed. If there is an error in correcting the code, data
decompression will generate an error. Otherwise, the original
data will be obtained. The process for reading the HC2D
barcode is shown in Fig. 4.

















Fig. 4. The process for decoding data from a HC2D
barcode
In order to detect the error correction level, the algorithm
first processes the first pixel group as the low error correction
level. If the header is obtained correctly, the error correction is
at the low level. Otherwise, the algorithm processes the first
pixel group at the high error correction level. The header
verification is done using the checksum field. If the checksum
value matched the one calculated, the assumed error correction
level is accurate.
V. EXPERIMENTAL RESULTS
After the text edit has been completed, the paper is ready
for the template. Duplicate the template file by using the Save
As command, and use the naming convention prescribed by
your conference for the name of your paper. In this newly
created file, highlight all of the contents and import your
prepared text file. You are now ready to style your paper; use
the scroll down window on the left of the MS Word Formatting
toolbar.
To perform experiments, researcher implement an
algorithm in the platform of Android 4.3 on Mac OS by using
the language of Java, then import the program to Samsung
galaxy note 3. This experiment take 600 images by using the
Samsung galaxy note 3 in different places and lighting
conditions, 150 of them are taken in the room during the
daytime, 150 of them are taken outdoors during the day, 150 of
them are taken in the room at night, others are taken outdoors
at night. From the 600 images, 52 of them cannot be decoded
correctly, with an average recognition rate of 91.33%. The
results are shown in Table 1.
The falsity come from two reason: One is from the image
light, because of the recognition exactitude of the boundary
between the black and white parts, the lighting situation are
very essential. The other is the form of the image, if the image
is a severely distorted one, it will get the incorrect consequence
after edge detection and image segmentation, not to claim the
exact barcode. Fig. 5 shows an example of experimental results
using our algorithm.
TABLE I. THE RESULTS OF HC2D BARCODE RECOGNITION
Data items Images

Correct
decoding
Recognition
rate
In the room
(daytime)

150

138

92%
Outdoors
(daytime)

150

140

93.33%
In the room
(night)

150

136

90.67%
Outdoors
(night)

150

134

89.33%

Total

600

548

91.33%


Fig. 5. Example of experimental results.
HC2D Barcode
Reed-Solomon
Uncompressing
Message
2014 11th International Joint Conference on Computer Science and Software Engineering (JCSSE)
256
VI. CONCLUSION
This paper presented an algorithm for HC2D barcode
recognition on mobile phone. As show in experimental results,
our algorithm has a high recognition rate. In the next,
researcher will make the HC2D barcode recognition more
exact and helpful for improving the algorithm to retreat the
decoding time.
REFERENCES
[1] J.Z. Gao, L. Prakash, R. Jagatesan, Understanding 2D-BarCode
Technology and Applications in M-Commerce Design and
Implementation of A 2D Barcode Processing Solution, 31st Annual Intl
. Computer Software and Applications Conference (COMPSAC 2007).,
pp. 49-56, vol. 2, Jul. 2007.
[2] C. Rong, L. Zhen-ya, J. Yan-hu, Z. Yi, and T. Li-yu, Coding Principle
and Implementation of Two-Dimensional PDF417 Bar code, 6th IEEE
Conference on Industrial Electronics and Applications., pp. 466-468,
Jun. 2011.
[3] L. Biao, A DataMatrix-based mutant code design and recognition
method research, Proceedings of the 4th international conference on
image and graphics., pp. 570-574, Aug. 2007.
[4] M. Warasart and P. Kuacharoen, Paper-based Document
Authentication using Digital Signature and QR Code,
[5] International Proceedings of Computer Science and Information
Technology, ISSN 2010-460X, International Conference on Computer
Engineer-ing and Technology., pp. 94-98, vol. 40, Jun. 2012.
[6] P. Subpratatsavee and P. Kuacharoen, An Implementation of a High
Capacity 2D Barcode, Communications in Computer and Information
Science, Springer, ISSN 1865-0929, 5th International Conference on
Advances in Information Technology., pp. 159-169, vol. 344, Dec. 2012.
[7] S. Mamidi, M.J. Schulte, D. lancu, A. lancu, and J. Glossner,
Instruction Set Extensions for Reed-Solomon Encoding and Decoding,
16th IEEE International Conference on Application-Specific Systems,
Architecture Processors, pp. 364-369, Jul. 2005.
[8] L. Zhang, H. Ying, X. Jiazhi, X. Xuexiang, and C. Wei, Real-Time
Shape Illustration Using Laplacian Lines, IEEE Transactions on
Visualization and Computer Graphics., vol. 17, pp. 570-574, Aug. 2007.

2014 11th International Joint Conference on Computer Science and Software Engineering (JCSSE)
257

Anda mungkin juga menyukai