歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
您现在的位置: Linux教程網 >> UnixLinux >  >> Linux綜合 >> 學習Linux

centos下安裝tessrect-ocr

centos下安裝tessrect-ocr

centos下安裝tessrect-ocr


centos下安裝tessrect-ocr及訓練工具問題分析及解決辦法

最近要在服務器上搭建tessrect-ocr和訓練工具,搭建一個訓練網頁:

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

在搭建中遇到了以下問題:

1.找不到tessrect-ocr安裝包

2.訓練工具無法安裝

1.解決辦法:

[cpp]view plaincopy在CODE上查看代碼片派生到我的代碼片
  1. sudoyuminstalltesseract.i686

2.安裝centos庫時,沒有安裝訓練工具,所以要進行源碼安裝:

1.下載源碼:

[cpp]view plaincopy在CODE上查看代碼片派生到我的代碼片
  1. wgethttps://github.com/tesseract-ocr/tesseract/archive/master.zip

2.解壓:

unzip tesseract-master.zip

3.運行以下命令:

[cpp]view plaincopy在CODE上查看代碼片派生到我的代碼片
  1. ./autogen.sh
  2. ./configure
  3. make
  4. sudomakeinstall
  5. sudoldconfig
現在已經安裝好引擎了,現在安裝訓練工具:

[cpp]view plaincopy在CODE上查看代碼片派生到我的代碼片
  1. maketraining
  2. sudomaketraining-install

但是如果你的程序在./configure時顯示這個:

[cpp]view plaincopy在CODE上查看代碼片派生到我的代碼片
  1. Configurationisdone.
  2. Youcannowbuildandinstalltesseractbyrunning:
  3. $make
  4. $sudomakeinstall
  5. Youcannotbuildtrainingtoolsbecauseofmissingdependency.
  6. Checkconfigureoutputfordetails.

那訓練工具肯定安裝不成功,因為它沒有生產Makefile文件

[cpp]view plaincopy在CODE上查看代碼片派生到我的代碼片
  1. configure:creating./config.status
  2. config.status:creatingMakefile
  3. config.status:creatingtesseract.pc
  4. config.status:creatingapi/Makefile
  5. config.status:creatingccmain/Makefile
  6. config.status:creatingopencl/Makefile
  7. config.status:creatingccstruct/Makefile
  8. config.status:creatingccutil/Makefile
  9. config.status:creatingclassify/Makefile
  10. config.status:creatingcube/Makefile
  11. config.status:creatingcutil/Makefile
  12. config.status:creatingdict/Makefile
  13. config.status:creatingneural_networks/runtime/Makefile
  14. config.status:creatingtextord/Makefile
  15. config.status:creatingviewer/Makefile
  16. config.status:creatingwordrec/Makefile
  17. config.status:creatingtessdata/Makefile
  18. config.status:creatingtessdata/configs/Makefile
  19. config.status:creatingtessdata/tessconfigs/Makefile
  20. config.status:creatingtesting/Makefile
  21. config.status:creatingjava/Makefile
  22. config.status:creatingjava/com/Makefile
  23. config.status:creatingjava/com/google/Makefile
  24. config.status:creatingjava/com/google/scrollview/Makefile
  25. config.status:creatingjava/com/google/scrollview/events/Makefile
  26. config.status:creatingjava/com/google/scrollview/ui/Makefile
  27. config.status:creatingdoc/Makefile
  28. config.status:creatingconfig_auto.h
  29. config.status:config_auto.hisunchanged
  30. config.status:executingdepfilescommands
  31. config.status:executinglibtoolcommands
很明顯,沒有產生training的Makefile文件

下面解決辦法:

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

[cpp]view plaincopy在CODE上查看代碼片派生到我的代碼片
  1. checkinglimits.husability...yes
  2. checkinglimits.hpresence...yes
  3. checkingforlimits.h...yes
  4. checkingmalloc.husability...yes
  5. checkingmalloc.hpresence...yes
  6. checkingformalloc.h...yes
  7. checkingforstdbool.hthatconformstoC99...yes
  8. checkingfor_Bool...no
  9. checkingwhether#!worksinshellscripts...yes
  10. checkingforspecialCcompileroptionsneededforlargefiles...no
  11. checkingfor_FILE_OFFSET_BITSvalueneededforlargefiles...64
  12. checkingforgetline...yes
  13. checkingforwchar_t...yes
  14. checkingforlonglongint...yes
  15. checkingforoff_t...yes
  16. checkingformbstate_t...yes
  17. checkingforleptonica...yes
  18. checkingforl_generateCIDataForPdfin-llept...yes
  19. checkingleptonicaheadersversion>=1.71...yes
  20. checkingunicode/uchar.husability...yes
  21. checkingunicode/uchar.hpresence...yes
  22. checkingforunicode/uchar.h...yes
  23. checkingforpkg-config.../usr/bin/pkg-config
  24. checkingpkg-configisatleastversion0.9.0...yes
  25. checkingforpango...yes
  26. checkingforcairo...yes

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

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

[cpp]view plaincopy在CODE上查看代碼片派生到我的代碼片
  1. yumlist|gerpname
找到對應包。

這裡有一個包ICU版本比較舊,要進行源碼安裝:

1.下載源碼:

[cpp]view plaincopy在CODE上查看代碼片派生到我的代碼片
  1. wgethttp://download.icu-project.org/files/icu4c/58.1/icu4c-58_1-src.tgz
2. 安裝
[cpp]view plaincopy在CODE上查看代碼片派生到我的代碼片
  1. ./configure
  2. make
  3. sudomakeinstall


然後重新運行./configure

如果沒有Warning但仍然顯示無法安裝:

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

然後進入training目錄,

執行

[cpp]view plaincopy在CODE上查看代碼片派生到我的代碼片
  1. make
  2. makeinstall

http://xxxxxx/Linuxjc/1184828.html TechArticle

Copyright © Linux教程網 All Rights Reserved