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

6次阅读

共计 331 个字符,预计需要花费 1 分钟才能阅读完成。

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)

正文完
 0