简体   繁体   中英

How can I configure tesseract for different font sizes in one line with Python?

I have a problem that I get only the number 2201 from my image. I have tried all configurations for pytesseract but no result. Maybe somebody here has a solution for me? When I cut the image into two pieces and run the OCR it works perfectly.

text = pytesseract.image_to_string(img, lang = 'deu', config='-psm 4')
print(text)

that was my configuration

Image being OCR'd

Problem is that it short text and it IS NOT on one (base)line. So you will need to split image to 2 part and OCR them separately.

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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM