pytesser在python中不起作用

2024-05-06 23:11:44 发布

您现在位置:Python中文网/ 问答频道 /正文

我只使用PIL,然后它就正常工作了,当我使用pytesser时,它就不能正常工作了。我能为它做些什么呢?在

from PIL import Image
from pytesser import *

image_file = Image.open("vote.jpg")
im = Image.open(image_file)
text = image_to_string(im)
print text

Traceback (most recent call last):
  File "C:/Users/Tanvir/Desktop/py thon hand/hala.py", line 4, in <module>
    image_file = Image.open("vote.jpg")
  File "C:\Pythons27\lib\site-packages\PIL\Image.py", line 2286, in open
    % (filename if filename else fp))
IOError: cannot identify image file 'vote.jpg'

Tags: textfrompyimageimportpillineopen