python如何识别中英文

1,343次阅读
没有评论

python如何识别中英文

python识别中英文的方法:

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

pip install pytesseract

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

python如何识别中英文

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

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

识别结果:

python如何识别中英文

原图:

python如何识别中英文

神龙|纯净稳定代理IP免费测试>>>>>>>>天启|企业级代理IP免费测试>>>>>>>>IPIPGO|全球住宅代理IP免费测试

相关文章:

版权声明:wuyou2021-06-16发表,共计254字。
新手QQ群:570568346,欢迎进群讨论 Python51学习