我正在尝试使用tesseract-OCR从图像中打印文本。但我收到上述错误。我已使用pip install pytesseract在anaconda提示符中使用https://github.com/UB-Mannheim/tesseract/wiki和pytesseract 安装了tesseract OCR,但它不起作用。如果有人遇到过类似问题,请提供帮助。
(基本)C:\ Users \ 500066016> pip install pytesseract收集pytesseract下载https://files.pythonhosted.org/packages/13/56/befaafbabb36c03e4fdbb3fea854e0aea294039308a93daf6876bf7a8d6b/pytesseractz 0.2.4(?169)。 ?????????????????????????????????? | 174kB 288kB / s已满足要求:存放在c:\ users \ 500066016 \ appdata \ local \ continuum \ anaconda3 \ lib \ site-packages中(来自pytesseract)(5.1.0)组装收集包的轮子:pytesseract正在运行setup.py pytesseract的bdist_wheel ...完成存储在目录中:C:\ Users \ 500066016 \ AppData \ Local \ pip \ Cache \ wheels \ a8 \ 0c \ 00 \ 32e4957a46128bea34fda60b8b01a8755986415cbab3ed8e38成功构建pytesseract
下面是代码:
import pytesseract
import cv2
import numpy as np
def get_string(img_path):
img = cv2.imread(img_path)
img = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
kernel = …Run Code Online (Sandbox Code Playgroud)