抓取图片上面的中文文字

from PIL import Image
import pytesseract

# 上面都是导包,只需要下面这一行就能实现图片文字识别
text = pytesseract.image_to_string(Image.open('640.jpg'), lang='chi_sim')
print(text)

需要安装tesseract_ocr的时候没报错,但是在安装语言的时候报错了,需要配置环境变量

猜你喜欢

转载自blog.csdn.net/xiaoxiamimm/article/details/112462671