您的位置:首页 > 运维架构 > Linux

服务端 CentOS6.5 安装 tesseract3.05

2017-04-19 00:00 127 查看
目前应用场景需要用到图片文字识别,网上搜了一下,开源的库tesseract口碑不错,决定安装试试。

下面主要描述服务端 CentOS6.5 安装 tesseract3.05 版本。

1、先更新依赖

yum -y update
yum -y install libstdc++ autoconf automake libtool autoconf-archive pkg-config gcc gcc-c++ make libjpeg-devel libpng-devel libtiff-devel zlib-devel

#Install AutoConf-Archive
wget ftp://mirror.switch.ch/pool/4/mirror/epel/7/ppc64/a/autoconf-archive-2016.09.16-1.el7.noarch.rpm rpm -i autoconf-archive-2016.09.16-1.el7.noarch.rpm

2、下载并安装依赖程序leptonica

#Install Leptonica from Source
wget http://www.leptonica.com/source/leptonica-1.74.1.tar.gz tar -zxvf leptonica-1.74.1.tar.gz
cd leptonica-1.74.1
./autobuild
./configure
make
make install
cd ..

3、下载并安装tesseract3.05

wget https://github.com/tesseract-ocr/tesseract/archive/3.05.zip
unzip 3.05.zip

cd tesseract-3.05/

./autogen.sh
PKG_CONFIG_PATH=/usr/local/lib/pkgconfig LIBLEPT_HEADERSDIR=/usr/local/include ./configure --with-extra-includes=/usr/local/include --with-extra-libraries=/usr/local/lib
LDFLAGS="-L/usr/local/lib" CFLAGS="-I/usr/local/include" make
make install
ldconfig
cd ..

4、下载语言包并放置到目录 /usr/local/share/tessdata

cd /usr/local/share/tessdata

wget https://github.com/tesseract-ocr/tessdata/raw/3.04.00/chi_sim.traineddata
wget https://github.com/tesseract-ocr/tessdata/raw/3.04.00/eng.traineddata
5、可以上传一个小图片做测试了

参考:
http://stackoverflow.com/questions/23792373/installing-tesseract-ocr-on-centos-6 http://blog.csdn.net/diandianxiyu_geek/article/details/50522582
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: