[英]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.我有一个问题,我从我的图像中只得到了数字 2201。 I have tried all configurations for pytesseract but no result.
我已经尝试了 pytesseract 的所有配置,但没有结果。 Maybe somebody here has a solution for me?
也许这里有人对我有解决方案? When I cut the image into two pieces and run the OCR it works perfectly.
当我将图像切成两块并运行 OCR 时,它可以完美运行。
text = pytesseract.image_to_string(img, lang = 'deu', config='-psm 4')
print(text)
that was my configuration那是我的配置
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.
因此,您需要将图像拆分为 2 部分并分别对它们进行 OCR。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.