Professional Documents
Culture Documents
Optical Character Recognition For Tamil Using Tchebichef Moments
Optical Character Recognition For Tamil Using Tchebichef Moments
HTTPS://SITES.GOOGLE.COM/SITE/JOURNALOFCOMPUTING/
WWW.JOURNALOFCOMPUTING.ORG 38
Abstract— This paper deals with the Optical Character Recognition for Tamil (one of the Indian language) using Tchebichef Moments. It
aims at recognizing the printed Tamil characters of fixed font and size with high accuracy. The document is scanned as a bmp image and
the Tchebichef moments for each character (32x32) are calculated after the segmentation. The calculated moments of each character are
checked for a match using the least-square-difference method, and corresponding UNICODE value is obtained as output, which can be used
to transform the printed text into editable text. The Unicode outputs are then converted in to text by using the programming language Python.
Index Terms: Optical Character Recognition, Python language, Tchebichef Moments, Unicode.
—————————— ——————————
1 INTRODUCTION
5 TCHEBICHEF MOMENT
Moments are statistical measures used to obtain relevant in-
formation about a certain object under study (e.g., Signals, im-
ages or waveforms), i.e., to describe the shape of an object to be
recognized by pattern recognition system. Image moments can
be classified into Invariant Moments, Variant Moments, Ortho-
gonal moments, Non-orthogonal moments.
Invariant moments are a special kind of moments de-
signed to remain constant even after some transformations,
such as object rotation, scaling, translation, or image illumina-
tion changes, in order to improve the reliability of a system.
Invariants are sensitive to any image change or perturbations
for which they are not invariant, so any unexpected perturba-
tion will affect the measurement; on the contrary a variant
moment is designed to be sensitive to a specific perturbation,
i.e., to measure a transformation, not to be invariant to it, and
thus if the specific perturbation occurs it will be measured;
Figure 2 After Binarization hence any unexpected disturbance will not affect the objective
of the measurement confronting thus uncertainty.
Orthogonal moments are the moments from which the
image can be obtained from the function or the vice versa
4 SEGMENTATION while non-orthogonal moments are those where the original
It is the process of separating the individual lines and charac- image cannot be obtained by applying the reverse function.
ters, from the scanned image file. The bmp image file is Orthogonal moments are decomposed into two categories
scanned from the bottom left for black pixels. When a black namely
pixel is encountered it signifies the start of a printed line and i)Discrete orthogonal polynomial moments
when an all-white line is encountered this signifies the end of ii)Continuous orthogonal polynomial moments
that printed line, which gives the top and bottom boundaries of Tchebichef moments are a new set of discrete ortho-
the same. The same process is repeated until the end of the gonal moments widely used in 2D image analysis. They have a
document is reached variety of application in visual pattern recognition, object clas-
sification, template matching, robot vision and data compres-
sion. Tchebichef moments are the simplest of discrete ortho-
gonal moments which has low noise sensitivity and computa-
tional complexity.
Coordinate transformation and suitable ap-
proximation of continuous moment integrals are required dur-
ing the computation of moments since Zernike and Legendre
JOURNAL OF COMPUTING, VOLUME 2, ISSUE 9, SEPTEMBER 2010, ISSN 2151-9617
HTTPS://SITES.GOOGLE.COM/SITE/JOURNALOFCOMPUTING/
WWW.JOURNALOFCOMPUTING.ORG 40
polynomials are defined only inside the unit circle. But the
Tchebichef Moments are directly defined in the image coordi-
nate space and preserve the property of orthogonality in a
moment set. There is no numerical approximation and the
moments are orthogonal, this property makes it superior to
other moments. Also it has very high reconstruction accuracy.
Earlier many works have been done using
Tchebichef moments viz., Vehicle-logo Recognition Method [3],
Traffic Sign Classification, image super resolution [5], image
moment problems [6], analysis of Noise Sensitivity and Recon-
Figure 5 Picture considered for sample calculation
struction Accuracy of Tchebichef moments [7], Watermarking
Squared norm:
Scheme [8]. This work applies Tchebichef moments for charac-
ter recognition.
From equation(1)
5
Squared Norm: 0,5 5
2 0 1
…
, ‐‐‐‐‐‐‐‐‐‐‐ (1) ρ(0)=5
The squared norm values calculated using the above equa-
tion for n = 1 to 4 is as
Where, follows:
ρ = squared norm ρ (1)=1.6
N = size of the image in pixels ρ (2)=0.8064
n = 0 to N-1 ρ (3)=0.36864
ρ (4)=0.1032192
Tchebichef Polynomials: Tchebichef polynomial:
From equations (2), (3) and (4) the Tchebichef polynomial
1 ‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐ (2) values are calculated and the results obtained are as below:
Tp[0][0] = 1 Tp[1][0] = -0.8
‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐ (3) Tp[1][1] = -0.4 Tp[1][2] = 0
Tp[1][3] = 0.4 Tp[1][4] = 0.8
Tp[2][0] = 0.48 Tp[2][1] = -0.24
‐‐‐‐‐ (4) Tp[2][2] = -0.48 Tp[2][3] = -0.24
Tp[2][4] = 0.48 Tp[3][0] = -0.192
Where, Tp[3][1] = 0.384 Tp[3][2] = 0
n = 2 to N-1 Tp[3][3] = -0.384 Tp[3][4] = 0.192
x = 0 to N-1 Tp[4][0] = 0.0384 Tp[4][1] = -0.1536
Tp[4][2] = 0.2304 Tp[4][3] = -0.1536
tn(x) = discrete Tchebichef polynomial of degree n
Tp[4][4] = 0.0384
Tchebichef moments:
,
, , Since the image size is 5x5 the number of moments obtained
is 25(0 to 24). The sample calculation for the first moment is
--------------- (5) shown above. Similarly the value of moments from 1 to 24 is
calculated and is shown below:
Where, T[0][0] = 163.2 T[0][1] = 0
x, y = 0 to N-1, specify the X-Y coordinates T[0][2] = -30.357142 T[0][3] = 0
p,q = 0 to N-1, order of the moments T[0][4] = 113.839285 T[1][0] = 0
Tpq is the Tchebichef moment T[1][1] = 0 T[1][2] = 0
The Tchebichef moments for each character are calculated and T[1][3] = 0 T[1][4] = 0
are used to match the characters. T[2][0] = -30.357142 T[2][1] = 0
T[2][2] = -542.091836 T[2][3] = 0
5.1 SAMPLE CALCULATION T[2][4] = -338.807397 T[3][0] = 0
T[3][1] = 0 T[3][2] = 0
The value of n = 5 for the fig.5 taken as an example (size of the T[3][3] = 0 T[3][4] = 0
image) T[4][0] = 113.839285 T[4][1] = 0
T[4][2] = -338.807397 T[4][3] = 0
JOURNAL OF COMPUTING, VOLUME 2, ISSUE 9, SEPTEMBER 2010, ISSN 2151-9617
HTTPS://SITES.GOOGLE.COM/SITE/JOURNALOFCOMPUTING/
WWW.JOURNALOFCOMPUTING.ORG 41
T[4][4] = -3670.413477 7 UNICODE
The Unicode Standard (http://www.unicode.org)is the Uni-
6 MOMENTS MATCHING versal Character encoding scheme for written characters and
There are 247 letters in the Tamil Script that are made up of text. It defines the uniform way of encoding multilingual text
basic symbols. Tamil language contains combination letters that enables the exchange of text data internationally and
which will have two or three basic symbols. For the purpose of creates the foundation of global software. The Tamil Unicode
creating a database, 127 basic symbols are enough to be consi- range is U+OB80 to U+OBFF. The Unicode characters are com-
dered. Tchebichef moments for these 127 symbols are calcu- prised of 2 bytes in nature. The second byte of the Unicode
lated and stored in a file with a unique index number for each value is only given as the output because the first byte is com-
symbol. The index numbers range from 0 to 126. The font size mon (OB).
and style is to remain constant and is taken as 12 and Arial Un- Based on the recognized index, the Unicode value of
icode-MS. The width of the images is 32 for this case. A 32x32 the corresponding character is returned by using the parsing
size results in 1024 moments. Calculating and using all the technique. Parsing is nothing but reading a sequence of index
1024 moments for matching will be time consuming for printed values for patterns. Tamil language contains combination let-
characters. By trial and error method it is found that 25 mo- ters which will have two or three Unicode values. These Un-
ment values are enough for succesfull pattern recognition. icode values have to be fed in the right sequence to produse the
Each index value contains 25 moment values of the corres- Tamil characters if not the letter will not be represented cor-
ponding symbol. rectly.
The program recognizes all the characters in a line at a time.
‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐ (6) The line number is given to the program and it returns the cha-
is a minimum. A residual is defined as the difference between racter’s index value in the database and the corresponding Un-
the value of the dependent variable and the model value icode value. The output of the program for the third text line is
shown in Fig 6. Since the image is processed from the bottom,
,β --------------- (7)
the bottom most line of the page is the first strip.
JOURNAL OF COMPUTING, VOLUME 2, ISSUE 9, SEPTEMBER 2010, ISSN 2151-9617
HTTPS://SITES.GOOGLE.COM/SITE/JOURNALOFCOMPUTING/
WWW.JOURNALOFCOMPUTING.ORG 42
12 1292.826638 95
69 3413.753990 B5
75 3208.593787 A9
84 8882.838978 AE
C1
30 1421.994058 A4
42 2238.347342 B1
CD
48 2265.960949 B1
C7
4 1809.094817 89
99 2291.189046 B2
15 1776.052109 95
C1
Fig 6 shows the Unicode outputs generated for the sample input.
The window display can be explained as follows.
Input the threshold value : 192 Threshold value used in Figure 8 Python output of first three characters
binarization.
input the strip no : 3 line number from the
bottom of sample input 10 CONCLUSION
index 37 Index for the left most Tchebichef moment which has been used for various image
character . applications is proposed for Tamil Optical Character Rec-
3951.450009 least difference. ognition in this work. For OCR minimum order 5 Tchebi-
aa Unicode output for the chef moments are sufficient enough to recognize characters
character with maximum efficiency per line. Since only 25 moment
values have been calculated and used for recognition, ex-
ecution and memory space required for the program is re-
Table 2. Recognized Characters as per the Unicodes duced.
Generated as Output.
REFERENCES
[1] Shivsubramani.k, Loganathan.R, Srinivasan.C.J, Ajay.V, Soman.K.P, “Multic-
Index Least Difference Unicode Character lass Hierarchical SVM for Recognition of Printed Tamil Charactersn,” Centre
37 3951.450009 AA for Excellence in Computational Engineering, Amrita Vishwa Vidyapeetham,
JOURNAL OF COMPUTING, VOLUME 2, ISSUE 9, SEPTEMBER 2010, ISSN 2151-9617
HTTPS://SITES.GOOGLE.COM/SITE/JOURNALOFCOMPUTING/
WWW.JOURNALOFCOMPUTING.ORG 43
India. www.citeseerx.ist.psu.edu
[2] Chinnuswamy.P, S.G.Krishnamoorthy,”Recognition of Hand Printed
Tamil”,Pattern Recognition. Elsevier Ltd, Volume 12, Issue 3,pp. 115-
217, 1980.
[3] Shijie Dai, He Huang , Zhangying Gao, Kai Li and Shumei Xiao “Ve-
hiclelogo Recognition Method Based on Tchebichef Moment Inva-
riants and SVM” World Congress on Software Engineering, 2009, IEEE
computer society pp18-21.
[4] Nur Azman Abu,Wong siaw Lang and Shahrin Sahib “Image super –
Resolution via Discrete Tchebichef Moments” 2009 International Confe-
rence on Computer Technology and Development, icctd, vol2, pp 315-
319, 2009.
[5] Judit Martinez, Joseph M.Porta and Federico Thomas “A Matrix-
Based Approach to the Image Moment Problem” Journal of Mathemati-
cal Imaging and vision archieve, vol 26, issue 1-2November 2006, pp 105-
113.
[6] S. M. Elshoura & D. B. Megherbi “Analysis of Noise Sensitivity and
Reconstruction Accuracy of Tchebichef Moments” Southeastern,
2008 IEEE pp 521-526, April 2008.
[7] Wanli Lv, Yutang Guo,Jixin Ma,Bin Luo “A Novel Watermarking
Scheme Based On Relationship Of Tchebichef Moments” IEEE Int.
Conference Neural Networks & Signal Processing ,Zhenjiang, China,
June 8~10, 2008, pp 146-150.