yum安装(推荐)
yum search tesseract
yum install tesseract.x86_64 -y
pip3 install pytesseract
pip3 install Pillow
yum install -y libpng12-devel.x86_64 - libtiff-devel.x86_64 zlib-devel.x86_64
#使用测试
图片
[root@localhostreuest]#tesseract 1.png out
Tesseract Open Source OCR Engine v3.04.00 with Leptonica
[root@localhostreuest]#cat out.txt
2765
编译安装
#下载包
wget https://github.com/tesseract-ocr/tesseract/archive/4.0.0.tar.gz
wget http://www.leptonica.org/source/leptonica-1.77.0.tar.gz #解压安装leptoinica
tar xf leptonica-1.77.0.tar.gz
cd leptonica-1.77.0
./configure
make && make install
yum install automake libtool -y #安装tesseract
cd tesseract-4.0.0/
./autogen.sh
./configure
./configure --with-extra-includes=/usr/local/include --with-extra-libraries=/usr/local/include #pip3安装 Pillow pytesseract