1. Introduction
Pointer meters are used to measure temperature, pressure, flow, level and digital display. Compared with digital instruments, the pointer meters have the advantages of reliable structure, low cost and intuitive readability. Especially in industrial measurement such as substation automation or petrochemical industry, the pointer meters are more likely to observe rapid changes in measured values. Therefore, operators often use the pointer meters to observe measurement process. In general, the readings of the pointer meters are obtained by person judging. With the development of automation and intelligent technology, industry pays attention to that the computer vision methods measure the pointer meter readings. Although modern imaging techniques [
1,
2,
3,
4] have increased image resolution, the measuring accuracy is still affected by several factors, such as angle or distance of the camera observing the meters. Therefore, it is essential to utilize the computer vision techniques to measure the pointer meter in order to improve the accuracy and convenience of measurement.
Generally, present methods of the pointer meter measurement can be divided into two kinds of models. One is extracting the critical points of measured meters display to calibrate the reading. In 1994, Robert et al. [
5] detected image of the circular arc scales to obtain values of a meter using Hough transform. And the values on the rectangle frame were obtained visually by detecting the two lines. In 2000, F. Corrêa Alegria [
6] proposed combining image processing with computer vision techniques to automatically measure the readings of analog instruments, improving measurement stability compared to human eye discrimination reading. Using edge extraction and pattern recognition technology, Shutao Zhao et al. [
7] dealt with images of the meters to achieve automatically reading of the power meter data in 2005. An automatic verification system [
8] of dial indicators was investigated by the image subtraction and dynamic threshold segmentation of features of the dashboard image in 2008. Using the edge detection and mathematical morphology, Zhijia Zhang [
9] screened out image region in the pointers, and then pointer positions were located by the structure and position characteristics in 2009. A modified active shape models scheme [
10] for automatic measuring of multiple analog meters had been proposed in 2014. The analog meter reading scheme utilized different feature points, and appropriately modeled of its displacement according to analog meter scales. In 2018, Yifan Ma [
11] proposed to use the analysis based on the binarization threshold to segment the pointer region, solving the problem of the pointer shadow. And a random sample consensus method put forward to overcome background image interference.
The other model uses a parametric perspective imaging model to convert the pixel coordinates to object space locations. At the Centre for Metrology and Accreditation in Finland, Hemming et al. [
12] came up with computer vision based device for calibrating meter readings in 2002, and calculated the measurement uncertainty. In 2007, they also updated the equipment developed to a micrometer calibration device [
13]. By the Canny edge detection, Danilo Alves de Lima [
14] investigated a vision system for both calibrating the instruments and obtaining the readings in 2008. Using the computer vision, Fernandez et al. [
15] presented a model for calibrating portable measurement devices in 2009. In order to automatically calibrate analog meter measurement process, two segmentation-free methods were presented by P. A. Belan [
16] in 2013. Bresenham algorithm and Radial projection were applied to identify the location of the pointer of the analog meter so that the readings of the analog meter can be automatically obtained. In 2014, an automatic identification model for pointer meters based on binocular vision was developed by Yang. Use two cameras located on the left and right side of the pointer meter in the model. The two pointer lines obtained from the left and right images were then rebuild in three dimensions to determine the value of the point instrument [
17]. In 2018, real-time measurement of multi-pointer instrument was realized by using ARM (Advanced RISC Machine) Hisilicon mobile processing platform and skeleton extraction technology based on distance transform algorithm [
18].
In summary, there are advantages and disadvantages in the measurement methods of the above two models. The first model has the advantage of being easier to measure the reading of the pointer meter, however, the measurement accuracy is lower. If the meter surface is not parallel to the image plane, the changes of the image locations are critical points shown by
Figure 1. The measurement accuracy of the second model is greatly improved, but the redundancy parameters also greatly increase the computational complexity and limit its application and promotion.
The present method calibrates the extrinsic parameters by the pixel coordinates and world coordinates of the mid-points of the measured meter scales firstly, and then the meter image is made parallel to the surface of the meter by the inverse perspective mapping. The mapping is finished by rotation transformation of the meter image, and the rotation transformation matrix obtained by the Rodrigues formula. The rest of the paper is arranged as follows: the approach of measurement the reading of the pointer meter is presented in
Section 2.
Section 3 provides experiments and results, and analyzes the effects of certain factors through experiments. Conclusions are given in
Section 4.
2. Measurement Principle
2.1. Reverse Projection of the Meter Image
The present method for measuring readings of the pointer meter is shown in
Figure 2. The camera intrinsic parameters A are calibrated by the Zhang [
19] in the
Appendix for the detail. For obtaining the extrinsic parameters,
Xw–
Yw coordinate plane of a World Coordinate System (WCS) is established on the meter surface, direction of the
Xw-axis is parallel to connection line from center of the pointer rotation to the starting scale, the
Zw axis perpendicular to the meter surface, and origin of the World Coordinate System is at center of the pointer rotation. Radii of circular arc of the scale distribution and center angles corresponding to the distribution can be determined by manually measuring the dimension distribution of the meter scales. So, world coordinates of midpoint on every short scale can be calculated by the radius
and angles as:
Here is center angle between neighbors two scales, i is the scale.
Then, the sub-pixel coordinates
of midpoint of each short scale on the meter image can be detected by sub-pixel detection algorithm [
20]. The camera extrinsic parameters
are determined by the world and pixel coordinates of the midpoints. And the world coordinates of midpoints on the short scales are transformed into the camera coordinates
by the extrinsic parameters.
For transforming the meter image parallel to the meter surface by the inverse perspective mapping, normal vector
of the meter surface is calculated by the camera coordinates of three midpoints to obtain angle
between
and normal vector of the meter’s theoretical image plane. So, the inverse perspective mapping is finished by rotating the meter’s theoretical image plane to the angle
relative to
. From the Rodrigues formula, the rotation transformation matrix
for the image plane is obtained by
:
The meter image is rotated by the matrix to make the meter image parallel to the surface of the meter. The coordinate of the point in the meter image is transformed by M to the coordinates of the points in the transformed meter image, as shown in Equation (3).
Here, the of all the points in the transformed image are the same. Therefore, the coordinates of the critical point (including the rotation center and the endpoint of the pointer) in the transformed meter image can be corrected in this way, identifying the reading of the pointer meter.
2.2. Measuring Readings of Pointer Meters
The reading of the pointer meter can be obtained by locating the position of the pointer relative to the scale lines after the inverse perspective mapping. The algorithm for measuring the pointer meter reading is divided into two main steps. In the first step, all the midpoints of scales on the pointer meter are detected in order from zero scale line to the maximum scale line. In the next step, the critical points on the pointer meter are collected separately. Then, the reading of the pointer meter is identified.
First of all, the obtained pointer meter image is converted into the binary image by the method [
21] to obtain automatically the meter dial. It uses the adaptive threshold to segment the image and use the connected domain labeling to locate the dial and the scale lines from the background pixels. Due to uneven illumination of the pointer meter dial or digital printing on the pointer meter, it is possible to be a few defective scale lines in the detected area. So, morphological opening and closing can reduce image noise by eliminating the bright or dark components [
22]. And then, all the mid-points of the scales lines are detected from zero-scale line
to maximum-scale line
.
After detecting all the midpoints of the short scales, one circle is fitted to these points, and the coordinate of the rotation center
can be obtained by circle fitting algorithm [
23]. Then, the Hough transformation method [
24] is adopted to detect the straight lines in the image, the longest straight line that intersects the coordinates of the rotation center can be determined as the position of the pointer. Therefore, the coordinate of the endpoint of the pointer
on the pointer meter can be acquired. Finally, the reading of the pointer meter can be calculated by the Angle method, which calculates the angle between the zero scale line and the detected pointer according to Equation (4):
Here, α was the premeasured angle between zero scale line and the maximum scale line. In order to calibrate the extrinsic parameter of the meter plane, the angle α is manually premeasured by the dimension distribution of the pointer meter scales. When the measurement is carried out by the present method, the meter image is firstly made parallel to the meter surface by the inverse mapping, then angle α on the image is obtained by the pixel coordinates of the midpoints of the scale line and the rotation center, and the pixel coordinates are determined by the sub-pixel detection of the transformed image. β was the angle between the detected pointer and zero scale line. N is the scale value which is measured between zero scale line
and maximum scale line
. The final detection result of pointer’s endpoint and the rotation center on the pointer meter is represented in
Figure 3.
3. Experiments and Analysis
Experiments were carried out to evaluate the effectiveness of the presented method.
Table 1 listed the primary devices in the experiment. In the actual measurement, a low-resolution camera was adopted to save costs. A short-focus lens was employed for minimizing the measured space to avoid the impact of object distance for measurement. In the experiment, the image of the pointer meter was 1292 × 964 pixels captured by a camera. A chessboard pattern with 30 × 30 corner points was applied for calibrating the intrinsic parameters of the camera (in the
Appendix A for the detail). A Backlight was typically used during the measurements to make sure high image quality.
To ensure identical parameters in the measurement, lens settings, illumination intensity and relative distance between the camera and the pointer meter should remain unchanged. Besides, two different sizes of pointer meters were used for measurement, as shown in
Figure 4. One of pointer meters with a radius of 622 mm was measured separately. Then other pointer meters with a radius of 406 mm were measured.
3.1. Measure One Pointer Meter
Under the same conditions, the three operators sequentially observed the same location of the pointer and recorded the readings of the pointer meter. Average value of the readings was used as the reference value for assessing the repeatability of the present method. Then, under keeping that the pointer location was the same with the operators observing, images of the pointer meter were taken from three different angles, as shown in
Figure 5, and reading of the pointer meter was measured by the present method and the conventional method [
25]. In
Appendix B, the images of the pointer meter taken from three different angles were given for all the location of the pointer in the measurement.
First, the radius
and
from the rotation center to the midpoint of long scales and short scales on the pointer meter were measured, that is
and
respectively. And angle between the zero scale and the maximum scale was measured, that was
. So, the world coordinates of the midpoints of short scales were obtained based on Equation (1). Second, the pixel coordinates of all the midpoints of scales and critical points (including rotation center and ends of pointer) were detected. After calibration the intrinsic parameters, the extrinsic parameters can be calibrated by the pixel coordinates and world coordinates of midpoints of short scales, as shown in
Figure 6a.
The extrinsic parameters were expressed as . And the world coordinates of midpoints on the short scales were transformed into the camera coordinates by the extrinsic parameters.
Second, normal vector
of the meter surface was calculated by the camera coordinates of three midpoints to obtain the rotation transformation matrix
of the meter image based on Equation (2). The meter image was rotated by the matrix
to make the meter image parallel to the surface of the meter, as shown in
Figure 7. Therefore, the coordinates of the critical point on the pointer meter can be corrected in this way, identifying the reading of the pointer meter by Equation (4). The coordinates of the endpoint of the pointer and rotation center in each pose were reported during the measurement in
Table 2 and
Table 3. After rotating the meter image, changes of the coordinates of the endpoints and rotation center were shown in
Table 2 and
Table 3.
Then, the readings of the pointer meter were compared with the reference value to calculate absolute errors, as shown in
Table 4 and
Table 5. Here,
was the reference value;
respectively represented the results of readings measured by conventional methods in the meter image taken from three angles;
respectively represented the results of readings measured by proposed methods in the meter image taken from the three angles which kept the same angle as conventional measurement.
The pointer meter used in the experiment was a 0 to 40 MPa pressure gauge with a precision of , and the pointer meter’s maximum allowable absolute error was . The range accuracy of the meter reached 2 digits after the decimal point. In order to make the accuracy of the meter recognition algorithm reach the accuracy of the meter range, this paper kept the effective digit to the next digit of the precision. The pixel coordinates of mid-point scales were achieved using the sub-pixel detection method to improve the measurement resolution. In the experiment, the image of the pointer meter was 1292 × 964 pixels captured by a camera. We estimated the arc length pixel by calculating the distance between center points of two adjacent scales, and the radius of the pointer meter region pixel can also be calculated. Then, the angle was converted from the arc length. And the angle occupied by each pixel was 0.15°. Therefore, the camera’s hardware resolution was 0.15° under this experimental condition which includes strength of illumination and the distance m between camera and measured meter plane.
As shown in
Table 6 and
Table 7, the absolute errors
of the measurement by proposed method were mostly between 1 kPa and 9 kPa. The maximum absolute error 9 kPa still did not exceed the absolute errors
of measurement by the conventional method. In addition, through the proposed method, the readings of the measured pointer meter in the images taken from three angles had almost no change compared with the reference values. It can be seen from the experimental results that the identification accuracy of the pointer meter calibration system was within the allowable range. Compared with the conventional measurement method, the maximum relative error was
, which met the measurement requirements.
3.2. Measure Two Pointer Meters
As with measuring one pointer meter, the three operators sequentially observed the same location of the pointer of the meter on the left in the image and recorded the readings under the same conditions. Average value of the readings of the meter on the left in the image was used as the reference value . And the three operators sequentially observed again the same location of the pointer of the meter on the right in the image and recorded the readings. Average value of the readings of the meter on the right in the image was used as the reference value . The reference values and were used for assessing the repeatability of the present method.
In order to verify that multiple pointer meters can be measured based on the proposed method, two pointer meters which had the same size and the same range were measured. The actual radius on the pointer meter from the rotation center to the midpoint of long scales and short scales was measured, that was 469 mm and 455 mm respectively. The angle between the zero scale line and the maximum scale line was measured, that was . Then, the world coordinates of the one of pointer meters’ short scales midpoints in were obtained based on Equation (1).
First, the pixel coordinates of all the midpoints of scales and critical points (including rotation center and ends of pointer) of the two pointer meters were detected. The translation distance D between the two pointer meters can be calculated using the distance between rotation centers of the two pointer meters, as shown in
Figure 8a. After calibration the intrinsic parameters, the extrinsic parameters can be calibrated by the pixel coordinates and world coordinates of midpoints of short scales of the meter on the left in the image, as shown in
Figure 6b. The extrinsic parameters were expressed as
. And the world coordinates of midpoints on the short scales of the meter on the left in the image were transformed into the camera coordinates by the extrinsic parameters.
Second, normal vector
of the meter surface was calculated by the camera coordinates of three midpoints to obtain the rotation transformation matrix
of the meter image based on Equation (2). The meter image was rotated by the matrix
to make the meter image parallel to the surface of the meter. Therefore, the pixel coordinates of the critical point (including the rotation center and the endpoint of the pointer) of the meter on the left in the image can be corrected in this way, identifying the readings of the meter on the left in the image by Equation (4). Through the translation distance D, the reading of the pointer meter on the right in the image can also be detected, as shown in
Figure 8b.
During the experiment, the positions of the two pointer meters were changed from zero scale line to maximum scale line, and there were 8 times of measurement in each group. Under keeping that the pointer location same with the operators observing, and reading of the pointer meter is measured by the present method and the conventional method respectively. The readings of the pointer meter were compared with the reference value to calculate absolute errors, as shown in
Table 8. Here, the
and
were the reference value of the meter on the left and the meter on the right in the image;
respectively represented the results of readings of two pointer meters measured by conventional methods;
respectively represented the results of readings of the two pointer meters measured by proposed methods.
As shown in
Table 9, the absolute errors
of the measurement by proposed method were mostly between 1 kPa and 16 kPa. The maximum error of 16 kPa still did not exceed the absolute errors
of measurement by the traditional method. Comparing with the reference value, the measured values had little change. It can be seen from the experimental results that the identification accuracy of the pointer meter calibration system is within the allowable range. Compared with the conventional measurement method, the maximum relative error is 0.064%, which meets the measurement requirements.
From the results of the experiment, there are still errors in the presented method of recognizing the readings of pointer meter. The main reason is uneven distribution of the scale lines in the pointer meter. The meter scales on the pointer meter are used as the calibration objects to obtain the extrinsic parameters of the meter plane. The error of the extrinsic parameters calibration is caused by the incomplete equal distance between the mid-points of two adjacent scales. In addition, the changes in light intensity and the distance between the camera and the meter plane would vary the quality of the image, which will also results in deviations in the extraction of pixel coordinates of t critical points in the image.