Segmentation of Handwritten Text in Gurmukhi Script: Rajiv K. Sharma
Segmentation of Handwritten Text in Gurmukhi Script: Rajiv K. Sharma
Segmentation of Handwritten Text in Gurmukhi Script: Rajiv K. Sharma
Amardeep Singh
Abstract
Keywords: Character Segmentation, Middle Zone, Upper Zone, Lower Zone, Touching Characters.
Handwritten, OCR
1. INTRODUCTION
In optical character recognition (OCR), a perfect segmentation of characters is required before
individual characters are recognized. Therefore segmentation techniques are to apply to word
images before actually putting those images to reorganization process. The simplest way to
segment the characters is to use inter – character gap as a segmentation point[1]. However, this
technique results in partial failure if the text to be segmented contains touching characters. The
situation becomes grim if text consists of handwritten characters. The motivation behind this
paper is that to find out a reasonable solution to segment handwritten touching characters in
Gurmukhi script. Gurmukhi script is one of the popular scripts used to write Punjabi language
which is one of popular spoken language of northern India. Because our work is related with
segmentation of Gurumukhi script, so it is better to discuss some characteristics of the said script
so that the reader can have a better idea of the work.
Consonants (Vianjans)
Other symbols
Japanese and Arabic scripts, the existing algorithms for character segmentation of these scripts
does not work efficiently for handwritten Gurmukhi script.
3. PREPROCESSING
Preprocessing is applied on the input binary document so that the effect of spurious noise can be
minimized in the subsequent processing stages. In the present study, both salt and peeper noise
have been removed using standard algorithm [4]. It is supposed that height and width of document
can be known easily. The image is saved in the form of an array. For that purpose a 2-D array
with number of rows equal to height of the document and number of columns equal to width of the
document is created. Calculate the maximum intensity of pixels in the document using any
standard function available in the tool used for the implementation, it is getRGB() method
available in java. Scan every pixel of document and compare its intensity with the maximum
intensity. If the intensity is equal to maximum intensity, store one in the array at that location, and
if it is not equal store zero in the array.
ii. Start from the first row and count the number of 1’s in that row. If it is zero, move to next
row. And if it is not zero, that is the starting location of that line. Store that location in the
array.
iii. Check consecutive rows until we get 0.The before we get zero is the ending location of that
line. Store that value in the array.
iv. Also calculate the location of maximum intensity in each line and store it in the second
column before that line. It would be used as the starting position of characters.
v. Repeat step (ii) to (iv) for the whole document.
Word Detection
The following procedure is implemented to find location of words in each line.
i. Create a 2-D array.
ii. For each line move from 0th pixel up to width.
iii. Calculate the number of one’s in first column from the starting location of line to the ending
position of line.
iv. If number of 1’s are not zero, that is the starting location of word. Save that location in that
array. Keep on moving to the right until we get no one in any column. The column with 0
1’s is the ending location of the word. Store that location in array too.
v. Repeat this until we reach the width.
vi. And repeat step (ii) to (v) for each line.
Character Detection
The following procedure is implemented to find the location of character in each word.
i. Create a 3-d array. Its first index will represent line number. Second index will represent
word number and third index will contain the location of character. This array will be
created dynamically.
ii. Repeat the step (iii) to (iv) for each line and each word detected so far.
iii. Move from starting position of the word to the ending position of the word.
iv. Start from the starting position of line and move downwards to the ending position. Count
the number of one’s in that column leaving the location of line with maximum intensity. If it
is not zero, that is the starting position of character. Move to right until we get column with
no ones. that will be the ending location of character.
This process will generate the location of characters.
The above approach was put to number of documents; the image of one such scanned document
is given below.
The main objective of the work was to segment the lines, words and to segment the touching
characters present in handwritten document in Gurmukhi script. We obtained the following table
after putting handwritten Gurmukhi documents for segmentation. The results are summarized as
in following tables:
lower zone were considered as a different line. The correctly detected lines were further put to
word detection algorithm. Here the results were good, but sometimes when the words were not
joined properly then that was detected as a different word. The locations of the detected words
were used to segment the characters. At few point segmentation was good but at few point it was
not upto the expectations. This may be because of the similarity in the shapes of few characters.
All these issues can be dealt in the future for handwritten documents written in 2-dimensional
script like Gurumukhi by making few changes to proposed work.
6. REFERENCES
1. Y. Lu. “Machine Printed Character Segmentation – an Overview”. Pattern Recognition,
vol. 29(1): 67-80, 1995
5. Veena Bansal and R.M.K. Sinha. “Segmentation of touching and Fused Devanagari
characters, ". Pattern recognition, vol. 35: 875-893, 2002.
9. Rajean Plamondon, Sargur N. Srihari. “On – Line and Off – Line Handwritting
Recognition: A Comprehensive Survey”, IEEE Transaction on Pattern Analysis and
Machine Intelligence, Vol 22(1). Janurary, 2000.
10. Giovanni Seni and Edward Cohen. “ External word segmentation of off – line handwritten
text lines”. Pattern Recognition, Vol. 27(1): 41-52, 1994.