Detecting which digital number an image represents I photograph the dashboard of my car every day to register the mileage for work.
I use OpenCv to detect the region of the digital displayed mileage, crop to the numbers and match them. The method I use now to determine what numbers are displayed is working for (lets say) 95% of the cases. Finding the numbers is working fine (resize, rotate, correct perspective). Matching the numbers I find still a bit tricky.

The method I use now is determining the center location of each part/stripe that makes up the digit and match the difference of the center to predefined values. To find the center I use blob detection of open cv.



is then converted to a binary image



and blob detection is used to find the center of each blob (marked with red)



The center location of each blob is compared (squared distance) to the center location of a predefined set of locations. And the least square distance is related to what stripe of the digit it is. Then the combination of the stripes found is compared to a dictionary containing the stripe locations for each digit. 

The problem I have now is that, although the images are normalized, sometimes more blobs are detected because the the threshold for making the binary image leave out pixels unexpectedly in the center of a blob. And blob detection sees that are separate blobs.

Is there a better approach to determine what digit it is using the particular display of the digits shown above? 'Better' would be: more robust, simpelere, less logic/code required, more universal applicable. I don't want to pull in a whole OCR library for this, if possible.
A simple count of the pixels where the binary color is matching between the image to be recognized and the images of the ten reference digits might be good enough.

For best results, it is advisable to create the reference images using exactly the same method as that for the target image.

If it turns out that binarization doesn't work repeatably enough, you can switch to finer comparison metrics such as Sum of Absolute Differences, Sum of Squared Differences or Normalized Grayscale Correlation.