A new approach to stroke and feature point extraction in Chinese character recognition

A new approach to stroke and feature point extraction in Chinese character recognition

Pattern Recognition Letters 12 (1991) 381-387 North-Holland June 1991 A new approach to stroke and feature point extraction in Chinese character rec...

403KB Sizes 0 Downloads 63 Views

Pattern Recognition Letters 12 (1991) 381-387 North-Holland

June 1991

A new approach to stroke and feature point extraction in Chinese character recognition K.W. Gan and K.T. Lua Department of Information Systems and Computer Science, National University of Singapore, Kent Ridge Crescent, Singapore 0511

Received 12 July 1990

A bstract K.W. Gan and K.T. Lua, A new approach to stroke and feature point extraction in Chinese character recognition, Pattern Recognition Letters 12 (1991) 381-387. This paper describes a new stroke and feature point extraction method for the recognition of printed Chinese characters of multiple fonts and various sizes. Based on our experimental study using 8 sets of Chinese character fonts, each comprising 3755 Chinese characters, this method is shown to be more stable compared to traditional methods.

Keywords. Stroke extraction, feature point extraction, thinning, Chinese characters recognition.

I. Introduction

Chinese characters contain rich structural information. This information remains unchanged over font and size variations. Since the basic elements of a Chinese character are strokes, the types and numbers of strokes and the relationships among the strokes are essential structural features of a Chinese character (Zhang and Xia (1983)). The ability to obtain such structural information will enable one to build a good optical character reader to recognize not only multi-font, multi-size, printed Chinese characters, but also handwritten Chinese characters. However, extracting the strokes of a printed Chinese character correctly is a major problem because of the fact that strokes are crossed or connected and the correct ordered sequence of strokes is therefore lost. At present, research on strokes extraction is still 0167-8655/91/$03.50

in an experimental stage (Zhang and Xia (1983)). Most stroke extraction techniques today (Zhang and Xia (1983), Hsu and Cheng (1985), Chen et al. (1988) and Kobayashi et al. (1983)) employ some thinning algorithms to obtain the skeleton of a character. The strokes of the character are then deduced from the thinned character. However, because of the sensitivity of most thinning algorithms to noise and the unique structure of Chinese characters, thinning produces many undesirable side-effects which makes the task of stroke extraction difficult (Zhang et al. (1,982)). In this paper, we report a new stroke and feature point extraction technique. This technique aims to overcome the problems faced when using thinning for stroke extraction. Our method is evaluated against the commonly used approach described in Chen et al. (1988). Our experiment shows that this method is more stable over font and size variations

© 1991 - - Elsevier Science Publishers B.V. (North-Holland)

381

Volume 12, Number

6

PATTERN

RECOGNITION

Exwacling Subs~'okes

Exa"acting Feature Points

'rhinmg

Figure

I.

June 1991

LETTERS

Extracting , Strokes

Stages of feature point and stroke extraction in a traditional approach.

compared to traditional methods. A brief description o f the traditional method is covered in the next section and some o f its weaknesses are highlighted. In Section 3, we will describe the central idea of our new approach and explain how this approach is able to overcome some of the problems of thinning when it is used in stroke extraction. Finally, the relative performance in terms of the processing speed and the stability of the new method and the traditional method are summarized in Section 4.

2, A traditional method of stroke and feature point extraction There are four main stages (see Figure 1) in a traditional stroke and feature point extraction method (Zhang and Xia (1983), Hsu and Cheng (1985), Chen et al. (1988) and Kobayashi et al. (1983)). First, the skeleton of a character is obtained through thinning. This is done by continuously removing the external points of an image until the widths of all lines reduce to 1 pixel everywhere. By

c

"f..¢

~eIH**..e.ootoo....t



° ° e e l e e l e.e °°

° ° . . . . I o . . o o l e e e e l o e e l e e . . . . . . . . ° ° . e . . . ° . . ° ,*, t * ,

e e , e • . . ° eol °°. . . ° e I * . °co • °.

e l l , I , ° ° ° ooo o.I °oe o.° o ° o

:::"

~ ~

• :" • . ......

(a)

