Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/python-3.x/15.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 从图像中提取文本。光学字符识别_Python_Python 3.x - Fatal编程技术网

Python 从图像中提取文本。光学字符识别

Python 从图像中提取文本。光学字符识别,python,python-3.x,Python,Python 3.x,我用的是Pytesseract,当我用英语的时候,它是有效的,但当我转换成俄语的时候。我有这样的问题: “TypeError:'str'不支持缓冲区接口”。我试过了 其他语言也不起作用 这是我的密码: 有人能帮我解决这个问题吗?您需要为特定语言的Tesseract培训数据 您需要在系统中复制语言支持文件 作为参考,您可以访问以下站点:-请将所需语言的培训数据文件(rus.traineddata)放入tesseract安装的TesserData文件夹中。谢谢您的帮助) from PIL impor

我用的是Pytesseract,当我用英语的时候,它是有效的,但当我转换成俄语的时候。我有这样的问题:

“TypeError:'str'不支持缓冲区接口”。我试过了 其他语言也不起作用

这是我的密码:
有人能帮我解决这个问题吗?

您需要为特定语言的Tesseract培训数据 您需要在系统中复制语言支持文件
作为参考,您可以访问以下站点:-

请将所需语言的培训数据文件(rus.traineddata)放入tesseract安装的TesserData文件夹中。

谢谢您的帮助)
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"))