0

I want to use an OCR program on an RPi to recognise the digits from a photo of my electricity meter. The digits are large and are very obvious to me, but Tesseract appears unable to recognise them at all - at best it detects a few random wrong digits.

I have tried cropping the numbers and OCRing them individually, but it doesn't help. I have tried a few other OCR programs and they were no better.

Please can you give any suggestions to how I can get Tesseract to correctly identify the 2 large numbers in the picture below? Note that this the original picture is ~2.5MB - this copy is smaller to fit this site.

Picture of electricity meter

David Foerster
  • 36,890
  • 56
  • 97
  • 151

2 Answers2

1

Very small numbers are easier to read when they are illuminated by a strong light source. Some hardware devices such as flash drives and power adapters have very small writing printed on the plastic case that is very difficult to read in soft light but easy to read when the device is illuminated by a strong light source.

If that doesn't do the trick you can open the image to be scanned in GIMP Image Editor and enhance the brightness and contrast before OCRing it. GIMP Image Editor is available in the default Ubuntu repositories.

  1. Select a rectangular area of the image which contains the numbers to be scanned using the Rectangle Select Tool which is located in the top left corner of the Toolbox.

  2. From the GIMP menu select Colors -> Brightness-Contrast.

  3. Move the Brightness and Contrast sliders to improve the readability of the numbers.

  4. Make sure that the Foreground color which is located at the bottom center of the Toolbox is black, which is the default color.

  5. Use the Bucket Fill Tool to fill the background of the numbers with black color, so that the light colored numbers will show up with higher contrast against a black background.

  6. Select another rectangular area of the image which contains numbers to be scanned if necessary and repeat steps 2-5.

  7. Export your image when you are finished editing it using either File -> Overwrite or File -> Export As…

karel
  • 122,292
  • 133
  • 301
  • 332
0

I am essentially trying the same with my gas metre ;-). What did the trick for me was:

  • invert (so you have black on white numbers)
  • scale down so the numbers are about 30 pixels high
  • increase contrast

Apparently tesseract does not expect text to have a large font size.

htaccess
  • 1,528
Frank
  • 1