(4

r....+......t't..¢ o°.

:::

e l l . . o . ° o . o . , ! . . . . e ..D

it" ° It-

e"

°

e t ' t t . . ,t .o

[b)

(d)

Figure 2. (a) L_mau¢of character CAL Co) Thinned image of character CA1. (c) Strokes extracted using traditionalmethod. (d) Strokes extracted using new approach. 382

Volume 12, Number 6

PATTERN RECOGNITION LETTERS

A(4)

A(3)

A(2)

A(5)

P

A(1)

A(6)

A(7)

A(8)

Figure 3. Crossing number computation.

some rules, feature points in the thinned character image are detected and stroke segments which meet at these points are examined. These substrokes are merged into strokes according to their positions and directions. Figure 2b shows an example of the character C A I after Deutsch's (1972) thinning algorithm is applied. Four types of feature point are extracted and indicated in Figure 2b based on the topological properties o f these feature points (Hsu and Cheng (1985)). They are: (a) end point (indicated as 'e'), (b) turning point (indicated as 't'), (c) three-forked point (indicated as ' f ' ) , (d) crossing point (indicated as 'c'). Except for the turning point, the other three types o f feature point can be detected based on the crossing number computation. The crossing number of a black pixel (P) is defined as (see Figure 3): '

s

C(P)= ~., ]A(k+ 1 ) - A ( k ) [ k=O where A(9)=A(1).

(1)

June 1991

When C(P)= 2, P is an end point. P is a threeforked point if C(P) = 6 and it will be a cross point when C(P) = 8. When C(P) = 4, P can be an internal point or a turning point. Hence, if P is a turning point, it cannot be detected using the crossing number computation. This problem, however, can be resolved by making use of the inherent property of Chinese characters that turning points can only occur when there is an abrupt change o f stroke direction. Hence, when C ( P ) = 4 , the neighborhood of P is examined and P is regarded as a turning point if it satisfies any one of the conditions shown in Figure 4. After the feature points have been detected, substrokes are extracted based on these feature •points. That is, a group of consecutive black pixels demarcated by these feature points is regarded as a substroke. The starting and ending positions o f each substroke are noted. For each substroke starting at its ending position, another substroke which has a similar direction to it and is 8-connected to the current stroke is searched. If the search is successful, these two substrokes are merged. This merging process is executed repeatedly until no more substrokes can be merged. In our experiment, strokes of length less than one-eighth o f the size o f the character are removed because these short strokes are less stable. The length o f a stroke is defined as the number of consecutive black pixels it comprises. Although there are many different types of stroke in a Chinese character (for example, the horizontal stroke, the vertical stroke, the left slanting stroke, the right slanting stroke, the dot stroke and the hook stroke), only the horizontal and the vertical strokes are comparatively more stable in

0

0

0

0

1

0

0

1

0

0

0

0

1

P

0

0

P

1

1

P

0

0

P

1

0

1

0

0

0

0

0

0

0

0

1

0

0

0

1

0

0

0

0

1

0

0

0

P

0

0

P

1

1

P

0

0

P

1

0

1

0

0

0

0

0

0

1

0

0

Figure 4. Turning point determination.

383

Volume 12, Number 6

PATTERN RECOGNITION LETTERS

Thinning

Exlracting Strokes

~l -I

June 1991

Extracting Feature Points

Figure 5. Stages of feature point and stroke extraction in the new approach. shape after thinning. Since these two types of stroke form the majority in a Chinese character, they are the only two types considered in our experiment. Figure 2c gives the resulting horizontal and vertical strokes extracted from the character C A I using the traditional method described in this section. From Figure 2c, it is observed that besides the occurrence of split vertical and horizontal strokes, an erroneous horizontal stroke has also occurred. Furthermore, a crossing point which is supposed to be present in the character is missing (see Figure 2b) due to the distortions caused by the thinning operation. Because of thinning, the turning point feature is also unstable. Even if only the turning point in the upper right-hand corner is considered (this type o f turning point is most stable, especially in handwritten Chinese characters), there are still two such turning points detected in the thinned character. This is not correct as there should not be any turning point feature in the character CAI. All these problems occur because both feature point and stroke information are determined locally. This makes them sensitive to the thinning operation. Moreover, thinning causes several kinds o f undesirable distortions to a Chinese character because of the abnormalities and stylistic peculiarities built into the character. The artistic (aesthetic) components such as termination bulges, serifs and ornaments, etc. (Suen (1986)) have caused many unnecessary distortions to a character when it is thinned (Zhang et al. (1982)).

3. The new method of stroke and feature point extraction

The stages of stroke and feature point extraction in the new method are shown in Figure 5. Both horizontal and vertical strokes are extracted immediately after thinning. A consecutive number of 384

black pixels of length at least one-eighth of the size of the character is considered to be a stroke. The character image is scanned in a top-down, left-right manner and all horizontal and vertical strokes are extracted. These strokes are merged based not only on their positions and directions but also on their overlap area. For two strokes occurring in the same position (see Figure 2b), the area between the ending position of the first stroke and the starting position of the next stroke in the original character image is examined. If this is an area o f consecutive black pixels, the two strokes are merged into one single stroke. For two strokes in the neighboring position (see Figure 6b), the overlap areas A and B of these two strokes are obtained from the original character image. For example, in Figure 6b, overlap area A is the total number of consecutive black pixels existing in the original character image (Figure 6a) that cover the horizontal stroke B and end at the starting position of the horizontal stroke A. Similarly, overlap area B is the total number o f consecutive black pixels starting at the end position of the horizontal stroke B and covering the horizontal stroke A. If either one o f these areas covers at least half the length o f the other stroke, these two strokes are merged into one. Using this additional heuristic (i.e., making use o f the redundant information existing in the original character image), together with the use of the positions and directions of strokes, our approach is able to overcome some of the distortions such as split strokes brought about by thinning. As a result of using the heuristic, the number of horizontal and vertical strokes in the character C A I in Figure 2a are detected correctly despite of the distortions that thinning has created (see Figure 2d). After horizontal and vertical strokes existing in a Chinese character have been extracted, feature points are deduced based on the relationships of these strokes. A cross point satisfies the property

Volume 12, Number 6

PATTERN RECOGNITION LETTERS

June 1991

ooo

ooo

|l

.

oooo oooooeoeoo

r

.ea Q.o.ee.ae

moeo • o

|

i

• ..~ overlap areaA°.|

stroke ~ , o o stroke A • overlap area B

[a)

(b) Figure 6. (a) Image of character Kou. (b) Thinned image of character Kou.

that it is an intersection point between a horizontal stroke and a vertical stroke. Moreover, this point must not be the end point of either one of the two strokes. Although a cross point also exists when a left slanting stroke intersects a right slanting stroke, it is not considered in our experiment because slanting strokes are hard to extract from a thinned character due to their multiple shapes and orientations. Furthermore, this type of cross point is always distorted into multiple three-forked points and turning points after thinning. In a similar manner, a turning point is defined as the point when a horizontal stroke meets a vertical stroke. In addition, this point must lie at the end o f the horizontal stroke and the horizontal stroke is 8-connected to the vertical stroke. Using this new approach, we are able to correctly identify the presence of a crossing point in the character CAI although it has been distorted after the character is thinned. Identification of erroneous turning points are also avoided using this approach. Hence, in our approach, feature points are determined globally and they are less sensitive to distortions created by thinning.

character font, consisting o f SONG typefaces of dimensions 32 x 32, 40 x 40, 48 x 48, 64 x 64 and HEI typefaces of dimensions 32 x 32, 40 x 40, 4 8 x 4 8 and 6 4 x 6 4 , were used to measure the stability of the two approaches over font and size variations. Each set of character font consists o f the first 3755 Chinese characters specified in the GB2312-80 standard. The four features studied were: the total number of horizontal strokes, vertical strokes, turning points and cross points in a character. The average standard deviation in feature value of the first 3755 characters t~ is used as a stability indicator. Mathematically, 1 M - - ~ ~i

°'=Mi=l

(2)

where M is the total number of characters, i.e. M = 3 7 5 5 , and t~i is the standard deviation in feature value of character i over the 8 sets of font. @i is defined as: 1 N

@i=-~, ~ (Xij- f(i) 2 for i= 1..... M

(3)

zvj=l

where N is the total number of character font, i.e.

N= 8, X~i is the feature value of character i of font 4. Experimental results and discussion

Using an IBM compatible 20 MHz 386 machine with a numeric coprocessor, an experiment was conducted to evaluate the performance of our approach against the traditional approach. 8 sets of

type j , and ~'i is the average feature value o f character i over the N s e t s of font. The results of the experiment are summarized in Figure 7. It is obser';;ed that the new approach is more stable than the traditional approach in terms of extracting horizontal stroke, vertical stroke and 385

Volume 12, Number 6

PATTERN RECOGNITION LETTERS

June 1991

1.5 I 1.4

...............°.

1.3 1.2 1.1 1

0.8

+

horizontalstroke

[]

cross point

. °.......

turningpoint °...

° °......°..

.....

..°.°°

/

-

0.70.60.5 o.4L 0.3

verticalstroke

A m

New Al~proach0'9 (a)

..................

x

Y

x

+

0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 1.1 1.2 1.3 1.4 1.5 Traditional Approach (~) Figure 7. Stability of the new approach vs the traditional approach.

turning point. Especially in the case of extracting turning point, the average standard deviation ¢~has decreased significantly from 1.45 to 0.44 when the new approach is taken instead of the traditional approach. However, the new approach is less stable when cross point is concerned. Despite this, cross points extracted using the new approach carry a higher information content. This is because in the traditional approach, cross points that exist in a character are 'usually disto~'ted. Hence, although cross point extraction using the traditional approach appears to be more stable, it has a low discriminating power. Such a situation involves a tradeoff between the stability of a feature and the discriminating power of the feature. Moreover, by taking a global approach in the extraction of feature points, thd new method is more tolerant to noise. In terms of processing time, however, our new approach takes an average of 0.34 second to process a character whereas the traditional approach takes only 0.21 second. Although processing time o f the new approach is 61.9% longer, the additional time spent pays in terms of getting more stable and accurate feature values. This is impor386

tant towards building a good optical character reader for various font types and sizes.

5. Conclusion In this paper, we have proposed a new approach o f stroke and feature point extraction. This approach reduces the problem of distortions when thinning is used for stroke and feature point extraction. Unlike the traditional approach, which makes local decisions concerning feature points, we have taken a global consideration in determining feature points. Furthermore, on top of making use o f a thinned character image to extract strokes existing in the character, we have also made use of the redundant information that exists in the original character image (image before thinning) to overcome distortions such as split strokes brought about by the thinning operation. In an experiment we have conducted, it is shown that our approach is more stable compared to the traditional approach. Although it takes an additional 0.13 second to extract strokes and feature points using our approach, the additional time is well spent as

Volume 12, Number 6

PATTERN RECOGNITION LETTERS

stability of features is an important criterion towards building a good multi-fonts, variable sizes optical character reader.

Acknowledgment This work is supported by the NUS research grant 880642. The authors would like to thank the reviewer for his valuable comments and suggestions. We would also like to thank Mr Y.W. Wong for proofreading the manuscript.

References Chen, P.N., Y.S. Chen and W.H. Hsu (1988). Stroke relation coding - - A new approach to the recognition of multi-font printed Chinese characters. Int. J. Pattern Recognition and Artificial Intelligence 2 (1), 149-160.

June 1991

Deutsch, E.S. (1972). Thinning algorithms on rectangular, hexagonal and triangular arrays. Comm. ACM 15 (9), 827-837. Hsu, W.H. and F.H. Chang (1985). Recognition of handwritten Chinese characters by structure analysis of strokes. Computer Processing of Chinese and Oriental Languages 2 (2), 101-112. Kobayashi, K., F. Yoda, K. Yamamoto and H. Nambu (1983). Recognition of handprinted kanji characters by the stroke matching method. Pattern Recognition Letters 1,481-488. Suen, C.Y. (1986). Character recognition by computer and applications. In: Young, T.Y. and Fu, K.S., Eds., Handbook of Pattern Recognition and Image Processing. Academic Press, New York, 569-586. Zhang, X.Z. and Y. Xia (1983). The automatic recognition of handprinted Chinese characters - - A method of extracting an ordered sequence of strokes. Pattern Recognition Letters 1, 259-265. Zhang, X.Z., Y. Xia and C.J. Sun (1982). An investigation of the recognition of handprinted Chinese characters by stroke extraction. Chinese J. Computers 5 (6), 461-468.

387