## 2 Methodological Approach
### Pointer Detection  
In order to extract the pointer information, the gauge image often needs to be binarized. Experiments were performed by binarizing some dataset images with challenging conditions such as gauges with reflections and shadows in the dial, and even with a multi-color dial. One global and one local threshold method were performed, the Otsu method and the adaptive threshold method, respectively. These tests were performed after the images were transformed to grayscale and a median filter was applied. As shown in Figure 9, the Otsu method lost a lot of critical information about the image and was affected by uneven lighting and colors in the dial; on the contrary, the adaptive threshold was able to binarize the image the best in all analyzed situations. Therefore, the method applied was the adaptive threshold, even with the disadvantage of being more computationally expensive.  
To compare the performance, three commonly used methods to detect pointers were applied. The first method was the region growing algorithm to segment the pointer; this method can be used before thinning and/or line fitting to determine the pointer direction. To test this method, the seed point was set as the center of the gauge. As shown in Figure 10, the algorithm applied was unreliable with a light color center gauge and uneven lighting, which makes the region expand beyond the pointer if its contrast is low compared to the dial's background.  
Figure 8: Binarization of the RoI and the inverted colors RoI.  
Figure 7: Tell-tale pointer segmentation. (**a**) original image, (**b**) tell-tale pointer segmented.  
Figure 10: Application of the region growing. (**a**) Original image, (**b**) region growing segmentation.  
Figure 9: Application of different Binarization techniques. (**a**) Original image, (**b**) Otsu method, (**c**) adaptive threshold.  
An alternative is the line Hough transform, which takes advantage of the linear edges of the gauge pointer. First, some dataset images were binarized to apply the Canny edge detector, and then the line Hough transform was performed. The results, as shown in Figure 11, indicate that the edge detection is influenced by shadows and uneven lighting, and it has difficulty distinguishing the pointer lines and other lines, such as the ones from characters and scale lines.  
The third test was based on the characteristic that the pointer has an elongated tip going out from the gauge center. Therefore, a pixel projection was performed after the polar transformation of the binarized image. This method showed to be less affected under bad lighting but was still affected by interference in the dial, such as characters, scale marks, and even chromed bezels. This problem was minimized by removing some interference with image cropping by removing 10 % of the outer and inner circles. The angle of the maximum white pixels projection was defined to be the angle of the pointer. Some results of this method are shown in Figure 12.  
After analyzing the methods tested, pixel projection achieved the best performance; therefore, this method was the one implemented after the adaptive threshold binarization, as illustrated in Figure 13. Moreover, this method was also applied to the tell-tale pointers using its segmented region, as represented in Figure 14. In order to have a more robust algorithm, a value that indicates the certainty of the pointer detection was developed, which indicates the percentage of the image height that the maximum projection occupies; this is especially important for gauges with a tell-tale pointer because they can cover the main pointer, making it impossible to read the gauge. A threshold of 70% for the certainty value was applied to detect the pointer, so only pointers above this value were considered correctly detected.  
Figure 11: Application of the Hough line transform. (**a**) Original image, (**b**) Canny edge detection, (**c**) Hough line transform.