想打印png格式的验证码图片可是报错系统找不到指定文件;
更加打印不出来图片的文字;
存放图片的位置如图:
png图片为:
报错如图:
代码如下:
import pytesseract
from PIL import Image
image = Image.open(r'D:\image\image.png')
vcode = pytesseract.image_to_string(image)
print(vcode)
怪我咯2017-04-18 09:58:56
You probably haven’t installed Tesseract Ocr (To install the pytesseract library, you must first install the PIL and tesseract-ocr it depends on. PIL is an image processing library, and the latter tesseract-ocr is Google’s ocr recognition engine.)
Yes Refer to http://www.tuicool.com/articl...
I tried it, and the verification code with the difficulty as shown in the picture (very close and difficult to separate...blurred...) cannot be solved with these few lines of code (the recognition result is ". .").
This is what can be done
As for the picture below , if it’s not for learning image processing, don’t do it.
PHP中文网2017-04-18 09:58:56
This is not a verification code issue. This is a Windows problem.
Your system and tesseract should be 64-bit, while Python is 32-bit.