• No results found

Comparative Analysis on Feature Vectors for Printed Bangla OCR

Saima Hossain, Nasreen Akter, S.M. Faqruddin Ali Azam, Hasan Sarwar, Chowdhury Mofizur Rahman

Abstract—Feature Extraction of Bangla characters is very important during recognition. Efficient feature extraction method speeds up recognition process. In this paper, a comparative analysis is done between two different algorithms which are feature extraction using chain code and shadow, centriod and longest–

run features.

Index Terms- algorithm; Bangla language; Bangla characters; feature extraction; feature vectors

I. INTRODUCTION

Paper [1] illustrated freeman Chain code which is based on the observation that each pixel has eight neighborhood pixels. The 8 transitional positions defined by freeman chain code are then divided into 4 transitional zones in order to keep the correct order of searching. Fig. 1 describes the freeman chain code.

(a)

(b)

Figure 1. (a) Slope Convention for Freeman Chain code, (b) 8 directional slopes divided into 4 direction zones

for searching.

Maintaining an anti clock wise order of searching, zonal information is used to modify the chain coded position of the next selected pixel. The algorithm selects the next pixel if it fulfils all of the following criteria:

• The pixel is Black, i.e., it is a part of the character.

• The pixel is within the bounded rectangle of the connected component.

• The pixel is still not visited.

• The zone of the current pixel.

(a)

(b)

Figure 2. (a) Chain code generation for an image, (b) Searching order in the four zones

Fig. 2 (a) shows the chain code generation of an image marked by gray pixels. When the algorithm starts from the hatched pixel (absolute coordinate, x=1, y=3), it marks the current black pixel as visited and initiates its directional zone as DOWN zone. So it searches for an unvisited black pixel in the directional order: 3,4,5,6,7,0,1,2 (Searching order is shown in Fig. 1.2 (b) for each zone). In this way the process continues and finally produces the chain code, 06700132454.

The frequency of each directional slope at each region is recorded and updated during the traverse.

A total of 32 directional slopes or local features for each component are found. Then they are normalized to 0-1 scale. In bangla, as there are more than one components in a character, the normalized 64 features are then averaged to produce 32 features. The calculation of normalized slope distribution is as follows:

If a1, a2, a3, ……….,a8 are 8 directional slopes in region 1, then normalizing constant for region 1 is, N1 = √ (a1*a1 + a2*a2 + ……… +a8*a8)(1) So, normalized slope in region i = Si,j/ Ni ,

Where, i = 1 to 4 and j = 1 to 8

Si,j = Frequency of j’th directional slope in i’th region.

Ni = Normalizing constant in i’th region.

Paper [2] has used a set of 76 features which includes 24 shadow features, 16 centriod features

and 36 longest- run features are computed taking 64 x 64 pixel size binary images. Shadow features are calculated by dividing the image into 8 octants within minimal square. Finally, lengths of all projections on each of the 24 sides of all octants are summed up to produce 24 shadow features, shown in fig. 3

Figure 3. An illustration for shadow features. (a-d) Direction of fictitious light rays as assumed for taking the projection

of an image segment on each side of all octants.

(e) Projection of a sample image

Coordinates of centriods of black pixels in all 8 octants of a digit image, shown in fig. 4, are considered to add 16 centriod features.

Figure 4. Centriod features of two different characters (a)-(b)

Longest- run features are computed dividing the square into 9 overlapping regions and for each, 4 longest-run features are calculated respectively by row wise, column wise along 2 of its diagonal.

Thus 36 features are produced (fig. 5).

Figure 5. An illustration for computation of the row wiselongest-run feature.(a) The portion of a binary image enclosed within a rectangular region.(b) every pixel position in each row of the image is marked with the lenght of the longest bar that

fits consecutive black pixels along the same row.

(a) (b)

(c)

Figure 6. (a) Slope generation using Chain code, (b) 8 sample Aa, each produces 32 slopes, (c) graphical representation for the 8 sample Aa using (b)

COMPARATIVE ANALYSIS BETWEEN THE TWO

FEATURES METHODS

Text document images are constructed with different font sizes. We resize our sample characters into 64 x 64 pixels to make the feature extraction process font size independent. We got these samples from a text image paper [3] and stored the same characters to do the comparison.

A. Feature Extraction Using Chain code

Applying the feature extraction technique using chain code we got the following slopes and corresponding graph for character Aa, (fig. 6).

B. Feature extraction using Shadow, Centriod and Longest-run features

Using this feature we have got the 16 shadow

features (last 8 shadow features are not considered here), 16 centriod features and 36 longest–run features and their corresponding graph for the character Aa (fig. 7).

C. Comparative Analysis

From the fig. 6 (c), it is seen that the difference between each point of each font sizes compared with each point of 64px font size is larger than fig.

7(c). Using chain code, about 20-30% points are close or even same for a particular character whereas 60-70% points are close or same using shadow, centrio and longest-run features. The differences are shown in Table I for feature extraction using chain code and Table II for shadow, centriod and longest–run features.

Figure 7. (a) Slope generation using Chain code, (b) 8 sample Aa, each produces 32 slopes, (c) graphical representation for the 8 sample Aa using (b)

