Accuracy Improvement of Slant Estimation for Handwritten ... - CiteSeerX

0 downloads 0 Views 540KB Size Report
erative chain code method[6] which repeats the slant estimation and the .... sum of horizontal projection of the element 5, 6, 7, and ... y = 0.99x − 0.01, r = 1.000.
Accuracy Improvement of Slant Estimation for Handwritten Words Yimei Ding† , Fumitaka Kimura† , Yasuji Miyake† , Malayappan Shridhar†† †

Faculty of Engineering, Mie University, 1515 Kamihama, Tsu 514-8507, JAPAN ECE Dept., University of Michigan-Dearborn, Dearborn, MI 48128-1491, USA [email protected]

††

Abstract Handwritten words are usually slant or Italicized due to the mechanism of handwriting and the personality. In order to improve the accuracy of character segmentation and recognition, the authors proposed a chain code method for the slant estimation and correction[1]. However the method is very simple and usually gives good estimate of the word slant, there was a problem such that the slant tends to be underestimated when the absolute of the slant is close or greater than 45◦ . To solve the problem, we proposed an iterative chain code method[6]. In this paper, we introduce a new noniterative method using 8-directional chain code for improving the linearity and the accuracy of the slant estimation. The experimental results show that the proposed method improves the linearity and the accuracy of the slant estimation efficiently without sacrificing the processing speed and the simplicity.

1. Introduction Handwritten words are usually slant or Italicized due to the mechanism of hand writing and the personality. In order to simplify the character segmentation task and to improve the accuracy of the character segmentation and recognition, several techniques for estimating word slant have been proposed, e.g. the runlength based technique[2], the projection method [3], the extrema analysis method[4], and the generalized chain code estimator[5]. The authors proposed a chain code method for slant estimation and correction[1]. However the method is very simple and usually gives good estimate of the word slant, there was a problem such that the relationship between the actual slant and the estimated slant is not linear, and the slant tends to be under estimated when the absolute of the slant is close or greater than 45 ◦ .

To solve the problem, the authors proposed an iterative chain code method[6] which repeats the slant estimation and the correction until the slant reduces to sufficiently small. Although the linearity and the accuracy were improved, the required processing time was increased and the slant corrected image got jagged as the number of iteration increases. Refering to [5], we tested generalized chain code estimators which have an enhancement parameter to compensate the under estimation of the slant. Although the enhancement could improve the under estimation, the accuracy and the linearity were not sufficiently improved. In this paper we introduce a new non-iterative method using 8-directional chain code for improving the linearity and the accuracy of the slant estimation.

