【tesseract】Linux环境安装tesseract教程(二)

使用Python进行图片识别

1、安装Python3第三方模块pytesseract,Pillow,packaging

使用命令:pip3 install pytesseract
安装完后,我们可以直接输入命令:tesseract

2、使用Python进行文字识别

import pytesseract
from PIL import Image
img=Image.open('test.png')
code=pytesseract.image_to_string(img,lang='chi_sim+eng')
print(code)

保存退出,运行文件
在这里插入图片描述
即可正常输出识别的文字

猜你喜欢

转载自blog.csdn.net/zhuan_long/article/details/126153914