(a) (b)

(c)

TABLEI.DIFFERENCES AMONG DIFFERENT FONT SIZES WITH 64PX FONT SIZE FOR THE FEATURE EXTRACTION USING CHAIN CODE

Index Font 16px Font 18px Font 20px Font 22px Font 24px Font 26px Font 28px Font 30px

1 0.08 0.1 0.16 0.04 0.18 0.11 0.07 0.02

2 0.14 0.33 0.16 0.18 0.17 0.43 0.23 0.03

3 0.33 0.39 0.33 0.33 0.33 0.39 0.33 0.24

4 0.399 0.44 0.399 0.4 0.399 0.37 0.4 0.29

5 0.02 0 0 0.02 0 0.01 0 0.02

6 0.06 0.01 0.02 0.02 0.01 0 0.04 0.02

7 0.13 0.1 0.13 0.13 0.13 0.03 0.13 0.08

8 0.001 0 0.001 0 0.001 0 0 0

9 0.11 0.07 0.1 0.15 0.1 0.11 0.17 0.05

10 0.08 0.1 0.01 0.1 0.04 0.13 0.35 0.03

11 0.08 0.05 0.34 0.4 0.22 0.05 0.57 0.05

12 0.001 0 0.001 0.11 0.001 0.05 0.12 0.09

13 0.19 0.19 0.19 0.16 0.19 0.19 0.09 0.16

14 0.1 0.2 0.16 0.13 0.15 0.2 0.2 0.08

15 0.1 0.22 0.01 0.11 0.01 0.22 0.22 0.08

16 0.339 0.34 0.339 0.18 0.339 0.29 0.22 0.21

17 0.14 0.05 0.23 0.11 0.28 0.14 0.23 0.04

18 0.05 0.37 0.11 0.15 0.11 0.37 0.47 0.11

19 0.26 0.18 0.46 0.48 0.34 0.1 0.56 0.04

20 0.789 0.37 0.789 0.19 0.789 0.22 0.2 0.15

21 0.06 0.04 0.06 0.04 0.04 0.04 0.04 0.03

22 0 0 0 0 0 0 0 0

23 0.16 0.21 0.16 0.11 0.16 0.18 0.05 0.14

24 0.001 0 0.001 0 0.001 0 0 0

25 0.15 0.25 0.02 0.09 0.01 0.12 0.14 0.04

26 0.22 0.35 0.08 0.03 0.1 0.34 0.04 0.12

27 0.11 0.09 0.04 0 0.08 0.21 0.16 0.05

28 0.059 0.22 0.059 0.06 0.059 0.11 0.06 0.15

29 0.11 0.06 0.09 0.09 0.09 0.01 0.06 0.05

30 0.11 0.07 0.07 0.06 0.05 0.04 0.06 0.08

31 0.22 0.15 0.22 0.22 0.22 0.02 0.22 0.13

32 0.309 0.12 0.309 0.31 0.309 0.11 0.31 0.1

TABLEII.DIFFERENCES AMONG DIFFERENT FONT SIZES WITH 64PX FONT SIZE FOR SHADOW,CENTRIOD AND LONGEST-RUN FEATURES

Index Font 16px Font 18px Font 20px Font 22px Font 24px Font 26px Font 28px Font 30px

1 0.01 0 0.02 0.02 0.01 0 0.01 0.02

2 0.05 0.04 0.05 0.04 0.03 0.04 0.03 0.04

3 0.01 0.01 0 0.01 0 0.01 0.02 0.01

4 0.1 0.11 0.1 0.09 0.1 0.09 0.08 0.09

5 0.01 0.01 0 0.01 0 0.01 0.02 0.01

6 0.01 0.01 0 0.01 0 0.01 0.02 0.01

7 0.05 0.04 0.05 0.04 0.03 0.04 0.03 0.04

8 0.02 0.04 0.05 0.04 0.04 0.04 0.05 0.03

9 0.02 0.11 0.01 0 0.01 0.01 0 0.03

10 0.01 0.04 0.03 0.01 0.03 0 0.02 0.01

11 0.01 0.01 0.03 0.02 0.02 0 0.02 0.02

12 0.06 0.04 0.06 0.05 0.05 0.05 0.04 0.05

13 0.01 0.01 0.03 0.02 0.02 0 0.02 0.02

14 0.07 0.09 0.06 0.07 0.06 0.06 0.06 0.05

15 0.03 0.02 0 0 0 0 0 0

16 0.03 0.07 0.05 0.01 0.06 0 0.03 0.05

17 0 0.01 0.01 0.01 0.01 0 0.01 0

18 0.01 0.01 0.01 0.01 0 0 0.01 0

TABLE II. Differences Among Different Font Sizes with 64px Font Size for Shadow, Centriod and Longest-run features (cont.) Index Font 16px Font 18px Font 20px Font 22px Font 24px Font 26px Font 28px Font 30px

19 0.01 0 0 0.01 0 0.01 0.01 0.01

20 0 0 0 0.01 0 0.01 0.01 0.01

21 0.01 0 0 0.01 0.01 0 0.01 0.01

