CentOS 6 或 Amazon Linux 编译安装Tesseract 4.1流程

旧版的系统,没办法直接yum安装,需要编译安装,编译起来挺麻烦的,所以整理了一下一把梭的流程,供后人参考:

如果下载相关文件太慢,或者无法下载,可以尝试人工下载:eng.traineddata,leptonica-1.78.0.tar.gz,tesseract-4.1.0.tar.gz。

wget http://www.leptonica.org/source/leptonica-1.78.0.tar.gz
wget https://github.com/tesseract-ocr/tesseract/archive/4.1.0.tar.gz
yum install automake libtool libtiff-devel libjpeg-devel libpng-devel -y

tar xzvf leptonica-1.78.0.tar.gz
cd leptonica-1.78.0
./configure
make && make install

export LD_LIBRARY_PATH=$LD_LIBRARY_PAYT:/usr/local/lib
export LIBLEPT_HEADERSDIR=/usr/local/include
export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig

tar xzf 4.1.0.tar.gz
cd tesseract-4.1.0
./autogen.sh
./configure
make && make install
ldconfig

cd /usr/local/share/tessdata/
wget https://raw.githubusercontent.com/tesseract-ocr/tessdata/4.00/eng.traineddata

export TESSDATA_PREFIX=/usr/local/include/tesseract
ln -s /usr/local/bin/tesseract /usr/bin/tesseract
tesseract -v

 

未经允许不得转载:阿藏博客 » CentOS 6 或 Amazon Linux 编译安装Tesseract 4.1流程