sudo yum install autoconf automake
sudo yum install libjpeg-devel libpng-devel libtiff-devel zlib-devel
下载
wget http://www.leptonica.org/source/leptonica-1.78.0.tar.gz
解压
tar -zxvf?leptonica-1.78.0.tar.gz
安装
cd?leptonica-1.78.0
#执行配置指令
./configure
#执行编译指令
make
#执行安装指令
sudo make install
#至此,leptonica安装完毕
3.安装
下载
wget https://github.com/tesseract-ocr/tesseract/archive/3.04.00.tar.gz
解压
tar -zxvf 3.04.00.tar.gz
安装
cd tesseract-3.04.00
sudo ./autogen.sh
执行配置指令
./configure
执行编译指令
make
执行安装指令
sudo make install
cd tessdata
#下载安装英文,中文繁体,中文简体 识别库
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
vim /etc/profile
曾娇如下内容
#替换为你的安装路径下的tessdata绝对路径
export TESSDATA_PREFIX=/opt/tesseract-3.04.00/tessdata
生效
source /etc/profile
tesseract --version
识别英文测试
执行
tesseract phototest.tif result -l eng
目录下会多一个result.txt文件
识别中文测试
tesseract 1.jpeg result -l chi_sim
目录下会多一个result.txt文件
报错信息
Running libtoolize
./autogen.sh: line 65: libtoolize: command not found
./autogen.sh: line 65: glibtoolize: command not found
解决方案
yum -y install libtool