13
Pattern Recognition, Vol. 31, No. 6, pp. 651 663, 1998 ( 1998 Pattern Recognition Society. Published by Elsevier Science Ltd All rights reserved. Printed in Great Britain 00313203/98 $19.00#.00 PII: S0031-3203(97)00080-0 A CHINESE-CHARACTER-STROKE-EXTRACTION ALGORITHM BASED ON CONTOUR INFORMATION CHUNGNAN LEE* and BOHOM WU Institute of Computer and Information Engineering, National Sun Yat-Sen University, Kaohsiung, Taiwan, R.O.C. (Received 2 October 1996; in revised form 1 July 1997) Abstract —In this paper, we present a new stroke-extraction algorithm that integrates all levels of contour information including boundary points, dominant points, corner points, segments, cross-section-sequence graph and character structure to extract strokes of Chinese characters. In the algorithm, first, the boundary points are extracted, then the dominant and corner points are detected. Third, the character structure including singular and regular regions are extracted by the contour information and a modified cross- section-sequence graph (CSSG). Finally, a Bezier curve taking dominant points and corner points as inputs is used to check the continuity of strokes. Experimental results show that the proposed algorithm can correctly extract the strokes up to 95% from printed and handwritten test samples based on the human perception. Compared with a typical thinning approach, the proposed algorithm gives better results in terms of both stroke smoothness and the precise number of stroke extractions. ( 1998 Pattern Recognition Society. Published by Elsevier Science Ltd. All rights reserved Stroke extraction Contour information Dominant points Cross-section-sequence graph Bezier curve Structural matching Chinese character 1. INTRODUCTION The stroke is an essential information to the structural matching of Chinese characters.(1,2) The structure of a Chinese character can be characterized by the rela- tive position and orientation of strokes and is invari- ant to size and orientation. The major difference between the Chinese characters and the Latin family of languages is that most of the strokes of Chinese characters are composed of vertical or horizontal line segments. Many algorithms have been developed to extract strokes either by thinning or non-thinning approaches.(3~21) The main problem for the thinning is the deformation of the skeletons. As a result, it produces distorted strokes. Many authors have pro- posed algorithms to improve the stroke segmentation, such as the maximum-circle technique by Liao and Huang,(14) a modified Hough transform by Cheng et al.,(15) etc. Liao and Huang(8) use the BernsteinBezier curve and Wang et al. use the quadratic equa- tion to do curve fitting.(9) In addition to the algo- rithms mentioned above, the non-thinning approach is also used to solve the problem. Suzuki and Mori (28) use CSSG to describe structures. Chang and Lai(30) use boundary properties at junction points and the relaxation techniques. Huang et al.(18) use a cross- section-sequence graph. Jiang et al.(20) use a rubber band to extract small components, called parts, and * Author to whom correspondence should be addressed. Tel.: (07) 5252000-4313; Fax: (07) 5254301; e-mail: cnlee@ mail.nsysu.edu.tw. then merge the parts into strokes; however, the stroke does not necessarily correspond to those of human perception or writing. In this paper, we focus on the stroke extraction of Chinese characters and propose a new algorithm in- tegrating all levels of contour information. Figure 1 shows the information flow of the algorithm. In Fig. 1 we first extract the boundary points. Second, the corner points are detected. Then these corner points are used to find contour segments. Fourth, we modified the cross-section-sequence graph to find sin- gular regions which are defined as an end point region or a junction region. Finally, the Bezier curve is used to check the continuity of segments of connec- tion regions and determine whether they belong to the same stroke. The result is shown in Step 5 of Fig. 1. Each step of extracted information is preserved through the process. Unlike the traditional bottom- up approach in which the current step of information extraction is based only on the previous step, we accumulate all extracted information until the final extraction of strokes is done. The longer contour segment of the stroke tends to preserve better stroke information and is robust to the interfering contour. Hence, stroke extraction in the proposed algorithm is based on the longer contour segment of stroke instead of the medial axis. The rest of the paper is organized as follows. Section 2 describes the contour extraction and corner points detection. Sec- tion 3 presents the detection of the structure of char- acters. In Section 4 we describe the stroke extraction. The experimental results and discussions are given in 651

A Chinese-character-stroke-extraction algorithm based on contour information

Embed Size (px)

Citation preview

Page 1: A Chinese-character-stroke-extraction algorithm based on contour information

Pattern Recognition, Vol. 31, No. 6, pp. 651—663, 1998( 1998 Pattern Recognition Society. Published by Elsevier Science Ltd

All rights reserved. Printed in Great Britain0031—3203/98 $19.00#.00

PII: S0031-3203(97)00080-0

A CHINESE-CHARACTER-STROKE-EXTRACTIONALGORITHM BASED ON CONTOUR INFORMATION

CHUNGNAN LEE* and BOHOM WU

Institute of Computer and Information Engineering, National Sun Yat-Sen University, Kaohsiung,Taiwan, R.O.C.

(Received 2 October 1996; in revised form 1 July 1997)

Abstract—In this paper, we present a new stroke-extraction algorithm that integrates all levels of contourinformation including boundary points, dominant points, corner points, segments, cross-section-sequencegraph and character structure to extract strokes of Chinese characters. In the algorithm, first, the boundarypoints are extracted, then the dominant and corner points are detected. Third, the character structureincluding singular and regular regions are extracted by the contour information and a modified cross-section-sequence graph (CSSG). Finally, a Bezier curve taking dominant points and corner points as inputsis used to check the continuity of strokes. Experimental results show that the proposed algorithm cancorrectly extract the strokes up to 95% from printed and handwritten test samples based on the humanperception. Compared with a typical thinning approach, the proposed algorithm gives better results interms of both stroke smoothness and the precise number of stroke extractions. ( 1998 Pattern RecognitionSociety. Published by Elsevier Science Ltd. All rights reserved

Stroke extraction Contour information Dominant points Cross-section-sequence graphBezier curve Structural matching Chinese character

1. INTRODUCTION

The stroke is an essential information to the structuralmatching of Chinese characters.(1,2) The structure ofa Chinese character can be characterized by the rela-tive position and orientation of strokes and is invari-ant to size and orientation. The major differencebetween the Chinese characters and the Latin familyof languages is that most of the strokes of Chinesecharacters are composed of vertical or horizontal linesegments. Many algorithms have been developed toextract strokes either by thinning or non-thinningapproaches.(3~21) The main problem for the thinningis the deformation of the skeletons. As a result, itproduces distorted strokes. Many authors have pro-posed algorithms to improve the stroke segmentation,such as the maximum-circle technique by Liao andHuang,(14) a modified Hough transform by Chenget al.,(15) etc. Liao and Huang(8) use the Bernstein—Bezier curve and Wang et al. use the quadratic equa-tion to do curve fitting.(9) In addition to the algo-rithms mentioned above, the non-thinning approachis also used to solve the problem. Suzuki and Mori (28)use CSSG to describe structures. Chang and Lai(30)use boundary properties at junction points and therelaxation techniques. Huang et al.(18) use a cross-section-sequence graph. Jiang et al.(20) use a rubberband to extract small components, called parts, and

*Author to whom correspondence should be addressed.Tel.: (07) 5252000-4313; Fax: (07) 5254301; e-mail: [email protected].

then merge the parts into strokes; however, the strokedoes not necessarily correspond to those of humanperception or writing.

In this paper, we focus on the stroke extraction ofChinese characters and propose a new algorithm in-tegrating all levels of contour information. Figure 1shows the information flow of the algorithm. In Fig. 1we first extract the boundary points. Second, thecorner points are detected. Then these corner pointsare used to find contour segments. Fourth, wemodified the cross-section-sequence graph to find sin-gular regions which are defined as an end point regionor a junction region. Finally, the Bezier curve isused to check the continuity of segments of connec-tion regions and determine whether they belong tothe same stroke. The result is shown in Step 5 ofFig. 1. Each step of extracted information is preservedthrough the process. Unlike the traditional bottom-up approach in which the current step of informationextraction is based only on the previous step,we accumulate all extracted information until thefinal extraction of strokes is done. The longer contoursegment of the stroke tends to preserve betterstroke information and is robust to the interferingcontour. Hence, stroke extraction in the proposedalgorithm is based on the longer contour segment ofstroke instead of the medial axis. The rest of thepaper is organized as follows. Section 2 describes thecontour extraction and corner points detection. Sec-tion 3 presents the detection of the structure of char-acters. In Section 4 we describe the stroke extraction.The experimental results and discussions are given in

651

Page 2: A Chinese-character-stroke-extraction algorithm based on contour information

Fig. 1. The information flow of the algorithm.

Fig. 2. (a) The 3]3 template with weights. (b) 8-neighbors of P. (c) An example of the index calculation.

Table 1. The attribute look-up table for category, directioncode, and one curvature. Category is used for the contour-point detection, category values for interior, noise and con-tour points are 1, 2 and 3, respectively. Direction code is usedto detect the Freeman-chain code for a pixel. One curvature

is used for the dominant detection

Index Category Direction code Curvature

2 2 2 2

119 1 Nil Nil120 3 6 !1121 3 0 !7122 3 6 !1123 3 1 !62 2 2 2

200 3 7 5201 3 0 !2202 3 7 5203 3 1 !1204 2 Nil Nil2 2 2 2

Section 5. Finally, conclusions are given in the lastsection.

2. CONTOUR INFORMATION EXTRACTION

Contour is one of the most fundamental informa-tion after image segmentation. A set of border pixelpositions are extracted and recorded in an appropri-ate data structure. To ensure the correct contourextraction we follow the traditional assumption that

the contour has a simple cycle form. In other words,different contours cannot exactly share a single pixel.

To detect contour information we use a 3]3template ¹ with different weights(24,25) as shown inFig. 2a to operate on a binary image f (x, y), whosecharacter regions have value one and backgroundpoints have value zero. For 8 neighbors of P as shownin Fig. 2b it has 256 combinations that are indexed by+7

i/0nif (x

ni, y

ni). An example is shown in Fig. 2c.

We define an attribute look-up table that is indexedfrom 0 to 255 and has three kinds of attributes—category, direction code, and one curvature for eachindex as shown in Table 1. Using table look-up hasa couple of advantages including efficiency andpossible parallel implementation as stated in reference(25). The values of three attributes are assigned foreach index before extracting the contour information.The definition of the three attributes and how thevalues are assigned will be discussed in the followingsubsections.

2.1. Contour points detection

Pixels in f (x, y) are classified into three catego-ries—interior, noise, and contour points which aredefined as follows.

652 C. LEE and B. WU

Page 3: A Chinese-character-stroke-extraction algorithm based on contour information

Fig. 3. Examples of interior point.

Fig. 4. Examples of noise point.

Fig. 5. Examples of contour point.

Fig. 6. (a) The contour following direction. (b) Freeman-chain code.

1. Interior point: when (n0'n

2'n

4'n

6)"1 and

(n1sn

3sn

5sn

7)"1, then the pixel is defined as

an interior point. The illustrations of interior pointare shown in Fig. 3.

2. Noise point: when ni'n

i`1'2'n

(i`m).0$8is 1,

