2017-03-03 59 views
2

我正在使用Pytesseract,当我使用英语时它正在工作,但是当我开始使用俄语时。我有这样的问题:从图像中提取文本。 OCR

"TypeError: 'str' does not support the buffer interface". I've tried other language it also doesn't work.

这是我的代码:

from PIL import Image 
from pytesseract import image_to_string 
k=image_to_string(Image.open("ff.jpg"), lang="rus") 
print(image_to_string(Image.open("picture.jpg"), lang="rus")) 

有人可以帮我解决这个问题呢?

回答

1

你需要为正方体特定语言培训数据 你需要复制的语言支持的文件系统中的 仅供参考,您可以访问该网站: - https://github.com/tesseract-ocr/langdata

+0

感谢您的帮助) –

0

请把训练数据文件(rus.traineddata )在tesseract安装的tessdata文件夹中输入所需语言。