码迷,mamicode.com
首页 > 其他好文 > 详细

tesseract的编译安装

时间:2017-07-21 20:42:32      阅读:282      评论:0      收藏:0      [点我收藏+]

标签:tom   img   top   cal   alt   ros   word   tool   bre   

技术分享 

须要安装:


apt-get install autoconf
apt-get install automake
apt-get install libtool

-------------------------------------------------------------------------------------------------------------------------------------

安装过程,參考下面

安装依赖包

sudo apt-get install autoconf automake libtool
sudo apt-get install libpng12-dev
sudo apt-get install libjpeg62-dev
sudo apt-get install libtiff4-dev
sudo apt-get install zlib1g-dev
sudo apt-get install libicu-dev      # (if you plan to make the training tools)
sudo apt-get install libpango1.0-dev # (if you plan to make the training tools)
sudo apt-get install libcairo2-dev   # (if you plan to make the training tools)
--------------------------------------------------------------------------

安装leptonica

tesseract依赖于leptonica,所以首先要下载安装leptonica

第一步:tar zxvf leptonica-1.73.tar.gz

第二步:cd leptonica-1.73

第三步:./configure --prefix=/usr/local/leptonica

第四步:make

第五步:make install

安装完毕之后,配置环境变量,

gedit /etc/bash.bashrc

在文件末尾,加入环境变量的配置

PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/usr/local/leptonica/lib/pkgconfig
export PKG_CONFIG_PATH
CPLUS_INCLUDE_PATH=$CPLUS_INCLUDE_PATH:/usr/local/leptonica/
export CPLUS_INCLUDE_PATH
C_INCLUDE_PATH=$C_INCLUDE_PATH:/usr/local/leptonica/include/leptonica
export C_INCLUDE_PATH
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/leptonica/lib
export LD_LIBRARY_PATH
LIBRARY_PATH=$LIBRARY_PATH:/usr/local/leptonica/lib
export LIBRARY_PATH

source /etc/bash.bashrc

gedit /etc/ld.so.conf

在文件末尾。加入

/usr/local/leptonica/lib

source /etc/ld.so.conf

----------------------------------------------------------------------------------------------------------------------------

下载tesseract.

第一步:unzip tesseract

第二步:cd tesseract

第三步:./autogen.sh   假设不报错

第四步:LIBLEPT_HEADERSDIR=/usr/local/leptonica/include/leptonica ./configure --prefix=/usr/local/tesseract --with-extra-libraries=/usr/local/leptonica/lib   【注意:tesseract依赖于leptonica

第五步:make

第六步:make install

第七步:make training

第八步: sudo make training-install  【注意:是training-install,不是 training install】

安装完后

技术分享


加入环境变量PATH,否则,须要每次到安装路径执行。

第九步:gedit /etc/bash.bashrc,末尾加入

PATH=$PATH:/usr/local/tesseract/bin

export PATH

第十步:source /etc/bash.bashrc

------------------------------------------------------------------------------------------------------------------------------------------------------

然后,打开终端

技术分享

tesseract的编译安装

标签:tom   img   top   cal   alt   ros   word   tool   bre   

原文地址:http://www.cnblogs.com/gavanwanggw/p/7219503.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!