关于python3.x:pythontesseract-实现文字识别

Tesseract装置

参考上一篇文章https://segmentfault.com/a/11…

pytesseract装置

sudo pip3 install pytesseract

下载中文训练包
https://github.com/tesseract-…
将下载的训练包chi-sim.trainedata放入到tessdata下,其中源码装置的地位在:

cd /usr/local/share/tessdata

示例

import pytesseract
from PIL import Image

im = Image.open("demo.png")
string = pytesseract.image_to_string(im, lang='langyp')
print(string)

评论

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注

这个站点使用 Akismet 来减少垃圾评论。了解你的评论数据如何被处理