others linux服务器运维 django3 监控 k8s golang 数据库 大数据 前端 devops 理论基础 java oracle 运维日志

python 识别图片文字

访问量:1301 创建时间:2021-05-12
yum search tesseract
yum install tesseract.x86_64 -y
pip3 install pytesseract
pip3 install Pillow
yum install -y libpng12-devel.x86_64 - libtiff-devel.x86_64  zlib-devel.x86_64

识别图片文字

[root@oracledb ~]# cat bbb.py 
import pytesseract
from PIL import Image
im = Image.open('111.png')
# 识别文字
string = pytesseract.image_to_string(im)
print(string)
[root@oracledb ~]# python3 bbb.py 
Do not go gentle into that good night!
登陆评论: 使用GITHUB登陆