where 04i47, m51, then (ni, n

i`1,2,

n(i`m).0$8

) is defined as a set of consecutive points.If the neighborhood combinations satisfy the fol-lowing two criteria, then the pixel is a noise point:

(a) There does not exist any consecutive points asshown in Figs 4a and b.

(b) The number of sets of consecutive points equalstwo and there does not exist a simple cycle asshown in Fig. 4c.

3. Contour point: f (x, y)C (interior and noise points).Some contour points are shown in Fig. 5.

Based on the discussions above we can assign thevalue to the category attribute for all 256 indices inTable 1. For example, the value for the index 62 is 3 as

shown in Fig. 5. The result of contour points arestored in a new image, where the contour point is setto one and noise and interior points are set to zero.When a noise point is detected, its pixel value in theoriginal image is set to zero and the process of con-tour point detection for the neighboring lines en-compassed by the template has to be redone.

A Chinese-character-stroke-extraction algorithm 653

Page 4: A Chinese-character-stroke-extraction algorithm based on contour information

Fig. 7. Examples of Freeman-chain code for contour point.

Fig. 9. (a) The character image. (b) The result after the detection of dominant points. (c) The corner pointsafter the corner detection process.

Fig. 8. A few examples of computing one curvature.

2.2. Contour following

After contours are extracted, we trace the contourof the same region by using the Freeman-chain code.The exterior boundary is traced by the clockwise direc-tion and the interior boundary is traced by the counter-clockwise direction. The contour following directionand the Freeman-chain code(26) are shown in Fig. 6.

