self_example/Spider/Chapter08_验证码的识别/OCR技术识别图形验证码/demo1识别测试.py

16 lines
242 B
Python
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#-*- encoding:utf-8 -*-
'''
@Author : dingjiawen
@Date : 2023/12/11 19:31
@Usage :
@Desc :
'''
import tesserocr
from PIL import Image
image = Image.open('image.png')
result = tesserocr.image_to_text(image)
print(result) # 打印19 b 2