I'm trying to convert pictures like this: 7-segment into text with pytesseract:
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)
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.