验证码识别
2024-03-29 本文已影响0人
rookieyu
1、pip install pillow
2、安装tesseract-ocr
-
配置环境变量
3、书写代码
pip install pytesseract==0.1.8
from pytesseract import image_to_string
from PIL import Image
img = Image.open(r"GetValidateCode.jpg")
# print(img)
print(image_to_string(img))
报错:
![](https://img.haomeiwen.com/i15247579/ae5db77411c9b570.png)
![](https://img.haomeiwen.com/i15247579/afdef373735fb399.png)
![](https://img.haomeiwen.com/i15247579/a1012e43e3fe40d8.png)