Skew Detection and Correction of Online Bangla Handwritten Word

0 downloads 0 Views 910KB Size Report
detection and skew correction of online Bengali handwritten word through holistic .... skew angle θt and second, rotate the image by θt, in the opposite direction ...
IJCSI International Journal of Computer Science Issues, Vol. 9, Issue 4, No 2, July 2012 ISSN (Online): 1694-0814 www.IJCSI.org

202

Skew Detection and Correction of Online Bangla Handwritten Word Rajib Ghosh1, Gouranga Mandal2 1

Department of Computer science, National Institute of Technology Patna, Patna, India 2

Department of Computer science, Heritage Institute of Technology Kolkata-700107, India

Abstract The online handwritten document collected from different people for recognition purpose suffers from some degree of skew or tilt. Skew angle detection is an important component of any Character/Words Recognition and Document Analysis System. If the skew correction is done successfully then the character segmentation of the word will be more perfect and as a consequence the percentage of the correct word recognition will be higher. In this paper, we propose a new method for skew detection and skew correction of online Bengali handwritten word through holistic approach. This approach works based on center of gravity of left part and right part of a handwritten word. After finding the center of gravity, calculates the angle θ of the line which connected the two gravity centers in relation to horizontal line. Then Rotates the word clockwise by the angle θ if θ90º. All the pixel moves to the particular angle to correct the skew. We tested my system on 3000 Bengali word data and obtained around 92.22% accuracy on word data from the proposed system. Keywords: Online, Handwriting, Bangla, Skew, recognition

1. Introduction With the development of digitizing tablets and microcomputers, online handwriting recognition has become an area of active research since the This became a need because machines are getting smaller in size and keyboards are becoming more difficult to use in these smaller device. Moreover, online handwriting recognition provides a dynamic means of communication with computers through a pen like stylus, as it is natural writing instrument and this seems to be an easier way of entering data into computers. Work on online character recognition started gaining momentum about forty years ago. But work on online word recognition is in its nascent stage. For online word recognition there are some pre-processing steps. The most important pre-processing step is Skew detection and correction. Some work is already there on skew correction for online handwriting. Here a new algorithm is proposed for skew detection and correction of

online Bengali handwriting based on Holistic Approach. The rest of the paper is organized as follows. In Section 2 we discuss about the Bengali language and data collection. Section 3 deals with the related works. Section 4 details the Skew detection and correction method. The experimental results are discussed in Section 5. Finally, conclusion of the paper is given in Section 6.

2. Bangla Script and Online Data Collection Bangla, the second most popular language in India and the fifth most popular language in the world, is an ancient Indo-Aryans language. About 200 million people in the eastern part of Indian subcontinent speak in this language. Bangla script alphabets are used in texts of Bangla, Assamese and Manipuri languages. Also, Bangla is the national language of Bangladesh. The alphabet of the modern Bangla script consists of 11 vowels and 40 consonants. These characters are called as basic characters. Writing style in Bangla is from left to right and the concept of upper/lower case is absent in this script. It can be seen that most of the characters of Bangla have a horizontal line (Matra) at the upper part. From a statistical analysis we notice that the probability that a Bangla word will have horizontal line is 0.994. In Bangla script a vowel following a consonant takes a modified shape. Depending on the vowel, its modified shape is placed at the left, right, both left and right, or bottom of the consonant. These modified shapes are called modified characters. A consonant or a vowel following a consonant sometimes takes a compound orthographic shape, which is called as compound character. Compound characters can be combinations of two consonants as well as a consonant and a vowel. Compounding of three or four characters also exists in Bangla. There are about 280 compound characters in Bangla. In this work the recognition of Bangla basic characters are considered.

Copyright (c) 2012 International Journal of Computer Science Issues. All Rights Reserved.

IJCSI International Journal of Computer Science Issues, Vol. 9, Issue 4, No 2, July 2012 ISSN (Online): 1694-0814 www.IJCSI.org

