Centos7 tesseract 安装

Centos7 tesseract 安装

正规网址

  1. 升级下基础包
1
2
3
4
sudo yum update
yum -y install automake
yum -y install libtool
yum install libpng-devel
  1. 这个过程最好用root安装,或者使用sudo命令
1
2
3
4
5
6
wget http://www.leptonica.org/source/leptonica-1.79.0.tar.gz
tar xzvf leptonica-1.79.0.tar.gz
cd leptonica-1.73
./configure
make
make install
  1. 安装tesseract
1
2
3
4
5
6
7
8
9
wget https://github.com/tesseract-ocr/tesseract/archive/3.04.01.tar.gz
mv 3.04.01.tar.gz tesseract-3.04.01.tar.gz
tar xzvf tesseract-3.04.01.tar.gz
cd tesseract-3.04.01/
./autogen.sh
./configure
make
make install
ldconfig
  1. 安装模型文件
1
2
3
4
5
6
7
8
wget https://sourceforge.net/projects/tesseract-ocr-alt/files/tesseract-ocr-3.02.eng.tar.gz
wget https://sourceforge.net/projects/tesseract-ocr-alt/files/tesseract-ocr-3.02.nld.tar.gz
wget https://sourceforge.net/projects/tesseract-ocr-alt/files/tesseract-ocr-3.02.deu.tar.gz
tar xzvf tesseract-ocr-3.02.eng.tar.gz
tar xzvf tesseract-ocr-3.02.nld.tar.gz
tar xzvf tesseract-ocr-3.02.deu.tar.gz

echo export TESSDATA_PREFIX=/usr/share/tesseract-ocr/tessdata >> .bashrc
  1. 安装ghostpdl
1
2
3
4
5
6
7
wget https://github.com/ArtifexSoftware/ghostpdl-downloads/releases/download/gs920/ghostscript-9.20.tar.gz
tar xzvf ghostscript-9.20.tar.gz
cd ghostscript-9.20/
./autogen.sh
./configure
make
make install