image_to_string()导致WindowsError

时间:2015-11-17 16:42:10

标签: python python-2.7 runtime-error ocr pytesser

当我尝试在图像上执行ocr以使用Pytesseract获取字符串时:

import pytesseract
import Image

im = Image.open(str('C:\\1host.jpg'))

im.load()

print pytesseract.image_to_string(im)

发生以下错误:

D:\Python27\python.exe C:/Users/user/PycharmProjects/untitled/Pytessercast.py
Traceback (most recent call last):  
  File "C:/Users/user/PycharmProjects/untitled/Pytessercast.py", line 7, in <module>  
    print pytesseract.image_to_string(im)
  File "build\bdist.win32\egg\pytesseract\pytesseract.py", line 161, in image_to_string
  File "build\bdist.win32\egg\pytesseract\pytesseract.py", line 94, in run_tesseract
  File "D:\Python27\lib\subprocess.py", line 710, in __init__
    errread, errwrite)
  File "D:\Python27\lib\subprocess.py", line 958, in _execute_child
    startupinfo)
WindowsError: [Error 2] 

0 个答案:

没有答案