Based on the discussion above again we canassign code for the neighboring points of P. Forexample, as shown in Fig. 7 the chain codes for theneighboring points of indices 62, 92, 231 are 5, 6, 2,respectively.

2.3. Corner detection

The intersection of strokes will cause a dramaticchange in the contour. The corner detection is todetect such a change. We first use the Teh and Chin’s

one curvature algorithm(27) to detect the dominantpoint from the chain code. Only when the pixel’scategory value is 3, we have to define its one curva-ture. As shown in Fig. 8 the one curvature value forindices 62 and 126 are 0 and 1, respectively. Second,the region of support is calculated. Finally, the fourpasses in reference (27) are used to detect the domi-nant points.

The character image after dominant points detec-tion is shown in Fig. 9b. Though the Teh and Chin’salgorithm works excellent on dominant points, fur-ther processing is required to extract segments forstroke extraction. We extract corner points from thedominant points by detecting the dramatic change.Let p

1, p

2, and p

3be three consecutive points, a be the

vector formed by p2

and p1, and b be the vector

formed by p2

and p3. Then, the directional deviation

between a and b is

cos~1a · b

Da D DbD.

The directional deviation is limited to the rangefrom 0 to 180 and the direction is clockwise.

Steps for corner detection are as follows.

Step 1: Remove all neighboring points whose di-rectional deviations are larger than h

1. The parameter

h1

is set to 170.Step 2: Start from an arbitrary point p

i, follow

clockwise, and calculate the reference vector frompito p

i`1and the vector from p

i`1to p

i`2. If the angle

deviation between these two vectors is larger thana preset parameter h

2, then keep p

i`1and use the

vector from pi`1

to pi`2

as a new reference vector.

654 C. LEE and B. WU

Page 5: A Chinese-character-stroke-extraction algorithm based on contour information

Fig. 10. The normal direction at ci.

Otherwise, skip the point pi`1

and check the newvector p

i`2to p

