【发布时间】:2021-09-23 18:44:28
【问题描述】:
所以我是编程的初学者。我正在尝试将 jpeg 文件转换为 atext 文件但无法这样做。我收到错误
try:
from PIL import Image
except ImportError:
import Image
import pytesseract
print(pytesseract.image_to_string(Image.open('A_1.jpg')))
我浏览了文档,找到了错误的原因和解决方法:
'If you don't have tesseract executable in your PATH, include the following:
pytesseract.pytesseract.tesseract_cmd = r'<full_path_to_your_tesseract_executable>'
# Example tesseract_cmd = r'C:\Program Files (x86)\Tesseract-OCR\tesseract'
所以根据文档,我应该包含已安装的可执行文件的完整路径,但我不知道如何获取路径,我正在使用 linux 并且是 linux 新手。请您帮忙
【问题讨论】:
标签: image-processing tesseract data-conversion