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 pytesseractfrom PIL import Imageim = Image.open("demo.png")string = pytesseract.image_to_string(im, lang='langyp')print(string)