Я хочу прочитать текст с изображения и использую pytesseract в Python. Когда я запускаю код:
`
# Recognize the text as string in image using pytesserct
text.append(str(pytesseract.image_to_string(Image.open(imagefilename), encoding='utf-8', errors="Error")))
#Finally, write the processed text to the file.
f.write(" ".join(text))
# Close the file after writing all the text.
f.close()
break`
, это ошибка:
File "/home/doc/desktop/lettura_pdf.py", line 87, in <module>
text.append(str(pytesseract.image_to_string(Image.open(imagefilename), encoding='utf-8', errors="Error")))
TypeError: image_to_string() got an unexpected keyword argument 'encoding'