2. Slant estimation and correction by chain code method Average slant of an English word is easily estimated using the chain code histogram of entire border pixels[1]. The estimator is given by n1 − n 3 ) (1) n1 + n 2 + n 3 where ni is the number of chain elements at an angle of i x 45◦ (/ or | or \). Shear transformation is then applied to correct the slant. θ = tan−1 (

n3

n2

θ

n1

n1+n 2 +n3

n0 n1 - n3

Figure 1. Average slant of a chain code sequence

2.1. Evaluation of estimation accuracy 60

Estimated slant

In order to evaluate the estimation accuracy for an input pattern, we shear it by every 5◦ from −60◦ to 60◦ and estimate the slant of each sheared word image. Fig.2 shows the relationship between the angle of shearing and the estimated slant for a test pattern sheared by every 5 ◦ from −60◦ to 60◦ .

45 30 0 -30 k=0.0 k=0.2 k=0.4

-45 -60 -60

Estimated slant

60

-45 -30 0 30 45 Angle of shearing

60

45 30

Figure 3. Evaluation of slant estimation by generalized chain code method

0 -30 -45

n=1

-60 -45 -30 0 30 45 Angle of shearing

60

Figure 2. Evaluation of estimation accuracy for a test pattern In the range of [−45◦, 45◦ ], the estimated slant is almost linear and close to the actual slant of the input pattern. However, if the absolute of the slant exceeds 45◦ , the estimate is no more correct and valid. This phenomenon is attributed to the inequalities n1 − n3 ≤ n1 + n2 + n3 or | tan θ |≤ 1. 2.2. Generalized chain code methods In [5], a generalized chain code estimator (3) was proposed which has an enhancement parameter k ∈ [0, 1]. θ = tan−1 (

n1 − n3 + kn2 ) n1 + n 2 + n 3

(2)

Fig.3 shows characteristic curve of slant estimator(3) for the test pattern. With the increase of the parameter k, not only the linearity is not improved beyond [−45 ◦ ,45◦ ], but also it is deteriorated in [−45◦ ,45◦ ]. We modified the generalized chain code estimator to obtain an alternate generalized chain code estimator(4)  utilizing k n0 instead of kn2 as the enhancement term.

Fig.4 shows characteristic curves of the alternate generalized chain code method for the test pattern and a real world data. With the increase of the parameter k, the linearity and the under estimation can be improved to some extent.

60

60

45

45

Estimated slant

-60

Estimated slant

test pattern

30 0 -30 k=0.0 k=0.2 k=0.4

-45

30 0 -30 k=0.1 k=0.3 k=0.5

-45

-60

-60 -60

-45 -30 0 30 45 Angle of shearing

60

-60

-45 -30 0 30 45 Angle of shearing

60

Figure 4. Estimation accuracy by generalized chain code method The problem of this generalized chain code method is the dependency between k and n0 . If an input word image contains smaller (larger) number of horizontal chain code elements, the value of k has to be larger (smaller). Because of the dependency, it is difficult to achieve maximum linearity as long as the value of k is fixed to a predetermined value.



θ = tan

−1

n1 − n 3 + k n0 ( ) n1 + n 2 + n 3

(3)

where n0 is the number of horizonal chain elements,  and k is given by 



k =k  k = −k

(n1 − n3 ≥ 0) (n1 − n3 < 0)

(4)

3. Accuracy improvement by 8 directional chain code method To extend the range in which the linearity is preserved, we propose an 8-directional chain code method described below. Instead of tracing the boder pixels one by one with 8-

n n

6

n

5

n4

n3

n

2 n1

7

n0

Figure 5. 8-directional quantization of chain code

4. Evaluation and comparison of estimation accuracy 4.1. Comparison with 4-directional method Fig.7 shows characteristic curves of 4-directional method, the simple iterative method[6] and 8directional method. In the iterative method, the 4-directional method was applied twice successively. Fig.7(a) is for the test pattern and Fig.7(b) for the real world data. Those results show that the linearity of the 8-directional method as well as the iterative method is better than that of 4-directional method. Fig.4 also shows the regression lines and the correlation coefficients. Both the correlation coefficients and the slope of the regression line of the 8-directional method approach to 1.

(2n1 + 2n2 + n3 ) − (n5 + 2n6 + 2n7 ) tan θ = (n1 + 2n2 + 2n3 ) + 2n4 + (2n5 + 2n6 + n7 ) (5) where (2n1 + 2n2 + n3 ) is the sum of horizontal projection of the element 1, 2, 3, (n5 + 2n6 + 2n7 ) is the sum of horizontal projection of the element 5, 6, 7, and the denominator is the sum of vertical projection of the element 1 to 7.

Estimated slant

The slant estimator of the 8-direction chain code method is given by

60

60

45

45

Estimated slant

neighborhood, we trace the every two pixels. Obtained chain code is then quantized to 8 directions as shown in Fig.5. Each direction is numbered 0 to 7 in counter clockwise, and ni denotes the number of chain code elements in direction i.

30 0 -30 -45

-60

(a):

(b): Estimated slant

60 45

-45 -30 0 30 45 Angle of shearing

0 -30 -45

4-direc iterative 8-direc

-60

30

4-direc iterative 8-direc

-60 60

-60

-45 -30 0 30 45 Angle of shearing

60

(a) 4-direc: y = 0.69x − 0.03, iterative: y = 0.98x − 0.00, 8-direc: y = 0.99x − 0.01,

(b) r = 0.972 r = 1.000 r = 1.000

y = 0.53x + 0.19 y = 0.85x + 0.31 y = 0.83x + 0.30

r = 0.963 r = 0.996 r = 0.997

4-direc: iterative: 8-direc:

30

Figure 7. (a)Accuracy improvement by 8directional method (b)Estimation accuracy for real world data

0 -30 -45

8-direc

-60 -60

-45 -30 0 30 45 Angle of shearing

60

Figure 6. Evaluation of estimation accuracy of 8directional method for the test pattern

Fig.6 shows the characteristic curve of the 8directional method for the test pattern. This result shows that the lineartity is preserved in wider range, which is potentially [-arctan(2), arctan(2)].

Table 1 shows the average slope of the regression lines and the average correlation coefficients of the 4directional method, the iterative method and the 8directional method for 1000 handwritten words. Fig.8 shows examples of slant corrected word images. The upper row shows input images, the sencond row to the bottom row show the slant corrected images by the 4-directional method, the iterative method and the 8-directional method respectively. The slant corrected images by the 8-directional method are better

Table 1: Average slope and average correlation coefficients Range [−45◦ ,45◦ ] [−60◦ ,60◦ ]

Average of slope co-co slope co-co

Slant estimation method 4-dire iterative 8-dire 0.63 0.87 0.83 0.991 0.999 0.999 0.53 0.81 0.79 0.971 0.994 0.996

than those by the 4-directional method because they tend to be underestimated. The results by the 8directional method are also better than those by the iterative method, because the shear transformation is applied only once in the 8-directional method, while it is applied twice in the iterative method.

input

4-direc

iterative

8-direc

Figure 8. Examples of slant corrected images

Table 3: Comparision with manually measured word slant Word im01 im02 im03 im04 im05 im06 im07 im08 im09 im10

Estimated Slant(degree) 4-dir iterative 8-dir Manual 13.81 16.53 16.87 15.87 19.28 27.44 27.02 29.12 29.27 36.89 36.62 35.25 18.31 22.60 23.47 24.25 -12.88 -16.53 -15.93 -15.12 -22.17 -28.96 -27.72 -29.50 33.25 43.25 42.57 40.25 32.67 45.27 44.95 43.00 33.08 46.24 45.62 44.62 37.75 46.77 45.66 45.05

5. Conclusion The result of experimental comparison showed that the 8-directional method improved the linearity and the accuracy of the slant estimation without sacrificing the processing speed and the simplicity. Further comparative studies with more image data and slant estimators, estimation of local slant, and slant estimation of oriental character strings are remained as future research topics.

References 4.2. Evaluation and comparison of processing speed Table 2 shows average processing time of slant estimation for 100 handwritten English words by each method. Used CPU is a hyper SPARC 125MHz. While the processing time of the iterative method increases proportional to the number of iteration, the processing time of 8-directional method is almost the same as the one of the 4-directional method. Table 2 Average processing time for slant estimation time(sec)

4-direc 0.44

iterative 0.90

8-direc 0.45

4.3. Comparison with manually measured word slant Table 3 shows the slant of ten handwritten English words estimated by the 4-directional method, the iterative method and the 8-directional method together with the average slant manually measured with a protractor by 20 persons. The 8-directional method and the iterative method give good estimates of the manually measured average slant.

[1] F.Kimura, M.Shridhar and Z.Chen, ”Improvements of a Lexicon Directed Algorithm for Recognition of Unconstrained Handwritten Words”, Proc. of the 2th ICDAR, pp. 18-22,1993. [2] R.M. Bozinovic and S.N. Srihari, ”Off-line Cursive Script Word Recognition”, IEEE Transactions on PAMI, vol. II, No. 1, pp. 68-83, Jan. 1989. [3] Didier Guillevic, Ching Y. Suen, ”Cursive Script Recognition: A Sentence Level Recognition Scheme”, Proc. of 4th IWFHR, pp. 216-223, Dec. 1994. [4] Atul Negi, K.S.Swaroop, Arun Agarwal,”A Correspondence Based Approach to Segmentation of Cursive Words”, Proc. of 3th ICDAR, vol. II, pp. 1034-1037, Aug.1995. [5] L.Simoncini, Zs.M.Kovacs-V, ”A System for Reading USA Census’90 Hand-Written Fields”, Proc. of 3th ICDAR, Vol. II, pp. 86-91, Aug. 1995. [6] Yimei Ding, Fumitaka Kimura, Yasuji Miyake, Malayappan Shridhar, ”Evaluation and Improvement of Slant Estimation for Handwritten Words”, Proc. of 5th ICDAR, pp. 753-756, Sep. 1999.