1

I'm trying to convert pictures like this: 7-segment into text with pytesseract:

7-segment

I tried different PSM modes and a whitelist with only 0123456789, but the best output of pytesseract was '5' instead of '125'.

Is there a way to configure pytesseract in way that it can convert my pictures? Or are there any extensions?

Thank you.

import pytesseract
from PIL import Image, ImageTk

img = Image.open('test.png')

text = pytesseract.image_to_string(img, config=("-c tessedit_char_whitelist=0123456789 --psm 7"))

print(text)
mozway
  • 194,879
  • 13
  • 39
  • 75
plexx1337
  • 11
  • 1

2 Answers2

0
  1. Read and follow docs
  2. Use letsgodigital as ocr "language"
user898678
  • 2,994
  • 2
  • 18
  • 17
0
  1. here it is a better trained models
  2. copy any of model or all inside your tesseract folder C:\Program Files\Tesseract-OCR\tessdata
  3. configurate tesseract to use model -l ssd, txt = pytesseract.image_to_string(img, config="-l ssd")
extragen
  • 153
  • 1
  • 7