Download Ancient Tamil Script Recognition from Stone Inscriptions Using Slant

yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts

Affective computing wikipedia , lookup

Image segmentation wikipedia , lookup

Visual servoing wikipedia , lookup

Speech recognition wikipedia , lookup

Scale-invariant feature transform wikipedia , lookup

Histogram of oriented gradients wikipedia , lookup

Facial recognition system wikipedia , lookup

Pattern recognition wikipedia , lookup

International Conference on Electrical, Electronics and Biomedical Engineering (ICEEBE'2012) Penang (Malaysia) May 19-20, 2012
Ancient Tamil Script Recognition from Stone
Inscriptions Using Slant Removal Method
S. RajaKumar, Dr. V. Subbiah Bharathi
effect on the recognition accuracy if non-uniform slant
correction is applied to the training and testing images,
respectively. The remaining part of the paper is organised as
follows. Next, the normalisation steps applied to the images of
ancient Tamil text including the non-uniform slant correction
are described. Section 3 presents the ancient text line
recognition system. Experiments and results are discussed in
Sect. 4 and conclusions are drawn in the last section of the
Abstract— In this paper we apply a novel non uniform slant
correction preprocessing technique to improve the recognition of
offline ancient Tamil text lines. The local slant correction is
expressed as a global optimization problem of the sequence of local
slant angles. This is different to conventional slant removal
techniques that rely on the average slant angle. In conventional slant
correction techniques the average slant angle is estimated and
uniformly corrected by a shear transformation. This angle can be
estimated by averaging the angles of near vertical strokes, by
analyzing projection histograms, or by statistics of chain-coded
stroke contours. These techniques perform well under the assumption
that the text line is return with a constant slant. However the slant
angle fluctuates not only between different words, but in some cases
at every character in a word.
Keywords—Ancient Tamil Stone
Extraction, Slant Removal, Normalization.
To reduce the impact of different writing styles, a stone
inscription text line image is normalized. In the recognition
system used for the experiments described in this paper, the
normalisation steps described in [11] are applied. Then, the
images are transformed using the non-uniform slant correction
introduced in [14].
In the first phase, the images of stone inscription text lines
are normalised with respect to skew, slant, and baseline
position. The skew angle, the slant angle and the position of
the upper and the lower baseline are determined globally. The
skew correction aligns a line of text with the x-axis of the
image and corrects rotations that may have occurred during
the writing. The goal of the slant correction is to bring the
writing in an upright position. For each line the angle to the
vertical axis is corrected. The baseline position correction is
an operation based on vertical translation and scaling. The
writing is transformed into a standard position and the height
is normalised. We refer to [11] for more details about these
normalisation steps.
In the second phase the non-uniform slant correction is
applied. Assume an M(width) x N(height) text line image. The
problem of the non-uniform slant correction is equivalent to
the problem of estimating the local slant angle at each
horizontal position i ϵ [1, M]. In order to represent the local
slant angle at i, consider a line segment from (i, 1) to (p i , N),
where p i denote the horizontal position of the upper-end of the
line segment. Hereafter, this line segment is called the ith
correction line. Note that the lower-end of the ith correction
line is fixed at (i, 1) while the upper-end is movable
horizontally by controlling the variable p i . Figure 1 shows
several correction lines. The slope of the ith correction line
(i.e., tan −1( pi − i ) / N ) expresses the local slant at position i.
NCIENT Tamil character recognition from stone
inscription is a challenging problem in pattern
recognition area. The difficulty is mainly caused by the large
variations of individual writing style. Robust feature
extraction is very important to improve the performance of
Ancient Tamil character recognition system. This paper
concentrates on the problem of different writing styles it is
usually addressed by normalizing the input images before they
are fed in to the recognizer specifically we are interested in
writing style that show a non-uniform slant. These types of
characters have been handling rather poorly by previous
recognition system.
In conventional slant correction techniques the average
slant angle is estimated and uniformly corrected by a shear
transformation. The contribution of this paper is twofold.
First, the non-uniform slant correction is applied to entire text
lines for the first time. Second, we investigate the impact of
the novel slant correction technique on the recognition
performance by conducting experiments with a state-of-the-art
ancient Tamil text line recognition system. We examine the
S.Rajakumar is a research scholar at Sathyabama University, Chennai,
India phone:+91-7299305528; e-mail:[email protected].
Dr.V.Subbiah Bharathi was with Eswari Engineering College, Chennai. He
is now as the Principal of DMI College of Engineering, Chennai, India (email: [email protected]).
International Conference on Electrical, Electronics and Biomedical Engineering (ICEEBE'2012) Penang (Malaysia) May 19-20, 2012
between the slopes of the ith and (i-1) th correction lines. Thus,
the maximisation of γ ( pi | pi − 1) smoothes the transition of
Consequently, the estimation of local slant angles can be
treated as a problem of optimising the slope of the correction
line at i = 1,….,M. Since the slope of the ith correction line is
fully controlled by pi, the non-uniform slant correction
problem is finally reduced to an optimization problem
p 1 ,…, p i ....,p M .
p1 …
pi-1 pi
the local slant angles together with the constraint of
(2).Several characters, in Tamil have long strokes with
inherent slants. Those inherent slants may be “over-corrected”
by the effect of si ( pi ) . The last function ci ( pi ) is introduced
to avoid the overcorrection. The function ci ( pi ) evaluates the
similarity between the local slant angle by pi and an average
slant angle in a neighbourhood of the ith correction line. The
average slant angle is calculated by averaging the slope of the
character contour in the neighbourhood. Since the average
slant angle is rather insensitive to the above inherent slants,
ci ( pi ) is useful to suppress over-corrections. The function
i-1 i
also has an effect of stabilising the estimated local slants.
The optimization problem of p 1 ,…, p i ,...,p M can be treated
as an optimal path problem . The path starts from i = 1 and
ends in i = N on the i—p i search graph. If the path passes
through (i, p i ) next to (i-1, p i-1 ) on the search graph, we have
the gain fi(pi|pi − 1 ) .Clearly, the sum of the gains along the
Fig. 2 Ancient Tamil character representation of non-uniform slant
angles by correction lines
Observation of text lines for designing an optimization
criterion reveals that the local slant angles have two
(i) long near-vertical strokes tend to exhibit local slant angles
clearly, and (ii) the left-to-right transition of the local slant
angles is smooth. The variable p i should be optimised so that
the slope of the ith correction line is similar to the slopes of
long near-vertical strokes around the horizontal position i and
the slopes of consecutive correction lines are similar to each
According to the above discussion, the non-uniform slant
correction problem is defined as follows: Maximize
F(p1,...,pi ,...,pM ) = ∑ fi(pi|pi −1 )
i =1
With respect to p 1 ,…, p i ....,p M , subject to
0 ≤ pi − pi −1 ≤ 2,
| pi −1 |≤ W ,
path becomes the objective function of (1). The shape and
range of the path are regulated by the constraints (2) and (3),
respectively. It is well known that the optimal path problem
can be solved efficiently by dynamic programming. The
algorithm proceeds from i = 1 to M (i.e., from left to right in
the search graph). At each (i, p i ), the algorithm calculates
g (i , pi ) =
[ fi ( pi | pi −1 ) + g (i −1, pi −1 )]
0≤ pi − pi −1 ≤ 2
Where g (i − 1, pi − 1) ) is the maximum accumulated gain up
to (i − 1, pi − 1) . This equation implies that the maximum
accumulated gain can be calculated recursively. Thus, after
the algorithm reaches i = M, we can obtain the maximum of
the objective function as max pM g ( M , pM ) . The optimal path
i.e., the optimal sequence p 1 ,…, p i ....,p M is obtained by
tracing back the selection of p i-1 at p i . The slant corrected text
line image is then obtained by the optimal sequence p 1 ,…,
p i ....,p M . Specifically, the image is obtained by mapping
pixels on the correction line between (i, 1) and (p i , N) linearly
onto the vertical line between (i, 1) and (i, N). This mapping is
formally represented as (( p − i ) j / N + i, j )  (i, j ) .
is a function to evaluate a
fi ( pi | pi − 1)
“goodness” of the ith correction line specified by p i , and W is
a positive constant. The details of fi ( pi | pi − 1) will be
described below. Constraint (2) is imposed to smooth the
transition of the local slant angles and constraint (3) to specify
as [− tan −1(W / N ), tan −1(W / N )]. The function fi ( pi | pi − 1)
is defined as a weighted sum of three functions,
si ( pi ), γ ( pi | pi − 1)
ci ( pi ) .The first function
After these normalisation steps, a stone inscription text line
is converted into a sequence of feature vectors. For this
purpose a sliding window with a width of one pixel is used.
The window is moved over the image from left to right, one
pixel at each step. Nine geometrical features are extracted at
each position of the window. The first three features contain
the number of foreground pixels in the window and the first
and the second order moment of the foreground pixels.
Features four and five contain the position of the upper and
si ( pi ) becomes larger if a longer stroke is on the correction
line. Thus, by the maximisation of c , the slope of the ith
correction line will become similar to the slope of a long nearvertical stroke, which will exhibit a local slant angle clearly.
The second function γ ( pi | pi − 1) evaluates the similarity
International Conference on Electrical, Electronics and Biomedical Engineering (ICEEBE'2012) Penang (Malaysia) May 19-20, 2012
the lower contour is stored in features number six and seven.
The last two features contain the number of vertical blackwhite transitions and the pixel density between the upper and
the lower contour. In the Hidden Markov Model (HMM)
based recognition each character is modelled with a linear
HMM. The number of states is chosen individually for each
character [17], and twelve Gaussian mixture components are
used to model the output distribution in each state. Based on
the lexicon, word models are built by concatenating character
models. The Baum-Welch algorithm is used for the training of
the HMMs, whereas the recognition is performed by the
Viterbi algorithm. A statistical bigram language model at the
word level supports the Viterbi decoding step. The integration
of this language model is optimised on a validation set as
described in [17].
iii. Sort a i as sorted _ a i , calculate third quantile
 3
Q3 = sorted _ ai , i = h × 
 4
iv. Trace number of pixel from first row to middle line
for k =1..mid
if ak ≥ Q3 then
upperbaseline = k ; break;
v. Trace number of pixel from h to mid
for k = h..mid
if a k ≥ Q3 then
baseline = k ; break;
B. Slant angle estimation and correction
Slant correction is an indispensable technique for both
holistic and analytical stone inscription word recognition [3].
Accordingly, a detailed review of uniform/non-uniform (local)
slant correction techniques is presented in section 2. However,
it is widely demonstrated in IAM benchmark database that
slant of all characters composing a word is uniform.
Therefore, most of the researchers dealt with uniform slant
angle detection and correction [3, 4, 5, 12, 15, 16, 17].Hence,
proposed technique is based on structural features of the first
character and targets uniform slant angle estimation. This not
only reduces computational complexity but also yields good
results. To estimate slant angle, maxima and minima of first
character are detected and connected by a straight line (See
figure 2). The proposed algorithm for slant angle estimation is
presented as under.
In this section, algorithms described have been tested on
ancient Tamil stone inscription images. The black pixels
(foreground pixels) in the binary word images represent the
characters whilst the white pixels are used to represent
A. Core-region Detection
Our approach is based on enhanced horizontal density
histogram embedded with quantile features to detect core
region of stone inscription images. Quantiles are points taken
at regular intervals from the cumulative distribution function
(CDF) of a random variable. Dividing ordered data into q
essentially equal-sized data subsets is the motivation for
q-quantiles; the quantiles are the data values marking the
boundaries between consecutive subsets. The proposed
technique is slightly modified but it demonstrates to be more
effective than [5] even in the presence of long horizontal
strokes and erratic characters. Initially, middle line of the
image is detected by constructing horizontal density
histogram. The peak of horizontal histogram is the middle
line. A threshold is calculated using quantile on the sorted
data of horizontal histogram. In the horizontal histogram from
first row to middle line, the line with count number of pixel
greater or equal to threshold (third quantile) is detected as
upper-base line. Similarly, from last row to middle line, the
line greater than or equal to threshold is the baseline.
Proposed algorithm is presented as below.
Let say an image denoted by P where P ϵ{0,1}
Let say an image denoted by P where P ϵ{0,1}
i = 1,2..., h
pi , j ∈ P 
 j = 1,2,..., w
h, w is height and width of P respectively.
i. Take left most p = pi , j | pi , j = 1 define it as p1 = ( x1 , y1 )
|| d1 ||= ( x2 − x1) 2 + ( y2 − y1 ) 2
i, j , i
= 1,2,..., h
& d 2 as distance of p 2 – p 3
|| d 2 ||= ( x3 − x 2 ) 2 + ( y3 − y2 ) 2
v. calculate slope to set shear direction k (clockwise or
y − y1
, if m < 0 then k =-1 else k =1 ;
m= 2
x2 − x1
ii. Take first maxima from left most as p2 = ( x2 , y2 )
iii. set p3 = ( x2 , y1 )
iv. calculate d 1 as distance of p 1 – p 2
i = 1,2..., h
pi , j ∈ P 
 j = 1,2,..., w
Where h, w is height and width of P respectively.
i. Compute number of foreground pixel each rows
ai =
d 
vi. Calculate slant angle θ = k × sin −1  2 
 d1 
vii. If θ >15 then shear P as
j =1
ii. Define middle line (mid) as index of max(a i )
mid = max(a i )
International Conference on Electrical, Electronics and Biomedical Engineering (ICEEBE'2012) Penang (Malaysia) May 19-20, 2012
0  i 
sin(θ )
p' = 
θ )  j 
independent recognition, decreases. All differences are
statistically significant at the 99% level. The results on the
validation and test set are summarised in Table. 1.
It is mention worthy that proposed technique has no
negative impact to non-slanted words and is equally suitable
for the slanted characters slope either clockwise or anti
In this paper, new and enhanced preprocessing techniques
Baseline System
Non-Uniform Slant
(Train & Test)
All experiments reported in this section make use of the
HMM based recogniser described in Sect. 3. The stone
inscription text lines used to train validate, and test the
proposed system originate from the IAM1 database [12]. The
baseline system we use applies all steps of the first preprocessing phase described in Sect. 2, including skew,
baseline and uniform slant correction. To test the effect of the
proposed non-uniform slant normalisation we conducted two
experiments. In the first experiment the trained HMMs of the
baseline system are used to recognise the non-uniformly slant
corrected lines in the validation and test set. The motivation is
that the diversity among the character instances in the training
set, which is an important issue in ancient Tamil character
recognition [15], is higher if no non-uniform slant correction
is applied. In the second experiment the HMMs are trained
and tested using the text line images with non-uniform slant
correction. The results on the test set are as follows. If we
apply the non-uniform slant correction to the test set only and
use the trained HMMs of the baseline system the recognition
accuracy increases from 64.5% to 65.8%. Thus, we can
benefit from the additional normalisation step to improve the
performance of our handwriting recognition system. However,
if the non-uniform slant correction is applied to both, training
and test images, the word level accuracy drops to 62.7%.
for off-line ancient Tamil character recognition have been
presented. Enhanced technique for core-region detection
exhibits better results than [5] generally and particularly for
erratic words. All proposed techniques are tested on
benchmark database of handwritten words. Accuracy rate up
to 94% and 96% were found for lower baseline and upper
baseline detection respectively. Finally, slant angle estimation
and correction approach was successful in 95.74% cases.
Simplicity of the proposed slant correction approach reduced
computational complexity significantly. Hence, it avoided
heavy experimental efforts required to find the optimal
configuration of a parameter set. Moreover, long exploration
of the parameter space is avoided. Some problems may arise
when a word includes characters with different slants.
Consequently, we are concentrating to update our approach to
deal with non-uniform slanted words. Finally, it is worth to
mention that slant angle estimation technique is equally
suitable for cursive Tamil character recognition.
Fig. 2 Recognized characters from Tamil stone inscriptions
Obviously, the normalisation of the training set has a
negative impact. A possible explanation is that the diversity of
the training samples, which is an important aspect in writer
L. Bauer. Manual of Information to Accompany TheWellington Corpus
of Written New Zealand English. Department of Linguistics, Victoria
University, Wellington, New Zealand, 1993.
R. M. Bozinovic and S. N. Srihari. Off-line cursive script word
recognition. IEEE Transactions on Pattern Analysis and Machine
Intelligence, 11(1):68–83, 1989.
A. Britto-Jr, R. Sabourin, E. Lethelier, F. Bortolozzi, and C. Suen.
Improvement stone inscription numeral string recognition by slant
normalization and contextual information. In 7th International Workshop
on Frontiers in Handwriting Recognition, Amsterdam, The Netherlands,
pages 323–332, 2000.
Y. Ding, F. Kimura, Y. Miyake, and M. Shridhar. Accuracy
improvement of slant estimation for stone inscription words. In
International Conference on Pattern Recognition, Barcelona, Spain,
volume 4, pages 527–530, 2000.
W. N. Francis and H. Kucera. Brown corpus manual, Manual of
Information to accompany A Standard Corpus of Present-Day Edited
American English, for use with Digital Computers. Department of
Linguistics, Brown University, Providence, USA, 1979.
J. Goodman. A bit of progress in language modeling. Technical Report
MSR-TR-2001-72, Microsoft Research, 2001.
International Conference on Electrical, Electronics and Biomedical Engineering (ICEEBE'2012) Penang (Malaysia) May 19-20, 2012
S. Johansson, E. Atwell, R. Garside, and G. Leech. The Tagged LOB
Corpus, User’s Manual. Norwegian Computing Center for the
Humanities, Bergen, Norway, 1986.
E. Kavallieratou, N. Fakotakis, and G. Kokkinakis. Slant estimation
algorithm for ocr systems. Pattern Recognition, 34(12):2515–2522,
G. Kim and V. Govindaraju. A lexicon driven approach to stone
inscription word recognition for real-time applications. IEEE
Transactions on Pattern Analysis and Machine Intelligence, 19(4):366–
379, 1997.
G. Kim, V. Govindaraju, and S. Srihari. Architecture for stone
inscription text recognition systems. In S.-W. Lee, editor, Advances in
Handwriting Recognition, pages 163–172. World Scientific Publ. Co.,
U.-V. Marti and H. Bunke. Using a statistical language model to
improve the performance of an HMM-based cursive handwriting
recognition system. International Journal of Pattern Recognition and
Artificial Intelligence, 15:65–90, 2001.
U.-V. Marti and H. Bunke. The IAM-database: an English sentence
database for offline handwriting recognition. International Journal on
Document Analysis and Recognition, 5:39 – 46, 2002.
A. Senior and A. Robinson. An off-line cursive handwriting recognition
system. IEEE Transactions on Pattern Analysis and Machine
Intelligence, 20(3):309–321, 1998.
E. Taira, S. Uchida, and H. Sakoe. Nonuniform slant correction for stone
inscription word recognition. IEICE Transactions on Information &
Systems, E87-D(5):1247–1253, 2004.
T. Varga and H. Bunke. Off-line stone inscription word recognition
using synthetic training data produced by means of a geometrical
distortion model. International Journal of Pattern Recognition and
Artificial Intelligence, 18(7):1285– 1302, 2004.
A. Vinciarelli and J. Luettin. A new normalization technique for cursive
stone inscription words. Pattern Recognition Letters, 22(9):1043–1050,
S. RajaKumar,is a Research
Scholar in the Department of
Electronics and Communication
University, Chennai. He received
his B.E in Electronics and
Communication Engineering and
M.E in Applid Electronics . His
intrests include Image Processing,
Signal Proccessing and Pattern
Dr. V. Subbiah Bharathi graduated
from Government College of
Engineering,Tirunelveli in 1986,
Master Degree from Regional
Engineering College, Warrngal in
1994 and Ph.D from Manonmaniam
Sundaranar University,Tirunelveli
in 2005. He published more than 40
papers in International Journal and
Conferences. His research intrests
Computer Vision and Pattern