品易云推流 关闭
文章详情页
文章 > Python基础教程 > python如何识别中英文

python如何识别中英文

头像

尤及

2020-06-10 09:23:314480浏览 · 0收藏 · 0评论

python识别中英文的方法:

1、使用“pip install pytesseract”命令行命令下载安装ocr库

pip install pytesseract

2、下载ocr语言模型,放到ocr库所在文件下

微信截图_20200610091943.jpg

3、编写翻译语句,将图片中的中文识别出来

from PIL import Image
import pytesseract
resDict = pytesseract.image_to_boxes(Image.open('images/example3.png'),)
print(resDict)

识别结果:

微信截图_20200610092005.jpg

原图:

微信截图_20200610092016.jpg

更多Python知识,请关注:Python自学网!!

关注

关注公众号,随时随地在线学习

本教程部分素材来源于网络,版权问题联系站长!

底部广告图