栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 系统运维 > 运维 > Linux

centos7部署tesseract

Linux 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

centos7部署tesseract

1、快捷安装依赖包
yum -y install automake libtool libtiff-devel libjpeg-devel libpng-devel
还有个pkg-config包yum源里没有,需要下载后在安装
下载pkg-config: wget https://pkg-config.freedesktop.org/releases/pkg-config-0.29.tar.gz
解压:tar -xvf pkg-config-0.29.tar.gz
cd pkg-config-0.29/
./configure --with-internal-glib
make
make check
make install
pkg-config安装完成
注意:不安装pkg-config,等下./configure Tesseract时会出现以下错误:
configure: error: Leptonica 1.74 or higher is required. Try to install libleptonica-dev package.

2、编译安装Leptonica
在官方source下载页面可找到最新的Leptonica
在这以leptonica-1.78.0为例
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 && make install
确认 /usr/local/include/leptonica 存在所需头文件。
确认 /usr/local/lib 存在 Leptonica 库。
将leptonica加入系统变量中
vim /etc/profile
在文末加入:
export LD_LIBRARY_PATH=$LD_LIBRARY_PAYT:/usr/local/lib
export LIBLEPT_HEADERSDIR=/usr/local/include
export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig
保存退出后运行:
source /etc/profile
3、编译安装Tesseract
以下以4.1.0为例
wget https://codeload.github.com/tesseract-ocr/tesseract/tar.gz/4.1.0
tar -xvf 4.1.0
cd tesseract-4.1.0/
./autogen.sh
./configure --with-extra-includes=/usr/local/include --with-extra-libraries=/usr/local/lib
make && make install
4、验证
tesseract -v

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/831701.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号