centos安装Tesseract

时间:2023-03-09 08:00:20
centos安装Tesseract

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

  

#使用测试

图片

centos安装Tesseract

[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