For online data collection, involves the automatic conversion of text as it is written on a special digitizer or PDA, where a sensor picks up the pen-tip movements X(t),Y(t) as well as pen-up/pen-down switching. That kind of data is known as digital ink and can be regarded as a dynamic representation of handwriting. The ink signal is captured by either: A paper-based capture device A digital pen on patterned paper A pen-sensitive surface such as a touch screen

203

3. Related Work There are two types of handwritten document images are available. One is offline handwriting another one is online handwriting. Offline printed word recognition is comparatively easier than online handwriting recognition because it comes in printed form, so like handwritten word there are not so much variations there in writing styles. Printed word has not that much skew like online and offline handwriting. Before recognition of any handwritten word we need to do some sort of preprocessing. There are so many preprocessing steps like smoothing, dehooking, skew detection, skew correction etc. Already there are many research works are available on skew detection and skew correction of handwritten document image, but most of those are in offline handwritten document. In online handwritten document very few works are there, especially in Bengali. Some of the works on offline handwriting are discussed as follows:– Baseline skew correction: This approach works with the baseline of Bengali handwriting [1].

Figure 1. Datasheet used for word collection

Convex hull: The main objective of employing the pseudo-convex hull is to decrease the use of empirical thresholds in developing this approach. This technique is being used in a way that reduces the minima in a word so that, when filtering undesirable minima, few empirical thresholds will have to be defined Holistic Approach: This approach works based on center of gravity of left part and right part of a handwritten word. After finding the center of gravity all the pixel moves to the particular angle to correct the skew [3].

Figure 2. Datasheet after collecting handwriting

The information on strokes and trajectories is mathematically represented in an ink signal composed of a sequence of 2D points ordered by time. No matter what the handwriting surface may be, the digital ink is always plotted according to a matrix with x and y axes and a point of origin. Online data acquisition captures just the information needed, which is trajectory and strokes, to obtain a clear signal. This effective information makes the data easier to process.

Hough transform method: Hough transform technique may be applied on the upper envelopes for skew estimation, but this is slow process. Sometimes digitized image may be skewed and for this situation skew correction is necessary to make text lines horizontal. Skew correction can be achieved in two steps. First, estimate the skew angle θt and second, rotate the image by θt, in the opposite direction and detect the skew angle is using Matra [4]. Morphological approach: The Mathematical Morphology consists in comparing an unknown picture X with a pattern B, perfectly defined in terms of shape, size and grayscale, named structuring element [5]. Projection profile: A straightforward solution to determining the skew angle of a document image uses a horizontal projection profile. This is a one-dimensional array with a number of locations equal to the number of

Copyright (c) 2012 International Journal of Computer Science Issues. All Rights Reserved.

IJCSI International Journal of Computer Science Issues, Vol. 9, Issue 4, No 2, July 2012 ISSN (Online): 1694-0814 www.IJCSI.org

204

rows in an image. Each location in the projection profile stores a count of the number of black pixels in the corresponding row of the image. This histogram has the maximum amplitude and frequency when the text in the image is skewed at zero degrees since the number of colinear black pixels is maximized in this condition [6]. Robust solution: The first step of this method is to divide images into NxN blocks, and then Otsu’s method is applied straightaway in each of the blocks. Then each and every pixel is applied with a nonlinear quadratic filter to fine tune all the pixels according to the local information available [7].

Figure 3. Process of Skew Detection and Correction

4. Skew Detection and Correction The algorithm we have implemented is very interesting one and it is based on the Rotation correction method by gravity center balancing. Rotation correction is important in unconstrained handwritten word recognition because most character based recognition methods are not designed for rotation free.The algorithm for Skew Detection and correction is as follows: Algorithm Skew Detection and Correction: Step 1: Calculate number of pixels of each Y co-ordinate of the entire image. Step 2: Consider the busy zone of the entire word. Step 3: Find the minimum x-co-ordinate and maximum x-co-ordinate of the entire image. Step 4: Calculate the average point of the min and max xcoordinate. Step 5: Draw a line through the average point and divide the whole word into two parts- left part and right part. Step 6: Calculate the gravity centers for each part. Step 7: Draw a straight line to connect the two centers of gravity. Step 8: Calculate the angle θ of the line which connects the two gravity centers with respect to horizontal line. Step 9: Rotate the word clockwise by the angle θ if θ90º. Step 10: Partition the word into left and right parts by the vertical line through the gravity center of whole word. If the starting point of the handwriting falls in the right part, rotate the word 180º clockwise. Step 11: Correct up-down reversed word.

