Recognition of Printed English Characters Using Morphological Operations

135 Recognition of Printed English Characters Using Morphological Operations Rana A. Mohammed College of Computer Sciences and Mathematics University of Mosul, Mosul, Iraq Received on: 29 / 12 / 2010 Accepted on: 16 / 3 / 2011 ABSTRACT A morphological printed English character recognition approaches for binary images is shown in this research. Three morphological operations are used for printed English character recognition: Dilation, Erosion and Hit-or-Miss.


Introduction:-
The word morphology commonly denotes a branch of biology that deals with the form and structure of animals and plants. The same word is used in the context of mathematical morphology as a powerful tool for extracting image features and components that are useful in the representation and description of region shape such as boundaries, skeletons, and the convex hull. Morphological techniques are often used to pre-process or post-process images to facilitate analysis, such as morphological filtering, thinning and pruning [8].
There are three primary morphological functions: Erosion, dilation, and hit-ormiss. The others are special cases of these primary operations or are cascaded applications of them [6].
In morphology, a small shape (structuring element) is translated across the image during the course of processing. Certain mathematical logic operations are performed on the image using the structuring element to generate the processed image [1].Therefore morphological operations apply a structuring element to an input image, creating an output image of the same size. In a morphological operation, the value of each pixel in the output image is based on a comparison of the corresponding pixel in the input image with its neighbors. By choosing the size and shape of the neighborhood, we can construct a morphological operation that is sensitive to specific shapes in the input image [5].
Character recognition has become one of the most successful applications of technology in the field of pattern recognition and artificial intelligence. The area of printed English and Arabic characters recognition has been the subject of many research in the past years [2][3] [7]. In section 2 of this paper, some basic concepts from set theory are presented. Structure element description is given in section 3. Section 4 contains the primary morphological operations. Some practical applications are illustrated in section 5, highlighting the printed English characters recognitions.

Some Basic Concepts From Set Theory:-
Let A be a set in Z 2 , the elements of which are pixel coordinates (x,y). If w=(x,y) is an element of A, then Similarly, if w is not an element of A, then a set B of pixel coordinates that satisfy a particular condition is written as For example, the set of all pixel coordinates that do not belong to set A denoted A c is given by This is called the complement of A.
The union of two sets denoted by A ∪ B , is the set of all elements that belong to either A or B or both. Similarly, the intersection of two sets A and B is the set of all elements that belong to both sets, denoted by A ∩ B.
The difference of sets A and B denoted by A-B , is the set of all elements that belong to A but not to B  The logical expression are used to perform the set operation on binary images, as shown in Table (1) [8].

Structuring Element
The basic idea in binary morphology is to probe an image with a simple predefined shape, drawing conclusions on how this shape fits or misses the shapes in the image. This simple "probe" is called structuring element and is itself a binary image [8].
A structure element is a matrix consisting of only 0's and 1's that can have arbitrary shape and size. The pixel with values of 1 define the neighborhood [5].Two dimensional structuring elements are typically much smaller than the image being processed. The center pixel of the structuring element, called the origin, identifies the pixel of interest (the pixel being processed) [5].

Primary Morphological Operations
The operations of dilation ,erosion and hit-or-miss are fundamentals to morphological image processing [8]. The rules for Dilation and Erosion is shown in the following Table(2) [5].

Operation
Rule Dilation The value of the output pixel is the maximum value of all the pixels in the input pixel's neighborhood. In a binary image, if any of the pixels is set to the value 1, the output pixel is set to1. Erosion The value of the output pixel is the minimum value of all the pixels in the input pixel's neighborhood. In a binary image, if any of the pixels is set to 0, output pixel is set to 0.

Dilation
Dilation is an operation that "grows" or "thickens" objects in binary image. The specific manner and extent of this thickening is controlled by a shape referred to as a structuring element [8].

How it works
The dilation operation takes two pieces of data as input:-1) The image which is to be dilated (almost binary).
The dilation process is performed by laying the structuring element on the image and sliding it across the image in a manner similar to convolution. It is best described in a sequence of steps: 1) If the origin of the structuring element coincides with a '0' in the image, there is no change; move to the next pixel. 2) If the origin of the structuring element coincides with a '1' in the image, perform the OR logic operation on all pixels within the structuring element [9]. Figure (2) illustrates how dilation works. Figure (2.a) shows a simple binary image containing a rectangular object. Figure (2.b) is a structuring element, a five-pixel-long diagonal line in this case. Computationally, structuring elements typically are represented by matrix of 0s and 1s; sometimes it is convenient to show only the 1s,as illustrated in this figure. In addition, the origin of the structuring element must be clearly identified. Figure(2.b) shows the origin of the structuring element using a black outline. Figure Figure(2.b). Structuring element with five pixels arranged in a diagonal line. The origin is shown with a dark border When the origin is translated to the # locations, the structuring element overlaps 1-valued pixels in the original image.

Erosion
Erosion "shrinks" or "thins" objects in a binary image. As in dilation, the manner and extent of shrinking is controlled by a structuring element [8].

How it works
The erosion operation takes two pieces as input: 1) The image which is to be eroded (almost binary).
The erosion process is similar to dilation, but it turn pixel to '0', not '1'. As before slide the structuring element across the image and follow these steps:-1) If the origin of the structuring element coincides with a '0' in the image, there is no change; move to the next pixel.

2)
If the origin of the structuring elements coincides with a '1' in the image and any of the '1' pixels in the structuring elements extend beyond the object('1' pixels) in the image, then change the '1' pixel in the image to a '0' [9].

Hit-or-Miss
It is useful to be able to identify specified configuration of pixels, such as isolated foreground pixels, or pixels that are end points of line segments The Hit-or-Miss Transformation is useful for applications such as these [8].

How it works
The hit-or-miss takes two pieces of data as input: 1) The image which is to be processed by hit-or-miss (almost Binary). 2) Two Structuring Element.
The Structuring element used in the Hit-or-Miss is a slight extension to the type that has been introduced for erosion and dilation, in that it can contain both foreground and background pixels, rather than just foreground pixels, both ones and zeros.
Note that the simple type of Structuring element used with erosion and dilation is often depicted containing both ones and zeros as well, but in that case the zeros really stand for "don't care's", and are just used to fill out the structuring element to a convenient shaped kernel. [8] The Hit-or-miss transform of A by B is denoted by AB, here, B is a structuring element pair, B= (B1, B2), rather than a single element, as before. The Hit-or-miss transform is defined in terms of these two structuring element as: Figure (4) shows how the Hit-or-miss transform can be used to identify the locations of the following cross-shaped pixel configuration. Figure (4.a) contains this configuration of pixels in two different locations. Figure (4.c) is erosion with structuring element B1 determines the location of foreground pixels that have north, east, south, and west foreground neighbors. Figure (4.d) is erosion of the complement with structuring element B2 determines the location of pixels whose northeast, southeast, southwest, and northwest neighbors belong to the background. Figure (4.g) is show the intersection (logical AND) of these two operations. Each foreground pixel of figure (4.g) is the location of a set of pixel having the desired configuration [8].  Figure (4.b). Structuring Element B1.

Practical Applications
The morphological hit-or-miss transform is a basic tool for shape detection, If B denoted the set composed of X and its background, then the match of B in A is

Window (1) Test image
So we use the equation (7) in this paper in order to recognize printed English characters in binary images by comparing the test image (for example test image shown in window (1))with all printed English characters and numbers saved images, then the result of recognized printed English characters and numbers is given as shown in window (2) .

Conclusion
This paper shows that morphological approaches is good for recognition of printed English characters in binary images, because it takes little time in execution.