Sie sind auf Seite 1von 6

Automatic Numeric Characters Recognition of Kilowatt-Hour Meter

Danilo Mendona Oliveira, Ruironaldi dos Santos Cruz, Kamel Bensebaa Computer Sciences Department Federal University of Sergipe Campus So Cristovo, Sergipe, Brazil danilomo@dcomp.ufs.br, nt_rui@yahoo.com, kamel-bensebaa@ufs.br

Abstract
Measurements of electricity use can be used in many ways. They allow a utility customer to control electricity consumption (and demand), determine typical consumption, and evaluate opportunities for improving energy efficiency. The most common device to measure electricity consumption is a kilowatt hour meter which can display the quantity of electric power used at fixed periods. In this paper we present an algorithm for characters recognition of Watt-hour meters M1A-T Nansen model. The proposed algorithm consists of three major stages. First the homomorphic filter is applied to reduce the effects of non-homogenous illumination. Then the extraction of specific area including characters is performed. The last stage of the method consists of using the K-Nearest Neighbors (K-NN) algorithm to recognize automatically the numeric characters of the kilowatthour meters. Based on the experimental results, we noted that our algorithm achieved a high accuracy.

1. Introduction
An electric meter or energy meter is a device that measures the amount of electrical energy supplied to or produced by a residence, business or machine. The most common type is a kilowatt-hour meter. When used in electricity retailing, the utilities record the values measured by these meters to generate an invoice for the electricity. The electric companies typically take monthly readings on these meters. Traditional electric meters are electro-mechanical devices, equipped with a series of mechanical dial faces and needed to be read by a meter man. But modern dials are electronic devices and can transmit their readings automatically. Both analog and digital meters measure electrical energy in kilowatt-hours.

Although the electronic kilowatt meters has many advantages, i.e., they are easy for anybody to read, there is no chance for interpolation errors and can be incorporated in automatic system for data recognition in real time. There are millions of these older models still in use. At present in Brazil, the device commonly used to measure electricity consumption is electro-mechanical and the electric companies take readings on these meters from the numeric characters manually each month. As the data reading procedure is manually and human errors cause trouble with customers regarding electricity charge, then to solve this problem we have developed an efficient algorithm to automatically recognize the numeric characters of the kilowatt-hour meter. Today, number recognition is playing an important role on image processing field. Recently, a lot of works were done by depending on the computer; in order to let the processing time to be reduced and to provide more accurate results. For example, depending on different types of data, such as characters and digits and the numbers are used frequently in normal life operation. Numerical Digit Character Recognition is concerned only with the 10 numeric digits 0-9. In many situations numeric characters are required to be recognized. For instance, in some countries the zip (post)code of addresses is composed entirely of numeric characters and the recognition of the zip code alone is enough to approximately sort the letters into separate destinations [2], [6]. Another common use of numerical characters recognition is reading bar-codes of products [12] In other applications, numerical digit characters recognition in car plates have been extremely found and studied and various approaches in image processing and pattern recognition have been developed by scientists and engineers to solve this

problem[5],[11],[13]. In any case, the software tools and methods required to perform numerical recognition are the same as for the unconstrained version and provides more accurate results. However, despite the emergence of new technologies to measure the electrical energy, many electric companies in some countries still uses analog meters where the companies representative reads and store the necessary information by hand. The challenge of these companies is to develop automatic systems for reading electrical energy. In this sense, some algorithms for automatic numeric characters recognition of kilowatt-hour meter were developed [3],[9],[14]. In our study, a system for digits recognition is built, which may benefit various fields, mainly electric companies in Brazil. The approach concerns on isolated digits, the input is considered to be an image of specific size and format, the image is processed and then recognized to result on an edited digit. The organization of this paper is as follows: Section 2 gives some information of kilowatt-hour meter image acquisition. Section 3 describes the pre-processing operation. In Section 4 the different steps strategy of location reading area is introduced. Section 5 discusses the digits extraction procedure. The algorithm of digits recognition is done in Section 6. We conclude in Section 7.

3. Pre-processing
Due to the effects of non-homogenous illumination, some pre-processing must be done. Therefore an homomorphic filter [4] is applied to enhance the original image. This kind of filters is widely used for compensating the effect of non-uniform illumination in a image. In digital image processing, the homomorphic filtering approach is derived from an illumination reflectance model of the image. Homomorphic filtering can perform simultaneous dynamic range compression and contrast enhancement. Crucial for the success of the homomorphic approach is the selection of an appropriate frequency-domain filter function in order to modify the illumination and reflectance components of an image differently. In this sense, a good deal of control can be gained over the illumination and reflectance components with a homomorphic filter. This control requires parameters specification of the filter function that affects the low and high frequency components in Fourier domain in different controllable ways. Two parameters of this filter are important. The first one is low frequency and the second high frequency. If the parameter L and H are chosen so that L<1and H>1, the filter function in Figure 2 tends to attenuate the contribution made by low frequency (illumination) and amplify the contribution made by high frequency (reflectance). In this work, to reduce the effects of nonhomogenous illumination in kilowatt-hour image, a homomorphic filter based on Gaussian high filter was applied using the following equation.

