正在从事 OCR 工作。我可以导入 pytesseract 并使用 image_to_string 但我想解决这个问题:
api = tesseract.TessBaseAPI()
api.SetVariable("tessedit_char_whitelist", "0123456789")
api.Init('.','eng',tesseract.OEM_DEFAULT)
api.SetPageSegMode(tesseract.PSM_AUTO)
这是为了将 tesseract 设置为仅检测数字或字母。
当我运行我的代码时,我收到此错误:
ImportError: No module named tesseract
我安装了 tesseract-ocr,还有 pytesseract。但我不断收到此错误。
我在尝试在 Pycharm 中运行 pytesseract 时遇到了这个问题。确保您有 Tesseract 文件夹的环境路径 var。这样程序就知道使用安装位置的 tesseract.exe。
这就是我的路径:
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)