i`3. The parameter h

2is set to 15.

Step 3: Repeat Step 2 counterclockwise.Step 4: Remove the remaining points whose neigh-

boring points have directional deviation larger than 155.

After the four steps are performed, the corner pointsare detected, which is shown in Fig. 9c.

3. DETECTION OF CHARACTER STRUCTURE

In order to connect two sub-strokes, a crossingregion has to be detected first. The common approachfor crossing region extraction are thinning, run-length coding, and cross-section-sequence graph.Due to working with regions, the CSSG gives abetter result among these three approaches. We applythe CSSG approach, but make a couple of majorchanges. We use contour segments and information tofind the cross-section sequence that is more stableand memory efficient than the traditional CSSGapproach.

3.1. Contour segment extraction

The first corner encountered is the start point andthe second corner encountered is the end point ofthe segment. The definition of a segment is as follows.Let segment Sg be an order sequence. Sg"Ss, c

1,2 , c

k, eT, where s is the start point, e is the end

point, and c12k

are contour points. s and e are deter-mined by the corner points. ¸(Sg) is the length of thesegment. ¸(Sg)"k, where k is the number of contourpoints between s and e.

3.2. Construction of CSSG

Cross section is defined as a path between an orderpair of contour points, cs(c

i, opp(c

i)), where c

iand

opp(ci) belong to opposite contour segments of the

same region. A cross-section sequence is a sequence ofcross-sections with no crossing.(28) A character imagemay contain many cross-section sequences. We firstdefine the normal direction as follows.

For a segment seg, s is the start point, e the endpoint and c

ithe ith contour point at the segment. Let

dir(p, q) be the direction from point p to point q anddist(p, q) be the Euclidean distance from point p topoint q. Let *h be the angle deviation betweendir(c

i, e) and dir(s, c

i) and */"[dist(c

i, e)/(dist(s, c

i)#

dist(ci, e) )]**h.

The approximation tangent direction tan—dir atciis computed as

tan—dir"(dir (s, ci)#*/) mod 360.

If the angle deviation between tan—dir and dir(ci, e) is

greater than *h, then

tan—dir"(dir (s, ci)!*/#360) mod 360.

The normal direction at ciis tan—dir#90 as shown in

Fig. 10.

To construct the CSSG we use the following pro-cedures.

Step 1: Use the histogram distribution of the ratioof the segment length to the longer side length of theimage from a sample set to determine the thresholdvalue, then use the threshold value to suppress noisesegments.

Step 2: Use those contour points of the remainingsegment, seg

j, j"1,2 ,m to construct cross section.

Because points that close to the end region might bedistorted by noise, we use c

l,2 , c

k~lto construct the

cross section, where l is set to 0.1*k, and then use thenormal direction of point c

ito find a point, opp(c

i), on

the opposite side. The opposite segment is representedby oppseg(c

i, seg

j). If the opposite segment is not sup-

pressed and the angle between the tangent direction ofciand the tangent direction of oppseg(c

i, seg

j) is larger

than a threshold, ang—thr, then the cross section isvalid, otherwise the cross section is invalid. Theang—thr is set to 155.

Step 3: Group those cross sections that belong toseg

jand oppseg(c

i, seg

j) as a cross section sequence

which is represented by Mcs(c1, opp(c

1)),2,cs(c

m, opp(c

m)),

where m is the number of cross sections. When m islarger than a twentieth of the longer side length of theimage, then the cross section sequence is valid, other-wise it is invalid. We use the first and last crosssections cs(c

1, opp(c

1)) and cs (c

m, opp(c

m) ) to index

the sequence and remove the rest of cross sections tosave the memory.

Step 4: Find all cross section sequences and sortthem from small to large by length. If an intersectionoccurs, then remove the longer one. Figure 11 showsthe intersection of cross sections.

After applying the above four steps, one can get thecross section sequence graph as shown in Fig. 12.

3.3. Contour segments pairing

The purpose of contour pairing is to find meaning-ful segments for each stroke. Usually, there exist twolonger segments that are more significant than others,which are called meaningful segments. Other seg-ments of the stroke are called meaningless segments,

A Chinese-character-stroke-extraction algorithm 655

Page 6: A Chinese-character-stroke-extraction algorithm based on contour information

Fig. 11. An example showing the intersected cross sections.

Fig. 12. The cross-section-sequence graph. Only the firstand last cross sections are used to represent the cross section

sequences.

Fig. 13. The meaningful segments after pairing.

Fig. 14. An example showing the two kinds of degree type.

such as end region segment, singular region segment,etc. Meaningful segments are used to extract stroke.The meaningful segments generated by pairing areshown in Fig. 13.

3.4. Extraction of singular regions

As shown in Fig. 12 there are many partitionedregions in the CSSG. For each region it may connectto several other regions. The number of regions con-nected to a region is called region adjacency number.Those regions with end region, cross section, andjunction region, are called singular regions. Singularregions provide important information to evaluatethe continuity of a stroke. The method to extracta singular region is as follows:

Step 1: Remove those corner points that do notbelong to the meaningful segments.

Step 2: Start from a cross point, (ci), of an arbitrary

cross section. If the cross section has not been marked,then set its traced number to one, where the tracednumber is defined as the number of times the crosssection has been traced, and then use opp(c

i), as a new

starting point. If all the cross sections have beensearched, then go to Step 4.

Step 3: Follow the contour from the starting pointto find the next point until the following conditionsare satisfied.

(a) If the point is a corner point, then recordthe segment that contains the corner point andcheck its direction. If the point is an end point, thenthe segment is an inward direction, otherwise thesegment is an outward direction as shown inFig. 14.

(b) If a cross point of the cross section is encoun-tered, then check whether the cross section isa starting cross section and how many times thecross section has been traced.

(b-1) If the traced number is 2, then it is nota starting cross section and the search fails.

(b-2) If the point is a starting point, then thesearch succeeds and the region is established. Thesegments found in Step 3(a) are connected to theregion, then set the traced number of the crosssections to 2.

Continue the processes (a) and (b) until the stack isempty and then return to Step 2.

(c) If the traced number of the cross sections iszero, then the cross section has not been encoun-tered, then set its traced number to 1, push thecross point onto the stack, and jump to theopposite cross point to continue to the next crosspoint.

(d) If the traced number is one, then jump to theopposite cross point to continue to the next point.

Fig. 15 shows the process of Steps 2 and 3.Step 4: Remove those regions without any connec-

ted segments.

The result for the singular region extraction isshown in Fig. 16.

656 C. LEE and B. WU

Page 7: A Chinese-character-stroke-extraction algorithm based on contour information

Fig. 15. An example of the extracting regions process. (a) A CSSG with three dashed lines as cross sections.(b) The cross section c is used as the starting cross section, the cross point is pushed onto the stack and ismarked as a black dot, then jump to the opposite cross point as a new starting point. Following the contourone encounters the cross sections a and b that are pushed onto the stack and marked as black dots. (c)Result of a successful search to obtain region 1. (d) The cross section b is popped from the stack to startanother search. (e) Region 2 is a result of another successful search. (f ) The cross section a is popped to startanother search. Since the cross section b has been successfully searched, its traced number is 2. Therefore,the search fails. (g) The cross section c is popped to start another search. (h) Region 3 is a result of another

successful search.

Fig. 16. The singular regions.

Fig. 17. The survival segments.

Fig. 18. The region connection graph.

3.5. Region connection

After singular regions are extracted, we have to findthe connection between singular regions and regularregions. For all pairing meaningful segments, we take

the longest segment of the stroke. The longer segmenttends to preserve more information. Fig. 17 shows thesurvival segments. Based on the singular region andsurvival segment the relationship of regions can beextracted. The number of regions connected to a re-gion is called the region connection number. Theresult is shown in Fig. 18.

4. STROKE EXTRACTION

To extract the stroke one has to calculate the conti-nuity of segments. In the literature, most of the papersfocus on the directional deviation between two medialaxes. Here, we focus on the continuity of the contour.

A Chinese-character-stroke-extraction algorithm 657

Page 8: A Chinese-character-stroke-extraction algorithm based on contour information

Fig. 19. (a) The two segments are not consistent. (b) The twosegments are consistent.

Fig. 20. The final region connection graph.

Fig. 21. Test samples of printed characters.

4.1. Continuity checking

If the curvature change of two segments is quiteuniform, then one can use some sampled points torepresent the segments and to fit a curve. Thiscurve should either close to the segments or shouldnot close to the segments. For example, let seg

1and

seg2

be two segments with s1) e

1and s

2) e

2as the

starting points and the end points, respectively. Asshown in Fig. 19a where two segments do not belongto the same stroke, the error distance between thefitted curve and the segments will be large. On thecontrary, as shown in Fig. 19b the curve fits the seg-ments uniformly.

The Bezier polynomial is a popular representationmodel in 3D graphics. The application of the Bezierpolynomial in stroke segmentation can be found inreference (14). The Bezier polynomial is represented asfollows:

B(t)"m+i/0Am

i BPiti (1!t)m~i for 04t41

where P0

and Pm

are end points, P1, P

2,2, P

m~1are

control points.

Am

i B ti (1!t)m~i

is Bernstein polynomial basis function, i"0,2 ,m,and m is the order of the polynomial.

We use m#1 contour points to find the order mof the Bezier curve, then generate n#1 points withequal incremental interval with n"( (m#1)/2) #1.

658 C. LEE and B. WU

Page 9: A Chinese-character-stroke-extraction algorithm based on contour information

Fig. 23. One example of tested characters: (a) character image; (b) thinned image; (c) result after cornerdetection; (d) CSSG, (e)—(i) the stroke extraction of the character.

Fig. 22. (a) Character image. (b) The character is separatedinto three strokes from the human perception.

4.2. The process of stroke extraction

There are two phases in stroke extraction process.In the first phase, the T-junction is processed.The T-junction can be detected from the region con-nection number and the region adjacent number. Ifthe two numbers are not equal, then it is a T-junction.In the second phase, we calculate the continuityof segments. The procedure can be summarized asfollows.

Step 1: When the region connection number is lar-ger than 1, we pair all possible segments. Each pair ofsegments is a segment group.

Step 2: For each segment group the continuity ofthe segments is calculated as follows:

(a) The inward segment should be paired withthe outward segment.

(b) The dominant points of segments are usedas control points to generate Bezier curve.The input of dominant points is in order withoutrepetition.

(c) The corner points are used to check the fittingof Bezier curve. For each corner it measures thedistance to the Bezier curve.

(d) When the distance value is smaller thana threshold, which is also determined from a sampleset, then two segments are connectable and redrawthe region connection graph.

Step 3: After all the regions are processed, we canobtain the region connection graph as illustrated inFig. 20.

5. EXPERIMENTS AND DISCUSSIONS

5.1. Test samples and results

To test the effectiveness of our algorithm we applythe algorithm to 200 Gothic style characters that arerandomly selected from the Big-5 code and are shownin Fig. 21. The image size for each characters is128]128.

The classification of stroke extraction is basedon human perception and not according to the defini-tion in the dictionary. For example, the character ‘ ’as shown in Fig. 22a is defined as one stroke inthe dictionary. However, from the human perceptionit should be divided into three strokes as shownin Fig. 22b. When all the strokes of a characterare completely extracted, it is called a correctextraction.

We use one character as an example to show thesteps of the algorithm. Fig. 23b shows the thinnedcharacter. As one can see the thinned character hasdistortion in the junction region which is the commonproblem for the thinning approach. Fig. 23c showsthe results after corner detection, Fig. 23d shows theresults of modified CSSG. Figure 23e—h show thesequence of stroke extraction. The stroke is the con-tour of large boundary for each stroke image. Amongthe 200 characters tested the algorithm has extracted

A Chinese-character-stroke-extraction algorithm 659

Page 10: A Chinese-character-stroke-extraction algorithm based on contour information

Fig. 25. Test samples of handwritten characters.

Fig. 24. (a) Character image. (b) CSSG. (c) Result after stroke extraction.

the stroke correctly for 195 characters. Only five charac-ters, , , , , and , are ambiguously extrac-ted on a specific radical. For example, Fig. 24 showsthat the stroke ‘ ’ is extracted as ‘ ’ due to the undetec-ted corner which is marked by a circle in Fig. 24b.

The algorithm is also applied to 64 handwrittencharacters as shown in Fig. 25. Among the 64 charac-ters tested, the algorithm has extracted the strokecorrectly for 62 characters. Two characters, and

, are extracted ambiguously as ‘ ’ and ‘ ’.

660 C. LEE and B. WU

Page 11: A Chinese-character-stroke-extraction algorithm based on contour information

Fig. 26. (a) Some of the samples from the test data. (b) Results obtained by using Cheng and Hsu’ssubstroke extraction algorithm. (c) Results obtained by using the proposed algorithm.

5.2. Comparisons with a typical medial axis approach

To evaluate the performance of the algorithm wecompare the proposed algorithm with a typical me-dial-axis approach. Due to the choice of the thinningmethod and the ways of stroke extraction, the medial-axis approach can give a different result. Hence, thecomparison here is qualitative not quantitative. Themedial-axis procedure we implemented basically fol-lows the method proposed by Cheng and Hsu.(31)First, the character is thinned by the thinning com-mand in MATLAB. After thinning, feature point find-ing and tracing, and sub-stroke extracting methods asoutlined in reference (31) are applied to extract thesub-strokes. Some of the results obtained by using themedial-axis approach are shown in Fig. 26. Fig-ure 26a—c show some samples of test data, resultsfrom the medial-axis approach, and results from ourproposed algorithm, respectively. As one can see, theproposed algorithm yields much smoother strokesespecially in the junction region.The number ofstrokes extracted is also better than the medial-axisapproach. Of course, the sub-stroke approach can befurther processed to obtain the full stroke. However,some problems exist in those characters with 3-fork or4-fork junctions, such as ‘‘ ’’, ‘‘ ’’ ; extra effort has

to be expended to stroke merging and spurious seg-ments removal.

5.3. Comparisons with a typical non-thinning approach

We also compare the proposed algorithm to a typi-cal cross-section sequence graph approach presentedby Huang et al.(18) They first used a quadratic fit ofboundary point to compute the cross sections insteadof the gradient method, then constructed the cross-section-sequence graph from which the skeletons andstrokes of characters are extracted. The last two char-acters of Fig. 26a are directly scanned from the paperand their results are shown in Fig 27. In these twoparticular characters, the curved stroke in each char-acter that is circled is extracted as two straight linesegments reported by them. However, by our contourapproach, it is extracted as one stroke only.

5.4. Discussions

As one can see the extracted strokes are those of thelonger contours of the strokes. The longer contour ofa stroke tends to preserve more information. Further-more, it is more robust during the stroke extraction.Especially, for the T-junction where one side of the

A Chinese-character-stroke-extraction algorithm 661

Page 12: A Chinese-character-stroke-extraction algorithm based on contour information

Fig. 27. Two test samples and their results directly scanned from Ref. [18].

contour clearly represents the stroke. But the otherside of the contour may be interfered by the intersec-tion of the other stroke. For the medial axis or theskeleton approach the intersection region may causethe problem. Because the proposed algorithm uses thecontour information, it is very efficient for a characterwith wide strokes. On the contrary, the thinning algo-rithm needs to spend many iterations to obtain theskeleton.

Though the algorithm works very effectively onstroke extraction, there are still several points tobe improved. First, for those smooth curves the cornerdetection may fail to detect the right corner; as aresult, the stroke may be extracted wrongly as shownin Fig. 24. Second, when applying the algorithm todifferent fonts the parameters used in the algorithmhave to be tuned. Third, the strokes cannot beseverely distorted, otherwise the extra strokes will beextracted.

6. CONCLUSIONS

We have developed a new stroke-extraction algo-rithm that integrates all levels of the contour informa-tion. The contour information includes boundarypoints, dominant points, corner points, contour seg-ments, cross-section-sequence graph, and characterstructure. The boundary points, dominant points, cor-ner points, and contour segments are extracted first.Then, the boundary point, corner points and contoursegment are used to find the CSSG. Third, we usecontour segments and the CSSG to extract the char-acter structure. Finally, a Bezier curve taking domi-nant points and corner points as inputs is used tocheck the continuity and to extract the stroke. Bothprinted and handwritten characters are used to testthe effectiveness of the algorithm. Experimental re-sults show that the proposed algorithm can correctlyextract the strokes up to 95% for both test samples. Infuture the algorithm will be incorporated into a struc-tural-matching-recognition system.

7. SUMMARY

In this paper, we present a new stroke-extractionalgorithm that integrates all levels of contour infor-mation including boundary points, dominant points,

corner points, segments, cross-section-sequencegraph and character structure to extract strokesof Chinese characters. Unlike the traditional bottom-up approach in which the current step of informationextraction is only based on the previous step, we useand accumulate all extracted information until thefinal extraction of strokes is done. The longer contoursegment of the stroke tends to preserve better strokeinformation and is robust to the interfering contour.Hence, stroke extraction in the proposed algorithm isbased on the longer contour segment of stroke insteadof the medial axis. In the algorithm, first, the bound-ary points are extracted, then the dominant and cor-ner points are detected. Third, the character structureincluding singular and regular regions are extractedby the contour information and a modified cross-section-sequence graph (CSSG). Finally, the Beziercurve is used to check the continuity of strokes. Ex-perimental results show that the proposed algorithmcan correctly extract the strokes up to 95% fromprinted and handwritten test samples based on thehuman perception. Compared with a typical thinningapproach, the proposed algorithm gives better resultsin terms of both smooth stroke and the precise num-ber of stroke extractions.

Acknowledgements—The authors would like to thank thereviewers for their valuable comments. We are also indebtedto Shi-bang Yai for his help in the implementation of themedial-axis approach. This research was partially supportedby the National Science Council of Taiwan, R.O.C., undercontract NSC-86-2213-E-110-029.

REFERENCES

1. T. H. Hildebrandt and W. Liu, Optical recognition ofhandwritten Chinese characters: advances since 1980,Pattern Recognition 26 (2), 205—225 (1993).

2. S. Mori, K. Yamamoto and M. Yasuda, Research onmachine recognition of handprinted characters, IEEE¹rans. Pattern Anal. Machine Intell. 6(4), 386—405(1984).

3. L. Lam, S. W. Lee and C. Y. Suen, Thinning methodolo-gies—a comprehensive survey, IEEE ¹rans. PatternAnal. Machine Intell. 14 (9), 869—885 (1992).

4. L. Lam and C. Y. Suen, Evaluation of thinning algo-rithm from an OCR viewpoint, Int. Conf. on DocumentAnal. and Recognition, pp. 35—40 (1993).

5. H. Ogawa and K. Taniguchi, Thinning and stroke seg-mentation for handwritten Chinese character recogni-tion, Pattern Recognition 15(4), 299—308 (1982).

662 C. LEE and B. WU

Page 13: A Chinese-character-stroke-extraction algorithm based on contour information

6. P. N. Chen, Y. S. Chen and W. H. Hsu, Stroke relationcoding—a new approach to the recognition of multi-font printed Chinese characters, Int. J. Pattern Recogni-tion and Artificial Intell. 2(1), 149—160 (1988).

7. S. L. and W. H. Tsai, Recognizing handwritten Chinesecharacters by stroke-segment matching using an iter-ation scheme, Int. J. Pattern Recognition and ArtificialIntell. 5(1&2), 175—197 (1991).

8. C. W. Liao and J. S. Huang, A transformation invariantmatching algorithm for handwritten Chinese characterrecognition, Pattern Recognition 23(11), 1167—1188(1990).

9. A. B. Wang, K. C. Fan and J. S. Huang, Recognition ofhandwritten Chinese characters by modified relaxationmethods, Image »ision Comput. 12 (8) (1994).

10. A. J. Hsieh, K. C. Fan, T. I. Fan and Chin-Wen Ho,A stroke-based handwritten Chinese character recogni-tion system using the greedy matching method, J.Inform. Sci. Engng 11, 1—22 (1995).

11. H. D. Chang and J. F. Wang, A robust stroke extractionmethod for handwritten Chinese characters, Int. J. Pat-tern Recognition and Artificial Intell. 8 (5), 1223—1239(1994).

12. C. C. Hsieh and H. J. Lee, A probabilistic stroke-basedViterbi algorithm for handwritten Chinese charactersrecognition, Int. J. Pattern Recognition and ArtificialIntell. 7(2), 329—352 (1993).

13. K. W. Gan and K. T. Lua, A new approach to stroke andfeature point extraction in Chinese character recogni-tion, Pattern Recognition ¸ett. 12, 381—387 (1991).

14. C. W. Liao and J. S. Huang, Stroke segmentation byBernstein—Bezier curve fitting, Pattern Recognition,23(5), 475—484 (1990).

15. F. H. Cheng, W. H. Hsu and M. Y. Chen, Recognition ofhandwritten Chinese characters by modified houghtransform techinques, IEEE ¹rans. Pattern Anal.Machine Intell. 11(4), 429—439 (1989).

16. L. Y. Tseng and C. T. Chuang, An efficient knowledge-based stroke extraction method for multi-font Chinesecharacters, Pattern Recognition 25 (12), 1445—1458(1992).

17. C. T. Chuang and L. Y. Tseng, A stroke extractionmethod for multifont Chinese characters based on thereduced special interval graph, IEEE ¹rans. SystemsMan Cybernet. 25 (7), 1171—1178 (1995).

18. J. S. Huang, Tzung Rern Jang, Fu Chang, Extractingstrokes of a Chinese character based on cross-sectionsequence graph, J. Inform. Sci. Engng 8, 512—524 (1992).

19. F. Chang, Y. C. Chen and H. S. Don, Stroke segmen-tation as a basis for structural matching of Chinesecharacters, Int. Conf. on Document Anal. and Recogni-tion, pp. 35—40 (1993).

20. J. Jiang, W. Kim and H. Tominaga, Recognition andrepresentation of text characters using rubber band, Int.Conf. on Document Anal. and Recognition, pp. 955—958(1993).

21. J. H. Wang and Shinji Ozawa, Automated generation ofChinese character structure data based on extracting thestrokes, Int. Conf. on Document Anal. and Recognition,pp. 806—809 (1993).

22. S. M. Ali and R. E. Burge, A new algorithm for extract-ing the interior of bounded regions based on chaincoding, Comput. »ision Graphics Image Process. 43,256—264 (1988).

23. B. B. Chaudhuri and S. Chandrashekhar, Neighboringdirection runlength coding: an efficient contour codingscheme, IEEE ¹rans. Systems Man Cybernet. 20(4) (1990).

24. C. A. Cabrelli and U. M. Molter, Automatic representa-tion of binary images, IEEE ¹rans. Pattern Anal.Machine Intell. 12(12) (1990).

25. F. Y. Shih and W.T Wong, A new safe-point thinningalgorithm based on the mid-crack code tracing, IEEE¹rans. Systems Man Cybernet. 25(2) (1995).

26. H. Freeman, Computer processing of line drawingimages, Comput. Survey 6(1), 57—97 (1974).

27. C. H. Teh and R. T. Chin, On the detection of dominantpoints on digital curves, IEEE ¹rans. Pattern Anal. andMachine Intell. 11(8), 859—872 (1989).

28. T. Suzuki and S. Mori, Structureal description of lineimages by the cross section sequence graph, Int. J. PatternRecognition and Artificial Intell. 7(5), 1055—1076 (1993).

29. T. Y. Zhang and C. Y. Suen, A fast parallel algorithm forthinning digital patterns, Comm. ACM 27, 236—239(1984).

30. F. Chang and S. H. Lai, Stroke segmentation for Chinesecharacter recognition, Proc. 1st National Workshop oncharacter recognition, ROC, pp. 1—13 (1991).

31. F. H. Cheng and W.H. Hsu, Research on Chinese OCRin Taiwan, Int. J. Pattern Recognition and ArtificialIntell. 5(1&2), 139—164 (1991).

About the Author—CHUNGNAN LEE received the B.S. and M.S. degrees in electrical engineering fromNational Cheng Kung University, Tainan, Taiwan in 1980 and 1982, respectively, the Ph.D. degree inelectrical engineering from the University of Washington, Seattle, WA in 1992. He is an Associate Professorin the Institute of Computer and Information Engineering at National Sun Yat-Sen University, Kaohsiung,Taiwan since 1992. Prior to joining the faculty he was a system manager of Intelligent System Laboratory,a teaching assistant, and a research associate, while pursuing his graduate studies at the University ofWashington. His current research interests include computer vision, character recognition, computergraphics, Web and Java computing, Web-based knowledge discovery, computer-supported collaborativework, and parallel computing.

About the Author—BOHOM WU was born in Kaohsiung, Taiwan. He received the B.S. degree incomputer science from TungHai University, Taichung and the M.S. degree in computer and informationengineering from National Sun Yat-Sen University, Kaohsiung. Currently, he is working towards his Ph.D.Degree in computer and information engineering. His research interests are in OCR, statistical patternrecognition, computer vision, and object-oriented software engineering.

A Chinese-character-stroke-extraction algorithm 663