22 0 0.01 0.01 0.01 0 0.01 0.01 0.01

23 0.01 0 0 0.01 0.01 0.01 0.01 0

24 0.02 0.03 0.02 0.01 0.03 0 0.01 0.02

25 0.03 0.04 0.03 0.03 0.03 0.04 0.03 0.03

26 0 0.08 0.01 0.01 0.01 0.01 0 0.01

27 0 0.01 0.02 0.01 0.01 0.01 0.02 0.01

28 0.04 0.05 0.06 0.04 0.04 0.04 0.04 0.04

29 0.05 0.03 0.05 0.05 0.03 0.05 0.04 0.04

30 0.02 0.01 0.02 0.02 0.01 0.02 0.02 0.02

31 0.02 0 0 0 0 0 0 0

32 0.01 0.04 0.01 0.01 0.01 0.01 0.01 0.01

33 1.84 2.47 2.329 2.119 1.73 1.329 1.819 2.34

34 1.21 1.67 1.86 1.5 1.77 0.49 0.88 1.99

35 1.52 1.970 1.80 1.69 1.510 0.54 0.91 1.960

36 2.43 2.69 2.29 2.2 2.09 1.31 1.28 2.11

37 1.68 2.31 2.15 1.8 1.73 1.33 1.76 2.18

38 1.23 1.72 1.77 1.42 1.61 0.43 0.83 1.82

39 1.949 2.02 1.89 1.739 1.829 0.76 1.04 2.079

40 3.45 3.22 3.36 2.59 3.31 1.39 2.03 3.08

41 0.82 1.48 1.8 1.12 0.86 0.77 1.29 1.39

42 0.89 1.63 1.62 1.2 1.12 0.53 0.95 1.38

43 2.11 2.49 2.430 1.96 1.72 1.16 1.55 2.13

44 2.829 2.89 3.319 2.47 2.529 1.359 2.039 2.659

45 1.84 2.47 2.329 2.119 1.73 1.329 1.819 2.34

46 1.21 1.67 1.86 1.5 1.77 0.49 0.88 1.99

47 1.14 1.97 1.6 1.48 1.19 0.41 0.64 1.68

48 1.99 2.27 2.18 2 1.7 1.109 1.21 1.82

49 1.68 2.31 2.15 1.8 1.73 1.33 1.76 2.18

50 1.23 1.72 1.77 1.42 1.61 0.43 0.83 1.82

51 1.57 2.02 1.69 1.53 1.51 0.63 0.77 1.8

52 2.33 2.68 2.16 2.07 1.95 1.06 1.34 2.05

53 0.82 1.48 1.8 1.12 0.86 0.77 1.29 1.39

54 0.89 1.63 1.62 1.2 1.12 0.53 0.95 1.38

55 1.73 2.49 2.23 1.75 1.4 1.03 1.28 1.85

56 2.869 2.63 3.22 2.18 2.85 1.52 2.199 2.659

57 1.09 1.48 1.01 0.98 1.22 1.23 1.03 1.27

58 2.02 2.68 1.87 1.8 1.9 1.75 1.390 1.83

59 0.48 1.51 0.47 0.66 0.49 0.6 0.2 0.59

60 0.8 1.27 0.98 0.74 0.77 0.6 0.67 0.8

61 1.09 1.48 1.15 0.98 1.22 1.23 1.13 1.27

62 1.85 2.46 1.68 1.68 1.75 1.46 1.4 1.62

63 0.77 1.5 0.43 0.9 0.68 0.64 0.43 0.62

64 1.63 2.14 1.58 1.52 1.42 1.29 1.3 1.43

65 0.6 0.78 0.97 0.52 0.74 0.77 0.79 0.9

66 1.29 1.79 1.48 1.18 1.35 1.06 1.08 1.32

67 1.19 1.52 1.3 1.09 1.27 0.94 0.94 1.17

68 1.38 1.83 1.48 1.21 1.3 1.09 1.13 1.25

II. CONCLUSION

In sum, from the above experiment, it can be said that shadow, centriod and longest-run feature methods are better than the feature extraction method using chain code. Though there is a limitation using chain code to extract feature which is, if any noise exits in in the binary image, it does not produce good result but this method is much faster than shadow, centriod and longest-run feature technique. Although the later one produce good result but it is very time consuming.

REFERENCES

[1] Jalal Uddin Mahmud, Mohammed Feroz Raihan

& Chowdhury Mofizur Rahman, A Complete OCR System For Continuous Bangali Characters, IEEE,2003, pp. 1372-1376.

[2] Subhadip Basu, Nibaran Das, Ram Sarkar, Mahantapas Kundu, Mita Nasipuri & Dipak Kumar Basu , Handwritten 'Bangla' Alphabet Recognition Using an MLP Based Classifier, NCCPB, Bangladesh, 2005, pp. 285-291.

[3] Nasreen Akter, Saima Hossain, Md. Tajul Islam

& Hasan Sarwar , An Algorithm For Segmenting Modifies From Bangla Text, ICCIT, IEEE, Khulna, Bangladesh, 2008, pp.177-182

Harmonised and Contextual Based