【发布时间】:2023-01-31 00:56:40
【问题描述】:
我正在尝试用 python 制作一个程序,该程序能够使用 OCR 分析一些游戏事件的统计数据,并对玩家/团队的表现进行总结。我真的是 Python 的新手,我之前安装了多个 Python (2 - 3),因为我几年前就尝试过了。所以我卸载了所有东西并重新安装了最新的 Python 3 到默认/推荐的安装 (AppData) 路径。
def ocr_core(img):
text = pytesseract.image_to_string(img)
return text
错误:
Exception has occurred: PermissionError
[WinError 5] Access is denied
File "G:\PythonProjects\NewWorldWarStats.py", line 7, in ocr_core
text = pytesseract.image_to_string(img)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "G:\PythonProjects\NewWorldWarStats.py", line 25, in <module>
print(ocr_core(img))
^^^^^^^^^^^^^
PermissionError: [WinError 5] Access is denied
我正在尝试使用 pytesseract(与其他 OCR 库相同的权限错误)和 cv2 来完成任务,但无论我是否编辑该文件夹的权限,以管理员身份运行 Visual Studio Core,它都会给我权限错误。我还尝试在其他驱动器上运行该项目,但还没有任何效果。有任何想法吗?
【问题讨论】:
-
你有样本 img 吗?
标签: python ocr python-tesseract