Python使用pytesseract识别简单图像中的数字

时间:2019-12-23 07:58:53

标签: python ocr tesseract python-tesseract

我正在尝试使用pytesseract从图像中识别数字,如下所示:

img

我尝试了以下代码

text=pytesseract.image_to_string(img, lang='eng',
                config='--psm 13 --oem 3 -c tessedit_char_whitelist=0123456789')
print(text)

它给了我

  

“ ae”

我尝试了oem = 1,而且还是一样。

供参考,我的版本如下:

pytesseract.get_tesseract_version()
  

LooseVersion('4.0.0-beta.1')

任何帮助将不胜感激,包括其他库。

1 个答案:

答案 0 :(得分:1)

这是一个已知问题-Blacklist and whitelist unsupported with LSTM (4.0)

基本上白名单和黑名单不起作用

一个评论状态

  

ghost于2018年7月20日发表评论

     

使用--oem 0或-oem 0即可使用

我无法测试此ATM,但值得尝试

4.1版本应对此进行修复

相关问题