Figure 4. Word after Skew Correction

5. Results and Discussion The experimental evaluation of the above techniques was carried out using online handwritten words. The data was collected from people of different background. Total of 6,000 words are collected for the experiment. Out of them 50% of the words are used for the training of the classifier for the present work and rest will be used for the testing purpose. We tested our system on 3000 Bengali word data and obtained around 98.80% accuracy on word data from the proposed system. The skew correction accuracy obtained from the classifier is shown in Table: Table 1: Result Of Skew Correction Total Words

Skewed Words

Corrected

Uncorrected

3839

1660

1531

129

Copyright (c) 2012 International Journal of Computer Science Issues. All Rights Reserved.

Skew Correction Accuracy In % 92.22%

IJCSI International Journal of Computer Science Issues, Vol. 9, Issue 4, No 2, July 2012 ISSN (Online): 1694-0814 www.IJCSI.org

6. Conclusion This paper presents a scheme for the Skew correction of Bengali online handwritten word. Using this technique different Bengali online handwritten word can be Skew corrected. This result will be helpful for recognizing Bengali words. We tested the proposed system on 5500 data and got the encouraging result. Not much work has been done towards the online recognition of Indian scripts in general and Bangla in particular. So this work will be helpful for the research towards online recognition of other Indian scripts as well as for Bangla in the level of word, text and so on. In fact the work for online recognition of Bengali handwritten word is going on by us and hopes that work can be completed successfully by taking the help of the current proposed work.

References [1]

[2]

[3]

[4]

[5]

[6]

[7]

Bharath A. and Sriganesh Madhvanath,“Online Handwriting Recognition for Indic Scripts”, HP Laboratories, India, HPL-2008-45, May 5, 2008. Marisa E. Morita, Jacques Facon, Fl´avio Bortolozzi, Silvio J.A. Garn´es, Robert Sabourin, “Mathematical Morphology And Weighted Least Squares to Correct Handwriting Baseline Skew”, Document Analysis and Recognition, 1999. ICDAR '99. Proceedings of the Fifth Int. Conf., pp. 430 – 433, 1999. Kai Ding, Lianwen Jin and Xue Gao, “A New Method for Rotation Free Online Unconstrained Handwritten Chinese Word Recognition: A Holistic Approach”, College of Electronic and Information, South China University of Technology, Guangzhou, PRC. Document Analysis and Recognition, 2009. ICDAR '09. 10th Int. Conf., pp-1131 – 1135 , 2009 Farjana Yeasmin Omee, Shiam Shabbir Himel and Md. Abu Naser Bikas, “A Complete Workflow for Development of Bangla OCR”, Int. Journal of Computer Applications by Foundation of Computer Science, 21(9):1-6, May 2011. MARISA E. MORITA 1 - FL ´AVIO BORTOLOZZI 2 JACQUES FACON 3 – ROBERT SABOURIN,” Morphological approach of handwritten word skew correction”, Anais do XI SIBGRAPI, outubro de 1998. JONATHAN J. HULL, “DOCUMENT IMAGE SKEW DETECTION: SURVEY AND ANNOTATED BIBLIOGRAPHY”,Document Analysis Systems Ii ,pp 40-64, 1998. U. Pal, S. Sinha and B. B. Chaudhuri, "Multi-Oriented Text lines Detection and Their Skew Estimation", Proc. in Indian Conference on Computer Vision, Graphics and Image Processing, pp. 270-275, 2002.

Copyright (c) 2012 International Journal of Computer Science Issues. All Rights Reserved.

205