It’s been awhile since I last worked on this project, because I’ve been on a holiday. During my holiday i’ve also spent some time on the software and I’ve managed to get a 89% recognition score on my small set of images (10-fold cross-validation).
Still, almost 90% is not nearly enough for what I want. Using previous values and time elapsed since the last sample, we can guess what the current value should be, but this only works well for the most significant digits because the least significant digit is about the only digit we can not guess; I want samples every 6 hours and in this time the least significant digit can increase between 1 and 5, so there are 5 out of 10 possible solutions. We need something better.
Studying the results of the last version, it seems that preprocessing could be a lot better. The histogram shows only about the lower third is used. Also, looking at an image, a small portion of the image is actually used by digits. So, a different setup of the camera, and better lighting is needed.
Before I’ve tried to place the webcam without a mirror, that didn’t work very well because the lighting was difficult, I always seemed to have reflections in the glass plate that distorted the image. Now I the webcam is fixed upside down, a little below the actual meter values so it has to look up. The LEDs light the meter values also from below at a much larger angle so reflections are not seen in the webcam. The setup is shown in the picture on the right.
The picture on the left shows an image from the webcam. A larger portion of the image is represented by digits and the histogram shows that a larger portion of the color space is used. Because the lights are placed closer to the meter values, the contrast seems to be increased as well.
Because of the new setup, the code has to be changed a little bit, the vertical density histogram needs more smoothing (because there is now too much detail ;)), and some thresholds should have different settings. Other than that, the code works pretty much like before. Running the recognizer (trained with old images) results in the correct meter value, so that looks good :) I will now collect more images of the new setup over the next couple of days, so I can train on that instead. Because the digits are larger, more different features can be used and the digits can be extracted better (noise is less obtrusive) so I have high hopes for the new images. To be continued…