centos下安装tessrect-ocr及训练工具问题分析及解决办法

来源:互联网 发布:java snmp agent库 编辑:程序博客网 时间:2024/06/07 00:57

centos下安装tessrect-ocr及训练工具问题分析及解决办法

最近要在服务器上搭建tessrect-ocr和训练工具,搭建一个训练网页:

http://115.159.205.168/ocr_php/public/index.php

在搭建中遇到了以下问题:

1.找不到tessrect-ocr安装包

2.训练工具无法安装


1.解决办法:

sudo yum install tesseract.i686

2.安装centos库时,没有安装训练工具,所以要进行源码安装:

1.下载源码:

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

2.解压:

unzip tesseract-master.zip

3.运行以下命令:

./autogen.sh./configuremakesudo make installsudo ldconfig
现在已经安装好引擎了,现在安装训练工具:

make trainingsudo make training-install

 但是如果你的程序在./configure时显示这个:

Configuration is done.You can now build and install tesseract by running:$ make$ sudo make installYou can not build training tools because of missing dependency.Check configure output for details.

那训练工具肯定安装不成功,因为它没有生产Makefile文件

configure: creating ./config.statusconfig.status: creating Makefileconfig.status: creating tesseract.pcconfig.status: creating api/Makefileconfig.status: creating ccmain/Makefileconfig.status: creating opencl/Makefileconfig.status: creating ccstruct/Makefileconfig.status: creating ccutil/Makefileconfig.status: creating classify/Makefileconfig.status: creating cube/Makefileconfig.status: creating cutil/Makefileconfig.status: creating dict/Makefileconfig.status: creating neural_networks/runtime/Makefileconfig.status: creating textord/Makefileconfig.status: creating viewer/Makefileconfig.status: creating wordrec/Makefileconfig.status: creating tessdata/Makefileconfig.status: creating tessdata/configs/Makefileconfig.status: creating tessdata/tessconfigs/Makefileconfig.status: creating testing/Makefileconfig.status: creating java/Makefileconfig.status: creating java/com/Makefileconfig.status: creating java/com/google/Makefileconfig.status: creating java/com/google/scrollview/Makefileconfig.status: creating java/com/google/scrollview/events/Makefileconfig.status: creating java/com/google/scrollview/ui/Makefileconfig.status: creating doc/Makefileconfig.status: creating config_auto.hconfig.status: config_auto.h is unchangedconfig.status: executing depfiles commandsconfig.status: executing libtool commands
很明显,没有产生training的Makefile文件

下面解决办法:

1.去看./configure产生的信息:

checking limits.h usability... yeschecking limits.h presence... yeschecking for limits.h... yeschecking malloc.h usability... yeschecking malloc.h presence... yeschecking for malloc.h... yeschecking for stdbool.h that conforms to C99... yeschecking for _Bool... nochecking whether #! works in shell scripts... yeschecking for special C compiler options needed for large files... nochecking for _FILE_OFFSET_BITS value needed for large files... 64checking for getline... yeschecking for wchar_t... yeschecking for long long int... yeschecking for off_t... yeschecking for mbstate_t... yeschecking for leptonica... yeschecking for l_generateCIDataForPdf in -llept... yeschecking leptonica headers version >= 1.71... yeschecking unicode/uchar.h usability... yeschecking unicode/uchar.h presence... yeschecking for unicode/uchar.h... yeschecking for pkg-config... /usr/bin/pkg-configchecking pkg-config is at least version 0.9.0... yeschecking for pango... yeschecking for cairo... yes

如果有Warning:...............can't install training tools   按照其提示未安装的进行按照:

如果找不到包,执行以下命令:

yum list | gerp name 
找到对应包。

这里有一个包ICU版本比较旧,要进行源码安装:

1.下载源码:

wget http://download.icu-project.org/files/icu4c/58.1/icu4c-58_1-src.tgz
2. 安装
./configuremakesudo make install


然后重新运行./configure

如果没有Warning但仍然显示无法安装:

修改config.status文件,325行添加 training/Makefile

然后进入training目录,

执行

makemake install





































0 0