# Computer Vision Measurement of Pointer Meter Readings Based on Inverse Perspective Mapping
## 2 Measurement Principle
### 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 \(p_{1}(x_{1},y_{1})\) to maximum-scale line \(p_{M}(x_{M},y_{M})\).  
After detecting all the midpoints of the short scales, one circle is fitted to these points, and the coordinate of the rotation center \(c(x_{c},y_{c})\) 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 \(e(x_{c},y_{c})\) 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):  
\[\begin{array}{l}angle(\alpha)=\arctan\frac{y_{1}-y_{c}}{x_{1}-x_{c}}-\arctan \frac{y_{c}-y_{M}}{x_{c}-x_{M}}\\ angle(\beta)=\arctan\frac{y_{c}-y_{c}}{x_{c}-x_{c}}-\arctan\frac{y_{c}-y_{M}}{ x_{c}-x_{1}}\\ value=\frac{angel(\beta)\times osculative(N)}{angel(\alpha)}\end{array} \tag{4}\]  
Here, \(\alpha\) 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 \(\alpha\) 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 \(\alpha\) 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. \(\beta\) was the angle between the detected pointer and zero scale line. N is the scale value which is measured between zero scale line \(p_{1}(x_{1},y_{1})\) and maximum scale line \(p_{M}(x_{M},y_{M})\). The final detection result of pointer's endpoint and the rotation center on the pointer meter is represented in Figure 3.