使用语言模式时出现Pytesseract错误

时间:2018-04-09 13:59:08

标签: python tesseract python-tesseract

import pytesseract
from PIL import Image

pytesseract.pytesseract.tesseract_cmd = 'C:/Program Files (x86)/Tesseract- 
OCR/tesseract'
result = pytesseract.image_to_string(Image.open('Sanskrit.png'), lang="san")
print(result)


with open('magic.txt', mode='w') as file:
   file.write(result)
   print('see > the output file')

这是我尝试执行的上述代码。当我使用lan =“eng”时,此代码很有效,但似乎不适用于任何其他语言。我已经下载了所有语言的tessdata文件,我使用的是Tesseract-OCR 4.00dev版本的引擎。

对此有任何帮助将不胜感激。感谢。

0 个答案:

没有答案