**Recognition of Tifinaghe Characters Using Dynamic Programming & Neural Network**

Rachid El Ayachi, Mohamed Fakir and Belaid Bouikhalene *Sultan Moulay Slimane University/ Faculty of Sciences and Techniques Morocco* 

#### **1. Introduction**

20 Will-be-set-by-IN-TECH

34 Recent Advances in Document Recognition and Understanding

Zadeh, L. A. (1965). Fuzzy sets, *Information and Control* 8: 338–353.

pp. 509–522.

*Soft Computing*, Springer Verlag, chapter Meta Sets. Another Approach to Fuzziness,

Optical Character Recognition (OCR) is one of the most successful applications of automatic pattern recognition. The field of characters recognition is very important. Several studies have been conducted on Latin, Arabic and Chinese characters (Bozinovic and Shihari, 1989; Brown, 1983; Fakir and Sodeyama, 1993; Fakir, 2001; Chaudhuri and al, 2002; Blumenstein and al, 2002; Miyazaki and al, 1974; Mezghani and al, 2008; Lallican and al, 2000; Burr, 1982) and various commercial applications have been produced such as bank cheque processing, postal automation, documents. However, for Amazigh characters, called Tifinaghe, few studies have been published in the literature. Among these researches, we find (El ayachi and Fakir, 2009; Amrouch et al, 2009; Es saady, 2009; Fakir et al, 2009; El ayachi et al, 2010). Because, characters are sensitive to noise the main problem in this field how to extracts strokes. This may be solved by the selection of the useful features customarily defined in the automatic character recognition as two types: global and local features. The principle of global features is based on the transformation of the character matrix into a new domain to extract features. The selection of local features is based on geometrical and topological properties of the character, such as strokes direction, strokes density, strokes length and

position, etc. Unlike Latin characters, Tifinaghe characters are formed by loops, lines and curves. This makes it difficult to describe a character in one parametric form. In this study, invariant moments, modified invariant moments and Walsh transform are used as features for the recognition of Tifinaghe characters. Fig.1 illustrates the block diagram of the proposed recognition system. Tifinaghe texts were transferred to the computer through an image scanner.

The process consists of three phases. After preliminary pre-processing of position normalization, noise reduction and skew correction), a text is segmented into lines and lines into what to be characters in the second phase. In the third phase features extraction methods are applied. In the last phase the recognition procedure is completed. In this phase a Multilayer Neural Network and Dynamic Programming Technique are used to classifier characters. These phases are described in the following sections, but before that a brief explanation about the characteristics of Tifinaghe characters is given.

Recognition of Tifinaghe Characters Using Dynamic Programming & Neural Network 37

1 12 23

2 13 24

3 14 25

4 15 26

5 16 27

6 17 28

7 18 29

8 19 30

9 20 31

10 21 32

11 22 33

use, and modern Tuareg letters. The first subset represents the set of characters chosen by IRCAM to unify the orthography of the different Moroccan modern day Berber dialects

