A new method and realization system with high accuracy for meteorological meter dial measuring and recognizing is proposed in this paper in detail using a two-dimensional controllable and movable camera, we locate pointer of meter dial and collect partial information of image. At the same time using Bi-level and finally thinning line algorithm, we obtain clear dial, index and figure. Then we read dial by means of effective length of line in machine vision and digital recognizing technique. This system is suited to observatory at field especially.
Key words: machine vision; pattern recognition; image edge thinning
The main advantage of machine vision to be used in meteorological meter dial identification is that the system can measure meteorological data at field in read-time and avoid instability error (random error) of electronic meter. So accuracy of meteorological forecast is improved. Then it provide a reliable assure for military affairs, scientific research and other scientific fields. Especially for the observatory at field in terrible climate, people have to go to field to measure data regularly. If the climate is too terrible for people to measure data, meteorological analysis and forecast may be incorrect. While using the system discussed in the paper we can get accuracy meteorological data. Moreover, with data processing system the machine vision system can forecast meteorological quickly and accurately.
Taking influence of light and illumination of louver-box at field into account, a controllable lighting system is set in the system for picture shooting. In addition in order to shoot picture as clear as possible, the thermometer must be solider than general one. And meters in the thermometer system should be fixed very well.
In the paper, we firstly introduce hardware structure of the system. Secondly we introduce a fine thinning algorithm and a recognition algorithm. At last taking recognition of temperature dial for example, we describe the working principle and accuracy range of system in general.
2.Hardware disposition of System
Shown as fig.1, the system consists of five parts: camera, digitization of video, PC computer, lights source and camera controller, terminal monitor and printer and so on.
Fig 1: hardware disposition of system |
1.digital video 2. image monitor 3.PC computer 4. light source and camera controller
5. dial L1.lamp 1 L2.lamp 2 Mx. motor x My. motor y
Here we gust take a kind of meter dials for example. In fact, there also is some other meter panels, such as scale of line distribution or half-arc distribution.
The working process is briefly introduced as follows: when main program start to send, the PC computer send a start signal to the lamp. Then program control motor X and motor Y moving to fix camera at a predetermined position (i.e. according to the fixed distance of meteorological meter in
louver-box), simultaneously shooting partial picture of meter dial. The computer looks for the position of pointer and liquid level (that refers to barometric pressure meter, thermometer and so on). Then it controls camera to a best position by trimming (This adjustment process will be introduced below). At last according to the scale and the pointer front computer automatically read the scale and saves and print the data of pictures as demanded.
3. Reading algorithm of meter dial
The algorithm consists of two parts: one is scale and pointer (or liquid level) fine thinning, the other is identification and reading of scale.
3.1 Pretreatment and thinning
Since it is impossible to adopt complicated light disposition in the light system (high manufacturing cost), the optical field must be uneven. To reduce the effect of this case, a simple method is to make Bi-level of original picture.
Suppose image is 511 grey value M=8bit, i.e. 0~255. The Bi-level image is f2 (x, y), then
Here A is a constant, an arbitrary constant from 1 to 255. Assuming that A=100 in our system. T is threshold. There is many statistical methods to choose T. While any way need to know about distributed characteristic of f(x, y), which is impossible. Now we choose T according to the formula below:
| T=[fmax (x, y) +fmin(x, y)]/2
Where fmax (x, y) and fmin (x, y) are maximum and minimum grey value of input image.
To calculate distance between the two adjacent graduation that the pointer position or, the Bi-level picture f2 (x, y) must be thinning. Thinning algorithm is:
Where Xm =(Xi +Xf )/2, Ym=(Yi+Yf)/2
Xi and Yi are initial position of line width
Xf and Yf are final position of line width.
Note that line width designation refers to that all the continuous pixels are A grey value.
Taking hair hygrometer for example, its Bi-level and thinning process image is shown as fig.2. Where fig.2(b) express Bi-level picture, fig.2(a) is thinning picture.
Fig 2: preprocess and thinning image of hair hygrometer
3.2 Reading algorithm of scale
According to type of scale on the meter dial: circle, half-circle and line, we first seek for centerline of scale distribution position in order to look for scale line along with the center line. Then length of integer scale is two times of 0.1 scale; while length of 0.5 scale is 2/3 of the length of integer scale, discriminate the position of scale, at last according to position of pointer to recognize and read data.
Next we discuss description of scale centerline (circle or half circle meter dial).
First step, determine the direction of pointer and origin of pointer.
Fig 3: scales and center line
Second step, seek and identify scale like integer scale, 0.1 scale, and 0.5 scale near the pointer.
Third step, draw a circle (or arc) and the radius equals the distance from 0.1 time scale circle (or arc) to pointer the centerline of scale.
When the distribution of scale is easy to draw. Here we don't discuss it any more.
Scales of partial arc and centerline are shown as fig.3 Dot-and-dash lines in fig.3 express rays relation of the scales.
Data reading process consist of two steps. First step is identification of marked figures which is nearest from the pointer from the pointer. Second step is according to the position where pointer is on the center to calculate arc length of the marked figures which is integer times scale.
Identification of marked figure is realized by means of matching and rotating method. Since arrangement of figures on meter dial and rays from origin point are in parallel, sample figures(0,1,2,3,4,5,6,7,8,9,) must be rotated a certain angle a, meanwhile enlarging or scaling down a certain times b. Then it will match with figures on meter dial. Matching degree of single figure reach 90%, that means matching successfully. The process on general is as follows:
First, suppose i=0, j=0, j =0, a=0, Da=0, b=0, Db=0.
Second, choose sample figure corresponding to i and rotate it with a small angle a=a+Da, j2 =j1
Third, calculate its matching degree with figure on the dial, j1 is matching degree. If j1<j2 then j2=j2; if a<10°then return to second, or j2=j1, a=0.
Fourth, enlarge sample figures corresponding with i, b=b+Db then matching with figures on the dial to calculate the matching degree, j1 . If j1<j2 ,a<10°return to second.
Fifth, i=i+1, return to second.
Sixth, identify i, end.
Note that the type of sample figures 0~9 must be corresponding with that of figures on the dial. If not, it is necessary to remind a reserve when calculates the matching degree.
4.System work flow
Camera moving control discussed before is determined by whether the pointer is shot in picture or not. It is given in general block.
Flow sheet of the system is shown in fig.4. Here calculating number of pixels of 0.1 times scale distance is in order to read figure accurately. The larger the number of pixels is, the higher the accuracy of system is. Usually accuracy of reading by eyes is 1/2 of 0.1 time scale. For example, 0.1 time scale indicates 0.1% relative humidity. Then measuring accuracy of meter dial is 0.05%. So accuracy of meter dial is fixed. But if the number to 0.1 time scale distance is 10 and because resolution of image processing is a pixel then, a hygrometer's accuracy will be increased from 0.05% to 0.01%. Of course it is of scale of meter and doesn't mean the accuracy of meter dial itself.
5.Dicussion and conclusion
A new meteorological meter dial machine vision identifying system is introduced in this paper. Using this system, the detected device doesn't be damaged. While its manufacturing cost is very low.
It is very convenient for the meteorological department (especially for military affairs meteorological department) to solve problem of meteorological meter automatically monitoring. Using this system data acquisition is in real-time, so it provides a scientific method to improve accuracy of meteorological forecast. Of course, in some fields, chemical engineering for example, where men can not or hardly read data directly is very convenient to use this system.