1、安装编译环境
yum install gcc gcc-c++ make
yum groupinstall "Development Tools"
yum install autoconf automake libtool
yum install libjpeg-devel libpng-devel libtiff-devel zlib-devel
2、下载编译依赖库
3.04版本
wget http://www.leptonica.com/source/leptonica-1.72.tar.gz
tar -xvf leptonica-1.72.tar.gz
cd leptonica-1.72
./configure && make && make install
3.01的
tar -xvf leptonica-1.68.tar.gz
cd leptonica-1.68
./configure && make && make install
3、下载编译 tesseract-ocr (注意这里下载下来的包要放在leptonica-1.72 下,否则编译的时候会出问题)
3.04版本
wget https://github.com/tesseract-ocr/tesseract/archive/3.04.00.tar.gz
mv 3.04.00 Tesseract3.04.00.tar.gz
tar -xvf Tesseract3.04.00.tar.gz
cd tesseract-3.04.00/
./autogen.sh
./configure
make && make install
3.01版本
tar -xvf Tesseract-3.01.tar.gz
cd tesseract-3.01/
./autogen.sh
./configure
make && make install
4、下载识别字体的字体文件
3.04版本
wget --no-check-certificate https://github.com/tesseract-ocr/tessdata/raw/master/eng.traineddata
wget --no-check-certificate https://github.com/tesseract-ocr/tessdata/raw/master/chi_sim.traineddata
wget --no-check-certificate https://github.com/tesseract-ocr/tessdata/raw/master/chi_tra.traineddata
3.01版本
<自行到网络下载...>
5、将tesseract-ocr的字体文件拷贝到/usr/local/share/tessdata/下
cp *.traineddata /usr/local/share/tessdata/
6、配置字体文件的环境变量 vi /etc/profile (编译完成后需要source/etc/profile )
export TESSDATA_PREFIX=/usr/local/share/
7、拷贝.so文件
cp /usr/local/lib/*.so.* /usr/lib64/
搞定 !