马上注册,结交更多好友,享用更多功能^_^
您需要 登录 才可以下载或查看,没有账号?立即注册
x
import tesserocr
from PIL import Image
image=Image.open('code.jpg')
result=tesserocr.file_to_text(image)
print(result)
Traceback (most recent call last):
File "C:/Users/50519/PycharmProjects/untitled/test.py", line 5, in <module>
result=tesserocr.file_to_text(image)
File "tesserocr.pyx", line 2471, in tesserocr._tesserocr.file_to_text
File "tesserocr.pyx", line 43, in tesserocr._tesserocr._b
TypeError: Expected bytes, got JpegImageFile
Process finished with exit code 1
验证码地址:http://my.cnki.net/elibregister/CheckCode.aspx
这是什么问题,怎么解决?
|