Py学习  »  问与答

请教关于tesseract的问题

421096873 • 5 年前 • 516 次点击  

import pytesseract from PIL import Image pytesseract.pytesseract.tesseract_cmd = '/usr/local/bin/tesseract' image = Image.open('/data/22222.jpeg') vcode = pytesseract.image_to_string(image) print(vcode)

怎么会提示这个错误?

Traceback (most recent call last): File "/python_env/python_project/data/learn/learn10.py", line 7, in <module> vcode = pytesseract.image_to_string(image) File "/python_env/py3_env/lib/python3.5/site-packages/pytesseract/pytesseract.py", line 195, in image_to_string return run_and_get_output(image, 'txt', lang, config, nice) File "/python_env/py3_env/lib/python3.5/site-packages/pytesseract/pytesseract.py", line 141, in run_and_get_output run_tesseract(**kwargs) File "/python_env/py3_env/lib/python3.5/site-packages/pytesseract/pytesseract.py", line 118, in run_tesseract raise TesseractError(status_code, get_errors(error_string)) pytesseract.pytesseract.TesseractError: (1, 'Tesseract Open Source OCR Engine v3.05.02 with Leptonica Error in fopenReadStream: file not found Error in findFileFormat: image file not found Error during processing.')

Process finished with exit code 1

最后一次修改于 (2018-10-27 23:35)
Python社区是高质量的Python/Django开发社区
本文地址:http://www.python88.com/topic/25615
 
516 次点击