The alphabet Tifinaghe adopted by IRCAM ([El ayachi and Fakir, 2009) is composed of thirty-three characters representing consonants and vowels as shown in Table 1. Fig.2

Tifinaghe characters are consisted by loops, curves and lines segments. In addition some characters have the same shape which differs only by the addition of secondary parts (for example character 3&4, 10&9). This increases the complexity of recognizing Tifinaghe characters. Another problem is the rotation; some characters can be obtained from each other only by rotation of 90° (for example character 13&26, 19&30, 2&11) or 30° (example 23

Table 1. Tifinaghe characters adopted by IRCAM

while using the historical Tifinaghe script.

illustrates a Tifinaghe text.

& 26).

number Character Character

number Character

Character

number Character Character

Fig. 1. Block diagram of the recognition system

#### **2. Tifinaghe characters**

The Tifinaghe script is used by approximately 20 million people who speak varieties of languages commonly called Berber or Amazigh. The three main varieties in Morocco are known as Tarifite, Tamazighe, and Tachelhite (El ayachi and Fakir, 2009; Es saady, 2009).

In Morocco, more than 40% of the population speaks Berber. In accordance with recent governmental decisions, the teaching of the Berber language, written in the Tifinaghe script, will be generalized and compulsory in Tifinaghe is an alphabetic writing system. It uses spaces to separate words and makes use of Western punctuation.

The earliest variety of the Berber alphabet is Libyan. Two forms exist: a Western form and an Eastern form. The Western variety was used along the Mediterranean coast from Kabylia to Morocco and most probably to the Canary Islands. The Eastern variety, old Tifinaghe, is also called Libyan-Berber or old Tuareg. It contains signs not found in the Libyan variety and was used to transcribe Old Tuareg (El ayachi and Fakir, 2009, rachidi, 2009).

Historically, Berber texts did not have a fixed direction. Early inscriptions were written horizontally from left to right, from right to left, vertically (bottom to top, top to bottom); boustrophedon directionality was also known. Modern-day Berber script is most frequently written in horizontal lines from left to right; therefore the bidirectional class for Tifinaghe letters is specified as strong left to right. Displaying Berber texts in other directions can be accomplished by the use of directional over rides or by the use of higher level protocols.

The encoding consists of four Tifinaghe character subsets: the basic set of the ″ Institut Royal de la Culture Amazighe (IRCAM) ″, the extended IRCAM set, other Neo-Tifinaghe letters in 36 Recent Advances in Document Recognition and Understanding

Tifinaghe text

Text acquisition

Normalization

Noise reduction

Baseline skew correction

Segmentation

Classification

Recognized text

Feature extraction

The Tifinaghe script is used by approximately 20 million people who speak varieties of languages commonly called Berber or Amazigh. The three main varieties in Morocco are known as Tarifite, Tamazighe, and Tachelhite (El ayachi and Fakir, 2009; Es saady, 2009). In Morocco, more than 40% of the population speaks Berber. In accordance with recent governmental decisions, the teaching of the Berber language, written in the Tifinaghe script, will be generalized and compulsory in Tifinaghe is an alphabetic writing system. It uses

The earliest variety of the Berber alphabet is Libyan. Two forms exist: a Western form and an Eastern form. The Western variety was used along the Mediterranean coast from Kabylia to Morocco and most probably to the Canary Islands. The Eastern variety, old Tifinaghe, is also called Libyan-Berber or old Tuareg. It contains signs not found in the Libyan variety

Historically, Berber texts did not have a fixed direction. Early inscriptions were written horizontally from left to right, from right to left, vertically (bottom to top, top to bottom); boustrophedon directionality was also known. Modern-day Berber script is most frequently written in horizontal lines from left to right; therefore the bidirectional class for Tifinaghe letters is specified as strong left to right. Displaying Berber texts in other directions can be accomplished by the use of directional over rides or by the use of higher level protocols. The encoding consists of four Tifinaghe character subsets: the basic set of the ″ Institut Royal de la Culture Amazighe (IRCAM) ″, the extended IRCAM set, other Neo-Tifinaghe letters in

and was used to transcribe Old Tuareg (El ayachi and Fakir, 2009, rachidi, 2009).

Fig. 1. Block diagram of the recognition system

spaces to separate words and makes use of Western punctuation.

**2. Tifinaghe characters** 


Table 1. Tifinaghe characters adopted by IRCAM

use, and modern Tuareg letters. The first subset represents the set of characters chosen by IRCAM to unify the orthography of the different Moroccan modern day Berber dialects while using the historical Tifinaghe script.

The alphabet Tifinaghe adopted by IRCAM ([El ayachi and Fakir, 2009) is composed of thirty-three characters representing consonants and vowels as shown in Table 1. Fig.2 illustrates a Tifinaghe text.

Tifinaghe characters are consisted by loops, curves and lines segments. In addition some characters have the same shape which differs only by the addition of secondary parts (for example character 3&4, 10&9). This increases the complexity of recognizing Tifinaghe characters. Another problem is the rotation; some characters can be obtained from each other only by rotation of 90° (for example character 13&26, 19&30, 2&11) or 30° (example 23 & 26).

Recognition of Tifinaghe Characters Using Dynamic Programming & Neural Network 39

(a) (b)

Fig. 3. (a) Before normalization, (d) after normalization, (b) Horizontal histogram and (c)

(d) (c)

In many document analysis systems, printed material is scanned and stored as an image. It is later retrieved for character and graphics extraction and recognition. During the scanning process, the document may be skewed and the text lines in the image may not be strictly horizontal. The skew may cause problems in text baseline extraction and document layout structure analysis. Several methods have been developed by many researchers for skew

A skew angle is the angle that the text lines of the document image make with the horizontal direction. The skew correction is necessary for the success of many OCR systems. It consists of the extraction of the skew angle θs corresponding to baseline using Hough transform. The baseline is considered as the line corresponding to the maximum points in the horizontal projection profile. The skew angle θs is detected by observing high valued cell in the accumulative matrix in the Hough transform space. The image is then rotated by θs in the opposite direction so that the scripts become horizontal. Fig. 4(a) and Fig. 4(c) respectively

In this phase, the proposed OCR system detects individual text lines and then segments lines into characters. The lines of a text are segmented by using the horizontal histogram; we browse from top to bottom until the first line containing at least one black pixel, the line is the beginning of the first line of text, then we continue traverse until a line that contains only white pixels, this line corresponds to the end of the first line of text. With the same way, we continue to detect other text lines (Fig.5 a). The same principle is used in the vertical

Vertical histogram

angle detection.

**3.3 Segmentation** 

**3.2 Baseline skew detection and correction** 

show a text before and after baseline skew correction.

histogram to detect characters in each line of text (Fig.5 b).

Fig. 2. An example of Tifinaghe text

#### **3. Pre-processing**

Pre-processing algorithms provides the required data suitable for further processing. In other words, it establishes the link between real word and recognition engine. Preprocessing steps consist of digitization of image document and cleaning it (by medium filter for example), converting the gray-scale image into binary image, normalizing the text (El ayachi et al, 2010), detecting and correcting baseline skew (Kayallieratou and al, 1999; Mnjunath et al, 2007), and segmenting (Casy et Lecolinet, 1996; Choisy et Belaid, 2002; Hadjar et Ingold, 2003) the text into lines and the lines into characters.

#### **3.1 Normalization of the position**

The position normalization is designed to eliminate unwanted areas and reduce the processing time. For this operation we use the histogram given by the following form:

$$H \text{ist} V = \sum \sum \text{pixel}(\mathbf{x}, y) \tag{1}$$

Where pixel(x, y), is the intensity of the pixel with the coordinates (x, y).

In this operation, firstly, we compute the horizontal and vertical histograms, secondly, we scan the horizontal histogram in two directions: from top to bottom and bottom to top respectively until the first meeting of black pixels, finally, we scan the vertical histogram in two directions: from left to right and right to left respectively until the first meeting of black pixels. After obtaining the positions of first black pixels, unwanted areas are eliminated in the image as shown in (Fig. 3).

Fig. 3. (a) Before normalization, (d) after normalization, (b) Horizontal histogram and (c) Vertical histogram

#### **3.2 Baseline skew detection and correction**

In many document analysis systems, printed material is scanned and stored as an image. It is later retrieved for character and graphics extraction and recognition. During the scanning process, the document may be skewed and the text lines in the image may not be strictly horizontal. The skew may cause problems in text baseline extraction and document layout structure analysis. Several methods have been developed by many researchers for skew angle detection.

A skew angle is the angle that the text lines of the document image make with the horizontal direction. The skew correction is necessary for the success of many OCR systems. It consists of the extraction of the skew angle θs corresponding to baseline using Hough transform. The baseline is considered as the line corresponding to the maximum points in the horizontal projection profile. The skew angle θs is detected by observing high valued cell in the accumulative matrix in the Hough transform space. The image is then rotated by θs in the opposite direction so that the scripts become horizontal. Fig. 4(a) and Fig. 4(c) respectively show a text before and after baseline skew correction.

#### **3.3 Segmentation**

38 Recent Advances in Document Recognition and Understanding

Pre-processing algorithms provides the required data suitable for further processing. In other words, it establishes the link between real word and recognition engine. Preprocessing steps consist of digitization of image document and cleaning it (by medium filter for example), converting the gray-scale image into binary image, normalizing the text (El ayachi et al, 2010), detecting and correcting baseline skew (Kayallieratou and al, 1999; Mnjunath et al, 2007), and segmenting (Casy et Lecolinet, 1996; Choisy et Belaid, 2002;

The position normalization is designed to eliminate unwanted areas and reduce the processing time. For this operation we use the histogram given by the following form:

In this operation, firstly, we compute the horizontal and vertical histograms, secondly, we scan the horizontal histogram in two directions: from top to bottom and bottom to top respectively until the first meeting of black pixels, finally, we scan the vertical histogram in two directions: from left to right and right to left respectively until the first meeting of black pixels. After obtaining the positions of first black pixels, unwanted areas are eliminated in

*HistV pixel x*(,) *<sup>y</sup>* (1)

Hadjar et Ingold, 2003) the text into lines and the lines into characters.

Where pixel(x, y), is the intensity of the pixel with the coordinates (x, y).

Fig. 2. An example of Tifinaghe text

**3.1 Normalization of the position** 

the image as shown in (Fig. 3).

**3. Pre-processing** 

In this phase, the proposed OCR system detects individual text lines and then segments lines into characters. The lines of a text are segmented by using the horizontal histogram; we browse from top to bottom until the first line containing at least one black pixel, the line is the beginning of the first line of text, then we continue traverse until a line that contains only white pixels, this line corresponds to the end of the first line of text. With the same way, we continue to detect other text lines (Fig.5 a). The same principle is used in the vertical histogram to detect characters in each line of text (Fig.5 b).

Recognition of Tifinaghe Characters Using Dynamic Programming & Neural Network 41

In addition to the invariant moments derived by Hu(Ibrahim, 2005), the modified invariant moments (Fakir and al, 2000), computed from the shape boundary for each character, and

Let *f* (,) *x y* be 1 over a closed and bounded region *R* and 0 otherwise. Define the (,) *p q th*

( )( ) ( , ) *p q*

 <sup>10</sup> 00 *m x*

*xy R*

(,)

*m* , <sup>01</sup>

However for digital images the continuous image intensity f(x,y) is replaced by a matrix where x and y are the discrete locations of the image pixels. The integral in equation 3 is

It can be verified that the central moments up to the order p+q≤ 3 may be computed by the

00 *m y m*

( )( ) ( , ) *p q*

*m x y f x y dxdy* , where *p q*, 0,1,2,... (2)

*x x y y f x y dxdy* (3)

*x x y y fxy* (5)

00 00 *m* (6)

<sup>10</sup> 0 (7)

<sup>01</sup> 0 (8)

11 11 10 *m ym* (9)

20 20 10 *m xm* (10)

02 02 01 *m ym* (11)

2 12 12 11 02 10 *m* 2 2 *ym xm y m* (12)

2 21 21 11 20 01 *m xm* 2 2 *ym xm* (13)

(4)

Walsh transform (Fazekas and Hajdu, 2001) are used as features.

(,) *p q*

*R*

*pq*

The central moments can be expressed as

approximated by the summation

following formulas:

*R*

*pq*

*pq*

**4.1 Invariant moments** 

moment as:

Where

Fig. 4. (a) Before correction, (c) After correction and (b) Horizontal histogram

Fig. 5. (a) lines detection, (b) Horizontal histogram and(c) Characters segmentation

#### **4. Features extraction**

The next stage in the Tifinaghe character recognition is the feature extraction stage. Feature extraction represents the character image by a set of numerical features. These features are used by the classifier to classifier the data. In our work moments and other shape descriptors by Hu have been utilized to build the feature space. Using nonlinear combinations of geometric moments Hu derived a set of invariant moments which has the desired property of being invariant under image translation, scaling and rotation.

In addition to the invariant moments derived by Hu(Ibrahim, 2005), the modified invariant moments (Fakir and al, 2000), computed from the shape boundary for each character, and Walsh transform (Fazekas and Hajdu, 2001) are used as features.

#### **4.1 Invariant moments**

Let *f* (,) *x y* be 1 over a closed and bounded region *R* and 0 otherwise. Define the (,) *p q th* moment as:

$$m\_{pq} = \iint\_R \mathbf{x}^p y^q f(\mathbf{x}, y) d\mathbf{x} dy \text{ , where } p, q = 0, 1, 2, \dots \tag{2}$$

The central moments can be expressed as

$$\mu\_{pq} = \iint\_{R} (\mathbf{x} - \overline{\mathbf{x}})^p (y - \overline{y})^q f(\mathbf{x}, y) d\mathbf{x} dy \tag{3}$$

Where

40 Recent Advances in Document Recognition and Understanding

(a) (b)

(c)

(a) (b)

Fig. 4. (a) Before correction, (c) After correction and (b) Horizontal histogram

Fig. 5. (a) lines detection, (b) Horizontal histogram and(c) Characters segmentation

desired property of being invariant under image translation, scaling and rotation.

The next stage in the Tifinaghe character recognition is the feature extraction stage. Feature extraction represents the character image by a set of numerical features. These features are used by the classifier to classifier the data. In our work moments and other shape descriptors by Hu have been utilized to build the feature space. Using nonlinear combinations of geometric moments Hu derived a set of invariant moments which has the

(c)

**4. Features extraction** 

$$
\overline{\dot{\mathbf{x}}} = \frac{m\_{10}}{m\_{00}} \quad \overline{\mathbf{y}} = \frac{m\_{01}}{m\_{00}} \tag{4}
$$

However for digital images the continuous image intensity f(x,y) is replaced by a matrix where x and y are the discrete locations of the image pixels. The integral in equation 3 is approximated by the summation

$$\mu\_{pq} = \sum\_{(\mathbf{x}, \mathbf{y}) \in \mathcal{R}} \sum \left( \mathbf{x} - \overline{\mathbf{x}} \right)^{p} \left( \mathbf{y} - \overline{\mathbf{y}} \right)^{q} f(\mathbf{x}, \mathbf{y}) \tag{5}$$

 It can be verified that the central moments up to the order p+q≤ 3 may be computed by the following formulas:

$$
\mu \,\, \_{00} = m\_{00} \,\, \tag{6}
$$

$$
\mu\_{\,10} = 0\tag{7}
$$

$$
\mu\_{01} = 0\tag{8}
$$

$$
\mu\_{\,11} = m\_{11} - \overline{\tilde{y}} m\_{10} \tag{9}
$$

$$
\mu \,\, \_{20} = m\_{20} - \overline{\dot{\mathbf{x}}} m\_{10} \tag{10}
$$

$$
\mu \,\, \_{02} = m\_{02} - y m\_{01} \,\, \tag{11}
$$

$$\mu \,\, \_{12} = m\_{12} - 2\overline{y}m\_{11} - \overline{x}m\_{02} + 2\overline{y}^2m\_{10} \tag{12}$$

$$
\mu\_{\;21} = m\_{21} - 2\overline{\mathbf{x}}m\_{11} - \overline{\mathbf{y}}m\_{20} + 2\overline{\mathbf{x}}^2 m\_{01} \tag{13}
$$

Recognition of Tifinaghe Characters Using Dynamic Programming & Neural Network 43

<sup>1</sup> -1.3666 -1.3413 -1.3666 -1.3598

<sup>2</sup> -6.6891 -6.5944 -6.6891 -6.7362

<sup>3</sup> -7.1587 -7.3184 -7.1587 -7.3915

<sup>4</sup> -12.1029 -10.7623 -12.1029 -11.1215

<sup>5</sup> -24.2394 -20.1474 -24.2394 -20.4762

<sup>6</sup> -16.1004 -14.5595 -16.1004 -14.5128

<sup>7</sup> -22.1628 -21.5532 -21.7188 -21.2735

<sup>1</sup> -1.5010 -1.5031 -1.5112 -1.5185

<sup>2</sup> -11.9233 -8.9845 -10.0586 -11.1259

<sup>3</sup> -7.7360 -7.7739 -7.4510 -7.3024

<sup>4</sup> -9.1054 -9.6056 -9.2274 -9.2739

<sup>5</sup> -17.9265 -18.5968 -17.9453 -17.9095

<sup>6</sup> -15.8471 -14.2235 -14.2585 -14.8929

<sup>7</sup> -18.6203 -19.4092 -18.9059 -18.7813

<sup>1</sup> -1.2978 -1.5010 -1.7512 -1.5141

<sup>2</sup> -8.1338 -11.9233 -6.3559 -4.0690

<sup>3</sup> -12.2658 -7.7360 -14.2564 -8.4575

<sup>4</sup> -12.8021 -9.1054 -13.4338 -8.3696

<sup>5</sup> -25.3674 -17.9265 -27.6235 -16.8251

<sup>6</sup> -17.7442 -15.8471 -17.5999 -10.5131

<sup>7</sup> -27.0270 -18.6203 -27.5615 -16.9178

In this phase features are extracted from the external contour of the character (Fig.6). In order to differentiate between the characters illustrated in Fig.7that have the same external contour, we extract other features such C\_ext, H\_ext, V\_ext, C\_int, H\_int and V\_int , where

Original image Reduced image Mirror image Rotated image

Original image Reduced image Mirror image Rotated image

by (90°)

by (90°)

log( ) *i*

log( ) *i*

Table 2. Invariant Moments

Table 3. Invariant Moments

*Log*( ) *i* 

**4.2 Modified Invariant Moments** 

Table 4. Invariant Moments for different characters


$$
\mu\_{\rm r30} = m\_{\rm 30} - 3\overline{\mathbf{x}}m\_{\rm 20} + 2\overline{\mathbf{x}}^2 m\_{\rm 10} \tag{14}
$$

$$
\mu \,\, \_{03} = m\_{03} - 3\overline{\tilde{y}}m\_{02} + 2\overline{\tilde{y}}^2 m\_{01} \tag{15}
$$

The central moments are invariant to translation. They can also be normalized to be invariant to scaling change by the following formula. The quantities in equation (6) are called normalized central moments

$$
\alpha\_{pq} = \frac{\mu\_{pq}}{\mu\_{00}^{\gamma}} \tag{16}
$$

Where

$$
\gamma = \frac{p+q}{2} + 1 \quad \text{, for } p+q = 2,3,\dots \tag{17}
$$

Invariant moments derived by Hu (Hu, 1962) were frequently used as features for shape recognition and were shown to be invariant to scaling, translation and rotation (Tables 2, 3, 4).

$$
\sigma\_1 = \alpha\_{20} - \alpha\_{02} \tag{18}
$$

$$
\varphi\_2 = (\alpha\_{20} - \alpha\_{02})^2 + 4\alpha\_{11}^2 \tag{19}
$$

$$
\rho\_3 = \left(a\_{30} - a\_{12}\right)^2 + \left(3a\_{12} - a\_{03}\right)^2 \tag{20}
$$

$$
\varphi\_4 = \left(a\_{30} + a\_{12}\right)^2 + \left(a\_{21} + a\_{03}\right)^2 \tag{21}
$$

$$\begin{aligned} \varphi\_{\mathfrak{z}} &= (\alpha\_{\mathfrak{z}0} - \mathfrak{z}\alpha\_{\mathfrak{z}2})(\alpha\_{\mathfrak{z}0} + \alpha\_{\mathfrak{z}2})[(\alpha\_{\mathfrak{z}0} + \alpha\_{\mathfrak{z}2})^2 - \mathfrak{z}(\alpha\_{\mathfrak{z}1} + \alpha\_{\mathfrak{z}0})^2] \\ &+ (\mathfrak{z}\alpha\_{\mathfrak{z}1} - \alpha\_{\mathfrak{z}0})(\alpha\_{\mathfrak{z}1} + \alpha\_{\mathfrak{z}0})[\mathfrak{z}(\alpha\_{\mathfrak{z}0} + \alpha\_{\mathfrak{z}2})^2 - (\alpha\_{\mathfrak{z}1} + \alpha\_{\mathfrak{z}0})^2] \end{aligned} \tag{22}$$

$$\begin{aligned} \varphi\_6 &= (a\_{20} - a\_{02})[(a\_{30} + a\_{12})^2 - (a\_{21} + a\_{03})^2] \\ &+ 4a\_{11}(a\_{30} + a\_{12})(a\_{21} + a\_{03}) \end{aligned} \tag{23}$$

$$\begin{aligned} \varphi\_7 &= (3\alpha\_{21} - \alpha\_{30})(\alpha\_{30} + \alpha\_{12})[(\alpha\_{30} + \alpha\_{12})^2 - 3(\alpha\_{21} + \alpha\_{03})^2] \\ &+ (3\alpha\_{12} - \alpha\_{03})(\alpha\_{21} + \alpha\_{03})[3(\alpha\_{30} + \alpha\_{12})^2 - (\alpha\_{21} + \alpha\_{03})^2] \end{aligned} \tag{24}$$

The*<sup>i</sup>* 's have dynamic values. Thus it was found that it was more practical to deal with the logarithm of magnitude of *<sup>i</sup>* . Thus the seven moment invariants used in the proposed system are replaced by their logarithm values. For each character issued from the segmentation process the above moment invariant descriptors are calculated and fed to the classifiers.


Table 2. Invariant Moments

42 Recent Advances in Document Recognition and Understanding

The central moments are invariant to translation. They can also be normalized to be invariant to scaling change by the following formula. The quantities in equation (6) are

 00 *pq*

Invariant moments derived by Hu (Hu, 1962) were frequently used as features for shape recognition and were shown to be invariant to scaling, translation and rotation

> 1 20 02

2 2

2 2

6 20 02 30 12 21 03

])()(3)[)(3(

( )[( ) ( ) ]

)(3( ])(3))[(

 

(3 )( )[( ) 3( ) ]

*<sup>i</sup>* 's have dynamic values. Thus it was found that it was more practical to deal with the

 

12 03 21 03 30 12 21 03

system are replaced by their logarithm values. For each character issued from the segmentation process the above moment invariant descriptors are calculated and fed to the

7 21 30 30 12 30 12 21 03

 2 2

> 

2

2

2 2

 

(3 )( )[3( ) ( ) ] (24)

4 ( )( ) (23)

 

2 2

*<sup>i</sup>* . Thus the seven moment invariants used in the proposed

2 2

0321

 

 

 

2

2

30 30 20 10 *m xm x m* 3 2 (14)

03 03 02 01 *m* 3 2 *ym y m* (15)

*pq* (16)

(18)

2

0321

2

(22)

*p q* , for *p q* 2,3,... (17)

2 20 02 11 ( ) 4 (19)

3 30 12 12 03 ( ) (3 ) (20)

4 30 12 21 03 ( ) ( ) (21)

 <sup>1</sup> 2

5 30 123012 1230

03210321 1230

 

 

11 30 12 21 03

 

logarithm of magnitude of

 

 

called normalized central moments

Where

(Tables 2, 3, 4).

The

classifiers.


Table 3. Invariant Moments



#### **4.2 Modified Invariant Moments**

In this phase features are extracted from the external contour of the character (Fig.6). In order to differentiate between the characters illustrated in Fig.7that have the same external contour, we extract other features such C\_ext, H\_ext, V\_ext, C\_int, H\_int and V\_int , where


Recognition of Tifinaghe Characters Using Dynamic Programming & Neural Network 45

*m* , <sup>01</sup>

00 *m y m*

*pq p q* is scaling invariant for p, q = 2, 3, … (30)

*x s y s ds r* (31)

*ds C* length of curve C (32)

*r C* (34)

*i i* for 1 ≤ i ≤ 7 (35)

 

'

*pq* instead of

*pq*

*ds C* length of curve C'=r |C| (33)

( )( ) *p q*

(28)

*x x y y* (29)

 <sup>10</sup> 00 *m x*

 

**Proof:** Suppose C is a smooth curve in the plane, C' is the curve obtained homogeneously by

 ' <sup>1</sup> ( ( ')) ( ( ')) ' *p q pq pq pq*

 11 1 <sup>00</sup> <sup>00</sup> ( ) ( )

**Theorem 2:** Suppose C is a smooth curve in the plane and C' is the curve obtained by

 

*p q pq pq pq pq pq p q*

1

*r*

 

*x s y s ds x s y s y s x s ds* (36)

*xy C*

(,)

1

*C*

 <sup>00</sup> *C*

The modified central moments are invariant to translation.

 ' <sup>00</sup> ' ' *C*

The quantity in equation (34) is invariant to a homogenous scaling.

 '

*i* is defined as in equations (18, 19, 20, 21, 22, 23 and 24) by using

 

' ( ( ')) ( ( ')) ' ( )cos ( )sin ( )sin ( )cos *p q p q*

'

clockwise, then

*C C*

'

Then, for any r > 0, we have

rotating C an angle

for *p q* 2,3,...

*pq*

Where '

**Proof:** 

Note that

'

<sup>00</sup> ( ) *pq*

*pq* defined in equation (9),

*pq*

For a digital character, equation (9) becomes

rescaling the coordinates by a factor r, then

Where

**Theorem 1:** For

Since


Fig. 6. Tifinaghe characters Contours

Fig. 7. Externals contours used to calculate modified invariant moments

We modified the moment definition in equation (2) using the character boundary only.

$$\text{Sym}\_{pq} = \bigcup\_{\mathbb{C}} \mathbf{x}^p y^q f(\mathbf{x}, \mathbf{y}) ds \text{ , for } \mathbf{p}, \mathbf{q} = \mathbf{0}, \mathbf{1}, \mathbf{2}, \dots \tag{25}$$

Where *C* is a line integral along the curve C, and

$$ds = \sqrt{\left(\left(dx\right)^2 + \left(dy\right)^2\right)}\tag{26}$$

The modified central moments can be similarly defined as:

$$
\mu\_{pq} = \int\_{\mathbb{C}} (\mathbf{x} - \overline{\mathbf{x}})^p (y - \overline{y})^q \, ds \tag{27}
$$

Where

44 Recent Advances in Document Recognition and Understanding





externals contours;

contours;

Where *C*


Fig. 6. Tifinaghe characters Contours

Fig. 7. Externals contours used to calculate modified invariant moments

(,) *p q*

*pq C*

*pq C*

is a line integral along the curve C, and

The modified central moments can be similarly defined as:

We modified the moment definition in equation (2) using the character boundary only.

( )( ) *p q*

*m x y f x y ds* , for p, q = 0, 1, 2, … (25)

2 2 *ds dx dy* (( ) ( ) ) (26)

*x x y y ds* (27)

$$
\overline{\dot{\mathbf{x}}} = \frac{m\_{10}}{m\_{00}} \quad \overline{\mathbf{y}} = \frac{m\_{01}}{m\_{00}} \tag{28}
$$

For a digital character, equation (9) becomes

$$
\mu\_{pq} = \sum\_{(\mathbf{x}, \mathbf{y}) \in \mathcal{C}} (\mathbf{x} - \overline{\mathbf{x}})^p (\mathbf{y} - \overline{\mathbf{y}})^q \tag{29}
$$

The modified central moments are invariant to translation. **Theorem 1:** For *pq* defined in equation (9),

$$\alpha\_{pq}^{'} = \frac{\mu\_{pq}}{(\mu\_{00})^{p+q+1}} \text{ is scaling invariant for } \mathbf{p}\_{\prime} \neq \mathbf{q} = \mathbf{2}, \mathbf{3}, \dots \tag{30}$$

**Proof:** Suppose C is a smooth curve in the plane, C' is the curve obtained homogeneously by rescaling the coordinates by a factor r, then

$$\mu\_{pq}^{\prime} = \int\_{\mathbb{C}} (\mathbf{x}(\mathbf{s}^{\prime}))^{p} (\mathbf{y}(\mathbf{s}^{\prime}))^{q} \, d\mathbf{s}^{\prime} = r^{p+q+1} \mu\_{pq} \tag{31}$$

Since

$$\mu\_{00} = \int\_{\mathcal{C}} ds = \left| \mathcal{C} \right| = \text{length of curve } \mathcal{C} \tag{32}$$

$$
\mu\_{00}^{'} = \int\_{\mathcal{C}} ds^{\prime} = \left| \mathcal{C}^{\prime} \right| = \text{length of curve } \mathcal{C}^{\prime} \text{r } \left| \mathcal{C}^{\prime} \right| \tag{33}
$$

Then, for any r > 0, we have

$$\frac{\mu\_{pq}^{\cdot}}{(\mu\_{00}^{\cdot})^{p+q+1}} = \frac{r^{p+q+1}\mu\_{pq}}{r^{p+q+1}\left|\mathbb{C}\right|} = \frac{\mu\_{pq}}{(\mu\_{00})^{p+q+1}}\tag{34}$$

The quantity in equation (34) is invariant to a homogenous scaling.

**Theorem 2:** Suppose C is a smooth curve in the plane and C' is the curve obtained by rotating C an angle clockwise, then

$$\boldsymbol{\phi}\_{i}^{\prime} = \boldsymbol{\phi}\_{i}^{\prime} \text{ for } 1 \le i \le 7 \tag{35}$$

Where ' *i* is defined as in equations (18, 19, 20, 21, 22, 23 and 24) by using ' *pq* instead of *pq* for *p q* 2,3,... **Proof:** 

$$\mu\_{pq}^{\uparrow} = \underset{\mathcal{C}}{\left(\{\mathbf{x}(s^{\uparrow})\}^{p}(y(s^{\uparrow}))^{q} \, ds^{\downarrow} = \int\_{\mathcal{C}} \left[\left[\mathbf{x}(s)\cos\theta - y(s)\sin\theta\right]^{p}\right] \left[y(s)\sin\theta + \mathbf{x}(s)\cos\theta\right]^{q}\right) ds} \tag{36}$$

Note that

$$ds' = ds\tag{37}$$

Recognition of Tifinaghe Characters Using Dynamic Programming & Neural Network 47

*w1* -0.2500 -0.5000 -0.2500 -0.3750 *w2* -0.8750 -1 -0.8750 -1 *w3* -1.5000 -1.6250 -1.5000 -1.5000 *w4* -2.1250 -2.2500 -2.1250 -2.1250 *w5* -2.8750 -3 -2.8750 -2.8750 *w6* -3.3750 -3.6250 -3.5000 -3.6250 *w7* -3.8750 -4.1250 -4 -4.3750

*w1* -0.0020 0 0 -0.0039 *w2* -0.0049 -0.0029 -0.0034 -0.0078 *w3* -0.0078 -0.0064 -0.0069 -0.0118 *w4* -0.0098 -0.0098 -0.0103 -0.0157 *w5* -0.0118 -0.0132 -0.0137 -0.0196 *w6* -0.0142 -0.0167 -0.0172 -0.0211 *w7* -0.0172 -0.0201 -0.0206 -0.0211

In the character recognition system, the recognition is the last phase which is used to identify the segmented character. Where we use two techniques: the Neural Network (Hamza, 2008; Gu and al, 1983; Alnsour and Alzoubady, 2006; Asiri and Khorsheed, 2005)

Characters are classified according to their computed features by means of artificial neural networks. Among the many applications that have been proposed for neural networks, character recognition has been one of the most successful. Many neural network architectures have been used in optical character recognition implementation. MLP is usually a common choice. Unfortunately, as the number of inputs and outputs grow, the MLP grows quickly and its training becomes very expensive. In addition, it is not easy to come up with a suitable network design and many trail-and-error cycles are required. The Neural Network (Fig.8) represents an example of Multilayer Neural Network which

An input layer of 7 (invariant moment's vector) inputs cells *E X i i* where the cells

7×3 connections between input layer ant hidden layer, each weighted by*Vji* .

*wi*

*wi*

Table 6. Walsh coefficients

Table 7. Walsh coefficients

**5.1 Neural network** 

**5. Characters recognition** 

contains one hidden layer. It has:

represents the inputs *Ei* of Network. A hidden layer of 3 activations Neural*Yj* . An output layer of 6 activations Neural *Zk* .

and Dynamic Programming (Sylvain and al, 2003).

We shall prove ' 1 1 and ' 2 2 as examples. For 3 ≤ j ≤ 7,

$$
\dot{\varphi}\_j = \varphi\_j \tag{38}
$$

can be similarly proved after computations by using the trigonometric identities:

$$
\cos^2 \theta + \sin^2 \theta = 1 \tag{39}
$$

And

$$(\cos^3 \theta - 3 \cos \theta \sin^2 \theta)^2 + (\sin^3 \theta - 3 \cos^2 \theta \sin \theta)^2 = 1\tag{40}$$

Table 5 represents the seven elements of the vector calculated using modified invariant moments for one character with four transformations.


Table 5. Modified Invariant Moments

#### **4.3 Walsh transform**

The Walsh transformation is given by:

$$\mathcal{W}\{\boldsymbol{\mu},\boldsymbol{\upsilon}\} = \sum\_{\mathbf{x}=\mathbf{0}}^{N-1} \sum\_{\mathbf{y}=\mathbf{0}}^{N-1} f(\mathbf{x},\boldsymbol{y}) \mathbf{g}(\mathbf{x},\boldsymbol{y},\boldsymbol{\mu},\boldsymbol{\upsilon}) \tag{41}$$

Where *f* (,) *x y* is the intensity of the pixel with the coordinates (,) *x y* in the original binary image. The size of image *f* is \* *N N* , and *uv N* , 0,..., 1 , thus we compute <sup>2</sup> *N* Walsh transforms, *gxyuv* (,,,) is the Kernel function given by the following form:

$$\log(\mathbf{x}, y, \boldsymbol{\mu}, \boldsymbol{\upsilon}) = (\mathbf{1} \; / \; N) \prod\_{i=0}^{n-1} (-1)^{b\_i(\mathbf{x}) b\_{n-i-1}(\mathbf{u}) + b\_i(\mathbf{y}) b\_{n-i-1}(\mathbf{v})} \tag{42}$$

Where ( ) *<sup>i</sup> b x* is the ith bit in the binary expansion of *x* (it is equal either 0 or 1).

Table 6 represents the seven first elements of the vector Walsh calculated for one character with four transformations. While Table 7 illustrates Walsh coefficient calculated for different characters.


Table 6. Walsh coefficients

46 Recent Advances in Document Recognition and Understanding

2 2 as examples.

can be similarly proved after computations by using the trigonometric identities:

   '

 

> 

Table 5 represents the seven elements of the vector calculated using modified invariant

<sup>1</sup> -0.0229 -0.0311 -0.0229 -0.0229

<sup>2</sup> -2.3107 -2.4123 -2.3107 -2.3107

<sup>3</sup> -3.4907 -3.5817 -3.4907 -3.4907

<sup>4</sup> -5.4983 -5.5664 -5.4983 -5.4983

<sup>5</sup> -10.2246 -10.3329 -10.2246 -10.2246

<sup>6</sup> -6.8287 -6.9195 -6.8287 -6.8287

<sup>7</sup> -10.6272 -10.7364 -10.6272 -10.3445

 1 1 0 0 (,) (, )(, , ,)

*i*

Where ( ) *<sup>i</sup> b x* is the ith bit in the binary expansion of *x* (it is equal either 0 or 1).

0 ( , , , ) (1 / ) ( 1) *i ni i ni*

Table 6 represents the seven first elements of the vector Walsh calculated for one character with four transformations. While Table 7 illustrates Walsh coefficient calculated for different

1

Where *f* (,) *x y* is the intensity of the pixel with the coordinates (,) *x y* in the original binary image. The size of image *f* is \* *N N* , and *uv N* , 0,..., 1 , thus we compute <sup>2</sup> *N* Walsh

*<sup>n</sup> b xb u b <sup>y</sup> b v*

1 1

*N N x y*

transforms, *gxyuv* (,,,) is the Kernel function given by the following form:

We shall prove

For 3 ≤ j ≤ 7,

And

 ' 1 1 and

 '

moments for one character with four transformations.

*<sup>i</sup>*

log( ) 

Table 5. Modified Invariant Moments

The Walsh transformation is given by:

**4.3 Walsh transform** 

characters.

  *ds ds* ' (37)

*j j* (38)

2 2 cos sin 1 (39)

 

*W uv f xygxyuv* (41)

() () () ()

*gxyuv N* (42)

3 2 23 2 2 (cos 3cos sin ) (sin 3cos sin ) 1 (40)


Table 7. Walsh coefficients

#### **5. Characters recognition**

In the character recognition system, the recognition is the last phase which is used to identify the segmented character. Where we use two techniques: the Neural Network (Hamza, 2008; Gu and al, 1983; Alnsour and Alzoubady, 2006; Asiri and Khorsheed, 2005) and Dynamic Programming (Sylvain and al, 2003).

#### **5.1 Neural network**

Characters are classified according to their computed features by means of artificial neural networks. Among the many applications that have been proposed for neural networks, character recognition has been one of the most successful. Many neural network architectures have been used in optical character recognition implementation. MLP is usually a common choice. Unfortunately, as the number of inputs and outputs grow, the MLP grows quickly and its training becomes very expensive. In addition, it is not easy to come up with a suitable network design and many trail-and-error cycles are required.

The Neural Network (Fig.8) represents an example of Multilayer Neural Network which contains one hidden layer. It has:


Recognition of Tifinaghe Characters Using Dynamic Programming & Neural Network 49

For each example of applied learning base input of the network, we calculate the

In the next, we propagate this error on the hidden layer; the error of each neuron of

1 1 . *jj j kj <sup>k</sup> k*

6

 

> <sup>0</sup>

 

> <sup>0</sup>

 1/2 <sup>6</sup> <sup>2</sup>

With, *kt* is a desired output and *o* is the output of Network.

1 , *k ki i i*

Dynamic Programming was applied to speech recognition by Tappert et al 1982, by Sakoe and Chiba, 1978 to recognize Latin character and by El ayachi and al, 2010 to recognize Tifinaghe characters. The Dynamic Programming strategy is a useful technique for the problem of optimization. It is often used to find the shortest path from one place to another

is the learning parameter determinate experimentally.

Loop in step two allows computing the error threshold (0.0001), and the number of

After the learning of Network and the execution of Tifinaghe characters recognition system to recognize a text, we use the Euclidian distance to identify characters.

*E Z ZSZ k k kk k* 1 (46)

*F Y Y WE* (47)

. . *V XF ji i <sup>j</sup>* (48)

. *Y Fj* (49)

. . *W YE kj j <sup>k</sup>* (50)

. *X Ek* (51)

*dt o t o* (52)

**Step 3.** Error back propagation

error at output layers by the

the hidden layer is given by

**Step 4.** Correction of connections weights

and

and

**Step 5.** (Loop)

Where ( 0.9) 

terations (50000).

**5.2 Dynamic programming** 

where *Sk* desired output and *Zk* the actual output.

We change the weights connections as follows Between input layer and hidden layer:

Between hidden layer and output layer:

and solve the comparative problem between two strings.


Fig. 8. Neural Network

The processing of Neural Network consists of five steps:

**Step 1.** Initializing of weights connections

The weights are randomly selected.

**Step 2.** inputs propagation The inputs *Ei* are presented to input layer: *X E i i* . We propagate to hidden layer as follows

$$Y\_j = f\left(\sum\_{i=1}^{7} X\_i V\_{ji} + X\_0\right) \tag{43}$$

After hidden layer, the output layer is given by

$$Z\_k = f\left(\sum\_{j=1}^3 Y\_j \mathcal{W}\_{kj} + Y\_0\right) \tag{44}$$

where the values *X*<sup>0</sup> and *Y*0 are scalars and *f* is the activation function given by

$$f(a) = \bigvee\_{1 \le a \le p} 1\_{\exp\left(-a\right)}\tag{45}$$

#### **Step 3.** Error back propagation

48 Recent Advances in Document Recognition and Understanding

Y0

Xi input layer Yj Hidden layer Zk output layer

1 *k j kj j*

 3

 

( ) <sup>1</sup>

where the values *X*<sup>0</sup> and *Y*0 are scalars and *f* is the activation function given by

1 *j i ji i*

 7

 

0

0

*Y f XV X* (43)

Wki

*Z f YW Y* (44)

1 exp *f a <sup>a</sup>* (45)

3×6 connections between hidden layer and output layer, each weighted by *Wkj* .

Vji

*X*<sup>0</sup> , *Y*0 are initialled values which are scalars.

X0

Fig. 8. Neural Network

**Step 2.** inputs propagation

The processing of Neural Network consists of five steps:

We propagate to hidden layer as follows

The inputs *Ei* are presented to input layer: *X E i i* .

After hidden layer, the output layer is given by

**Step 1.** Initializing of weights connections The weights are randomly selected.

For each example of applied learning base input of the network, we calculate the error at output layers by the

$$E\_k = Z\_k \left(1 - Z\_k\right) \left(S\_k - Z\_k\right) \tag{46}$$

where *Sk* desired output and *Zk* the actual output.

In the next, we propagate this error on the hidden layer; the error of each neuron of the hidden layer is given by

$$F\_j = Y\_j \left(1 - Y\_j\right) \sum\_{k=1}^6 \mathcal{W}\_{kj} E\_k \tag{47}$$

#### **Step 4.** Correction of connections weights

We change the weights connections as follows

Between input layer and hidden layer:

$$
\Delta V\_{\vec{\mu}} = \eta \mathcal{X}\_i \mathcal{F}\_{\vec{\mu}} \tag{48}
$$

and

$$
\Delta Y\_0 = \eta.F\_j \tag{49}
$$

Between hidden layer and output layer:

$$
\Delta \mathcal{W}\_{k\bar{\eta}} = \eta. Y\_{\bar{\jmath}}. E\_k \tag{50}
$$

and

$$
\Delta X\_0 = \eta.E\_k \tag{51}
$$

Where ( 0.9) is the learning parameter determinate experimentally.

**Step 5.** (Loop)

Loop in step two allows computing the error threshold (0.0001), and the number of terations (50000).

After the learning of Network and the execution of Tifinaghe characters recognition system to recognize a text, we use the Euclidian distance to identify characters.

$$d\left(t\_{k'}o\right) = \left(\sum\_{i=1}^{6} \left(t\_{ki} - o\_i\right)^2\right)^{1/2} \tag{52}$$

With, *kt* is a desired output and *o* is the output of Network.

#### **5.2 Dynamic programming**

Dynamic Programming was applied to speech recognition by Tappert et al 1982, by Sakoe and Chiba, 1978 to recognize Latin character and by El ayachi and al, 2010 to recognize Tifinaghe characters. The Dynamic Programming strategy is a useful technique for the problem of optimization. It is often used to find the shortest path from one place to another and solve the comparative problem between two strings.

Recognition of Tifinaghe Characters Using Dynamic Programming & Neural Network 51

Two recognition methods based on neural network and dynamic programming has been presented. The system recognition consists of three phases including pre-processing, features extraction and recognition. The pre-processing includes position normalization, baseline skew correction and segmentation. The skew angle is determined by using Hough transform. The segmentation process consists of two steps: (a) segmentation of text into lines using horizontal histogram, (b) segmentation of lines into characters using vertical histogram. In features extraction phase a set of 7 invariant moments descriptors, 7 modified invariant moments descriptors and 7 Walsh coefficients have been used to represent the numerical features of the character extracted. Finally the numerical features are passed to

The programs were written using Matlap. As mentioned previously, no efficient technique has been found for Tifinaghe scripts recognition. This field is of importance for future research.

Alnsour, A.J. and L.M. Alzoubady. (2006). *Arabichandwritten characters recognized by* 

Asiri, A. and M.S. Khorsheed. (2005). *Automatic processing of handwritten Arabic forms using* 

Attila Fazekas and Andras Hajdu. (2001). *Recognizing Type set Documents using Walsh*, JCIT-

B B Chaudhuri, U Pal and M Mitra. (2002). *Automatic recognition of printed Oriya script*, Sädhanä Vol. 27, Part 1, February 2002, pp. 23–34. © Printed in India. Casey & Lecolinet . (1996). *A survey of methods and strategies in character segmentation*. IEEA

Ch. Choisy and A. Belaid. (2002). *Cross- learning in analytic word recognition without* 

C. Tappert. (1982). *Cursive Script Recognition by Elastic Matching*, IBM J. Res. Develop., Vol.

D. J. Burr. (1982). *A Normalizing Transform For Cursive Script Recognition*, Proc. 6th Int. J.

E.Kavallieratou, N.Fakotakis, and G.Kokkinakis. (1999). *Skew Angle Estimation in Document* 

Hadjar, K. and R. Ingold. (2003). *Arabic newspaper segmentation*. Proceeding of 7th

Hamza, Ali A. (2008). *Back Propagation Neural Network Arabic Characters Classification Module Utilizing Microsoft Word*; Journal of Computer Science 4 (9): 744-751, 2008. H. Sakoe and S. Chiba. (1978). *Dynamic Programming Algorithm Optimization for Spoken Word* 

Conf. on Pattern Recognition Munich (1982), pp. 1027–1030.

*neural networks*. Proceeding of the World Academy of Science, Engineering and

Transactions on Pattern Analysis and Machine Intelligence, Vol. 18, No. 7, pp: 690-

*segmentation*, in Int. Journal on documentAnal. & Recognition IJDAR, 4(4): 281-289,

*Processing Using Cohen's Class Distributions*, PRL(20), No. 11-13, November 1999,

International Conference on Document Analysis and Recognition, Aug. 3-6, IEEE

*Recognition*, IEEE Trans. Acoust., Speech and Signal Processing, Vol. ASSP-26, No.

*neocognitron artificial neural network*. J. Pure Appl. Sci., 3: 1- 17.

**7. Conclusion & perspectives** 

the classifiers to recognize the character.

Technology, Aug. 2005, pp: 313-317.

CIT 9, 2-2001, pp: 101-112.

26, No. 6, 1982, pp. 765-771.

Computer Society, pp: 895-899.

706 July 1996.

pp. 1305-1311.

1, 1978, pp. 401-408

2002

**8. References** 

The operation of Dynamic Programming (for invariant moments) is based on the following steps:

**Step 1.** Compute the matrix d between the vector of segmented character*Vcar* and each one of the Tifinaghe characters vectors*Vref* . The matrix d is given by:

$$d(\mathbf{x}, y) = \left| V\_{car}(\mathbf{x}) - V\_{ref}(y) \right| \tag{53}$$

Where *x y*, 1,2,...,7

**Step 2.** Calculate the optimal path from point (1,1) to point (,) *x y* by the following recursive relationship:

$$S(\mathbf{x}, y) = d(\mathbf{x}, y) + \min \begin{bmatrix} S(\mathbf{x} - \mathbf{1}, y)\_{\prime} \\ S(\mathbf{x} - \mathbf{1}, y - \mathbf{1}) \\ S(\mathbf{x}, y - \mathbf{1}) \end{bmatrix} \tag{54}$$

Where

*Sxy* (,) is4 the cumulative distance along the optimal path from point (1,1) to point (,) *x y* .

*Sxy* (,) is eva4luated on the area 1,7 \* 1,7 that is browsed column by column or row by row starting from point (1,1) .

**Step 3.** Calculate the dissimilarity indices using the following form:

$$D(V\_{\rm conv}, V\_{\rm tr}) = \mathbf{S}(T, T)/T \tag{55}$$

#### **6. Experiments results**

Experiments have been performed to test the above system. The developed Tifinaghe text recognition system has been tested on printed text. The system designed in Matlap for the recognition. The image to be tested is captured using a scanner. Before the recognition phase a database of 360 images is made. All tests are applied on 124 characters.

The system is working fine and showing a good recognition rate (Table 8). It has been noticed that the extracted features of the images produced from segmentation module deviate a lot from the respective results in the training set. It seems that the resolution differences are affecting the geometric moments of the image, making them highly variant. It is expected that the recognition rate of the system can be improved by normalizing the training set as the characters that result after the segmentation phase. The system has been implemented on Intel (R) Core (TM) 2 Duo, CPU T5870 @ 2.00 Ghz, with a RAM: 2.00 Go. The system is still under development.


Table 8. Recognition rates & Error rates

#### **7. Conclusion & perspectives**

Two recognition methods based on neural network and dynamic programming has been presented. The system recognition consists of three phases including pre-processing, features extraction and recognition. The pre-processing includes position normalization, baseline skew correction and segmentation. The skew angle is determined by using Hough transform. The segmentation process consists of two steps: (a) segmentation of text into lines using horizontal histogram, (b) segmentation of lines into characters using vertical histogram. In features extraction phase a set of 7 invariant moments descriptors, 7 modified invariant moments descriptors and 7 Walsh coefficients have been used to represent the numerical features of the character extracted. Finally the numerical features are passed to the classifiers to recognize the character.

The programs were written using Matlap. As mentioned previously, no efficient technique has been found for Tifinaghe scripts recognition. This field is of importance for future research.

#### **8. References**

50 Recent Advances in Document Recognition and Understanding

The operation of Dynamic Programming (for invariant moments) is based on the following steps: **Step 1.** Compute the matrix d between the vector of segmented character*Vcar* and each one

**Step 2.** Calculate the optimal path from point (1,1) to point (,) *x y* by the following

( , ) ( , ) min ( 1, 1,

*Sxy dxy Sx y*

( 1, ),

*Sx y*

( , 1)

Dynamic Programming Neural Network

rates Error rates Recognition

*Sxy*

*Sxy* (,) is4 the cumulative distance along the optimal path from point (1,1) to point

*Sxy* (,) is eva4luated on the area 1,7 \* 1,7 that is browsed column by column or

 *D*(*Vcar*,*Vref*)=*S*(7,7)/7 (55)

Experiments have been performed to test the above system. The developed Tifinaghe text recognition system has been tested on printed text. The system designed in Matlap for the recognition. The image to be tested is captured using a scanner. Before the recognition phase

The system is working fine and showing a good recognition rate (Table 8). It has been noticed that the extracted features of the images produced from segmentation module deviate a lot from the respective results in the training set. It seems that the resolution differences are affecting the geometric moments of the image, making them highly variant. It is expected that the recognition rate of the system can be improved by normalizing the training set as the characters that result after the segmentation phase. The system has been implemented on Intel (R) Core (TM) 2 Duo, CPU T5870 @ 2.00 Ghz, with a RAM: 2.00 Go.

Invariant Moments 93.55% 6.45% 94.35% 5.65%

Moments 92.32% 7.68% 93.63% 6.37% Walsh Transform 92.75% 7.25% 97.58% 2.42%

(,) () () *car ref d x y VxV y* (53)

(54)

rates Error rates

of the Tifinaghe characters vectors*Vref* .

row by row starting from point (1,1) .

**Step 3.** Calculate the dissimilarity indices using the following form:

a database of 360 images is made. All tests are applied on 124 characters.

Recognition

The matrix d is given by:

Where *x y*, 1,2,...,7

recursive relationship:

Where

(,) *x y* .

**6. Experiments results** 

The system is still under development.

Table 8. Recognition rates & Error rates

Modified Invariant


**0**

**4**

*USA*

**Character Degradation Model and HMM Word**

Aria Pezeshk and Richard L. Tutwiler

*Applied Research Lab, The Pennsylvania State University*

**Recognition System for Text Extracted from Maps**

Geographic maps are one of the most abundant and valuable sources of accurate information about various features of bodies of land and water. Due to their importance in applications ranging from city planning and navigation to tracking changes in vegetation cover and coastline erosion, most countries have established dedicated organizations that are responsible for the production and maintenance of maps that cover their entire territories. This has resulted in the production and availability of a tremendous quantity of useful

As with other types of documents, new maps are nowadays produced in specialized computer programs, and are easy to manage and update since the individual information layers that form the whole map are available to the map producer. In addition to the change in the method of production, the applications and ways to process maps have also changed in the past few decades. Geographic Information Systems (GIS) have provided new means to analyze, process, visualize, and integrate various forms of geographic data. The input to these systems can be satellite or aerial imagery, remote sensing data (e.g. LIDAR images), raster or vector representations of geographic maps, and any other type of data that are related to locations (e.g. local populations, crime statistics, and textual information). Due to their wide availability, accuracy, and relative cheapness compared to other types of geo-referenced data, geographic maps are probably the most widely used source of information for GIS users. However, the majority of existing geographic maps exist only in printed form. This means that unlike the case for computer generated maps, printed maps cannot be directly used as the input to a GIS since both the end users and the map producers only have access to the dense and complex mixture of regularly intersecting and/or overlapping set of graphical and

Currently the only reliable way of converting printed maps into computer readable format is to have a highly trained operator manually extract the individual sets of features (graphical and textual). The manual feature extraction methods consist of digitization using a digitizing tablet, and heads-up digitizing. In the first method, the paper map is placed on top of the digitizing tablet, and the operator traces over lines and other objects of interest using a stylus or a digitizing puck (a device with crosshairs and multiple buttons that enable data entry operations). In heads-up digitizing (otherwise known as on-screen digitizing) on the other hand, the paper map is first scanned into a digital image. The operator then traces over every single object of interest on the computer screen using a mouse. Since zooming into difficult

**1. Introduction**

information about every part of the world.

textual elements rather than the individual features of interest.