2. Kilowatt-hour meter image acquisition


The initial task of this work is the selection of images, which will be used in the proposed algorithm. Through the CCD camera, a set of images of Kilowatthour meters (M1A-T Nansen model) were captured. These images have a specific format and with a determined size such as 30562292 pixels. Figure 1 illustrates a kind of the image acquired.

H (u , v) = ( H L ) 1 e c ( D

2 ( u ,v ) / D0 )

]+

Figure 2 shows radial cross of a circularly symmetric homomorphic filter function.

Fig. 1. Kilowatt-hour meters (M1A-T Nansen model

Fig.2. Radial cross of a circularly symmetric homomorphic filter function

4. Location of reading area


In this stage of the algorithm we extract from the image only the area where the digits are. By looking at the visual characteristic of the image we realize that the reading area is located between the second and the third horizontal lines. Then, to locate the digits area, several operations are necessary and are described as follows. Image binarization converts an image of up to 256 gray levels to a black and white image. The simplest way to use image binarization is to choose a threshold value, and classify all pixels with values above this threshold as white, and all other pixels as black. The binarization techniques for greyscale image can be grouped into two broad categories: global binarization and local binarization. Global binarization methods like that of Otsu try to nd a single threshold value [7]. Then the thresholding is a necessary step to convert the monochrome digits into binary images, which is convenient as most simple character recognition algorithms are based on the analysis of black & white image features. The binary image is composed comparing the input image pixels with the obtained threshold as shown in the following equation.

dilation followed by erosion with the same structuring element.

Fig.4. Result of opening operation The next step of our procedure consists of using internal morphological gradient operator. This operator is defined as the difference between the original image and the eroded image and calculates the internal boundary [8]. In this step of the algorithm, we have used this gradient in the previous image to detect edges using a structuring element of one pixel. When the edge detection operation is performed we apply morphological opening operation using a structuring element in line form to remain only the horizontal lines. Then we scan the result image from the top to the bottom to locate the second and the third largest line. Figure 5 and Figure 6 show respectively the image with edges detected and the horizontal lines location of the reading area.

Figure 3 shows the image after binarization operation.

Fig. 5. Binarized mage with edges detected Fig. 3. Binarized image Once the image binarization is performed some artifacts or objects appear and may difficult the location of the reading area. Then some morphological operators were applied with the aim to achieve the selection of the reading area. Mathematical morphology offers very efficient tools for image analysis[1]. Thus, a binary morphological opening was used to remove the artifacts in the binarized image (Figure 4). This operator consists of a Fig. 6. Horizontal lines of the reading area To find the left and right boundaries of interest, we perform a different procedure. By using a morphological opening operator with a large structuring element we can remove the digits of the region and any noise, but we preserve the regions outside the reading area. With this result, we look at the first white pixel starting from the middle in both

directions. Thus, finally we find the location of the region of interest. The images of this procedure are shown in figure 7 which consists of the input image to find the vertical lines, the result of opening operation step and the location of the region of interest. Figure 8 illustrates the reading area with the digits to perform the next stage of the algorithm i.e., digits extraction.

The extracting task of connected components related find the region of white pixels all accessible from the original pixel using a path of white pixels in the directions: up, down, left and right. The result of this operation is a matrix whose dimensions are the same as the original matrix. For the result to have the same dimensions of the region

occupied by the digit, we must select only the digit. This task is performed by scanning in four directions to find the extreme limits of the region occupied by the digit (Figure 10). Fig. 7. Vertical lines of the reading area. Fig. 10. Region of digit extraction The component is then removed from the original image and the algorithm continues looking for the next component to reach the end of the line. This horizontal line in the half of the region was used because it is guaranteed that it will extract small pieces of digits that should appear when the digit is changing the value in the kilowatt-hour meter.

Fig. 8. Reading area extracted

5. Digits extraction
Once the reading area is located and selected, we start the digits extraction procedure. This is done firstly to binarize the image, then morphological closing operation is utilized and finally image connected components are extracted, which are the digits to recognize. The binarization is performed using the procedure discussed in Section 4. The most important parameter of this operation is to determine the adequate threshold. The morphological closing operation has as objective to remove noise and adjust the irregular edges of the digits. Firstly, scanning operation is done in a horizontal line in the middle of the region, which is the expected local to find the digits from left to right. When a white pixel is found the function that extracts the connected component is used (Figure 9).

6. Numerical Characters Recognition


In this stage of our algorithm we have used the knearest neighbors algorithm (k-NN) to recognize numerical characters automatically. In pattern recognition, the K-nearest neighbors is a supervised learning algorithm where the result of new instance query is classified based on majority of K-nearest neighbor category [10]. The purpose of this algorithm is to classify a new object based on attributes and training samples. The classifiers do not use any model to fit and are only based on memory. Given a query point, we find K number of objects or (training points) closest to the query point. The classification uses majority vote among the classification of the K objects. Any ties can be broken at random. K-Nearest neighbor algorithm used neighborhood classification as the prediction value of the new query instance. In this work, to classify objects of digits area the kNN algorithm is performed as follows. Initially, the algorithm computes the distance of this object with multiple instances of test. Then, the K instances are chosen with less distance and it finds the class that most repeats. The instances used are an array of integers. The first character is scaled to 40 X 24 pixels (which keeps the average proportions of digits expected), then for each region of (4X4) pixels of the

Fig. 9. Connected component extraction

resized image is computed the sum of 1s, forming a features vector with 60 elements. Each instance is described by 60 digits and the digit it represents. The exception is the digit 1, which is easily recognizable by checking the ratio between the sides of the rectangle that encompasses the character. If this ratio (largest side / shorter side) is greater than 3.0, we have absolute certainty that the digit is one, since this digit is "thinner" than the other. Besides, the distance used in our algorithm is Hamming distance which computes the amount of difference between two objects and achieved good results. The pseudo-code of the K-NN algorithm used in this work specifies the steps to recognize the numerical characters. This pseudo-code is described below. KNN( character, k ) for each training_sample in data base distance hamming_distance(character, training_sample); add pair <training_sample, distance> in a sorted list; neighbours k first elements from list class_counter { 0, 0, ..., 0 }; for i = 1, 2, ..., k n neighbours[i]; class_counter[n] class_counter[n] + 1; sort( class_counter ); return class_counter[k];

9. References
[1] BANON, G. J. F., BARRERA, J., BRAGA NETO, U. M., 2007, Mathematical Morphology and its applications to Signal and Image Processing. 1. ed. So Jos dos Campos: INPE, v. 200. 475 p.
[2] CHATELAIN, C., HEUTTE, L., Thierry PAQUET, T. Segmentation-driven recognition applied to numerical field extraction from handwritten incoming mail documents. 7th IAPR Workshop on Document Analysis Systems, DAS 2006, Nelson, New Zealand, LNCS3872, Springer, pp. 564-575. [3] HIRABURU, T., HIGASHI, S., KUBO, K., KUSUMOTO, K., 2000, Development of a watthour meter data recognition device. Transmission and Distribution Construction. Operation and Live-Line Maintenance Proceedings. 2000 IEEE ESMO - 2000 IEEE 9th International Conference on Volume , Issue , pp. 245 251.

[4] Gonzales, R. C.; Woods, R. E. Digital image processing, 2nd edition, New Jersey: Prentice Hall, 2002.
[5] HUAIFENG, Z., WENJING, J., XIANGJIAN, H., QIANG, W., 2007, Learning-Based License Plate Detection in Vehicle Image Database, International Journal of Intelligent Information and Database Systems, Inderscience, vol. 1, no. 2, pp. 228-243.

[6] LIFENG, S., ZHANG, Y., LUPING, J., 2009,


Constrained ZIP code segmentation by a PCNN-based thinning algorithm, Neurocomputing, v.72 n.7-9, pp.17551762. [7] OTSU, N., 1979, A threshold selection method from gray- &eve2 histogram, IEEE Trans. Systems Man and Cybernetics, Vol. SMC - 9, No. 1, pp. 62 - 68. [8] RIVEST, J.F., SOILLE, P. and BEUCHER, S., Morphological gradients. J. Electron. Imaging. v2 i4. pp. 326-336. [9] SHUTAO, Z., BAOSHU, L., JINSHA, Y., GUIYAN, C., 2005, Research on Remote Meter Automatic Reading Based on Computer Vision. 2005 IEEE/PES Transmission and Distribution Conference & Exhibition: Asia and Pacific Dalian, China. [10] [Stuart J. Russell and Peter Norvig. Artificial Intelligence: A Modern Approach. Prentice Hall, second edition, December 2002. [11] SULEHRIA, H.K., ZHANG, Y., IRFAN, D. and SULEHRIA, K.A. Vehicle Number Plate Recognition Using Mathematical Morphology and Neural Networks. WSEAS Transactions on Computers, vol. 7, no. 6, pp. 781-790, 2008.

7. Conclusion
An approach for automatic numeric characters recognition of kilowatt-hour meter has been proposed and implemented. The proposed algorithm was tested in several digital images and achieved good performance results. Another thing to speak of is this approach can also be applied to other applications, such as a car license plate auto recognition system, numerical characters recognition of reading bar-codes and credit card number recognition. In the future we plan to develop a remote meter automatic reading where the local meter reading information can be transmitted to center electrical companies using computer network.

[12] TEKIN, E., COUGHLAN, J., 2009. A Bayesian Algorithm for Reading 1D Barcodes. Sixth Canadian Conference on Computer and Robot Vision (CRV 2009). Kelowna, British Columbia. [13] VILLEGAS, O.O.V., BALDERRAMA, D.G., DOMNGUEZ, H.J.U., SNCHEZ, V.G.C., License Plate Recognition Using a Novel Fuzzy Multilayer Neural Network. In International journal of computers. [14] YIBO, L., HONGJUAN, Q., 2008, Automatic Recognition System for Numeric Characters on Ammeter Dial Plate. ICYCS 2008, pp. 913-918.