Skip to content

Instantly share code, notes, and snippets.

@sdhjl2000
Last active August 29, 2015 14:25
Show Gist options
  • Save sdhjl2000/1c6a43656037735fdc32 to your computer and use it in GitHub Desktop.
Save sdhjl2000/1c6a43656037735fdc32 to your computer and use it in GitHub Desktop.
centos 6.X 安装tesseract进行图像识别

这两天在使用pillow完成图像识别的一个小任务,mac上配置起来还算方便,但是再centos服务器配置的时候遇到一些麻烦,记录下来

方案1:http://pkgs.org/download/tesseract,安装后和训练数据(https://code.google.com/p/tesseract-ocr/downloads/list)无法正常使用,提示actual_tessdata_num_entries <= TESSDATA_NUM_ENTRIES:Error:Assert failed:in file ..\ccutil\tessdatamanager.cpp,官方说法是训练文件不对应,但是安装了三个版本的tesseract都不行

方案2:手动安装,请参考https://www.simpleservers.co.uk/clients/whmcs/knowledgebase/600/Install-Tesseract-OCR-libs-from-sources-in-Centos.html

方案3:使用PUIAS_6_computational源

$ vim /etc/yum.repos.d/puias-computational.repo 粘贴:

[PUIAS_6_computational]
name=PUIAS computational Base $releasever - $basearch
mirrorlist=http://puias.math.ias.edu/data/puias/computational/$releasever/$basearch/mirrorlist
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-puias

下载安装key

$ cd /etc/pki/rpm-gpg/
$ wget -q http://springdale.math.ias.edu/data/puias/6/x86_64/os/RPM-GPG-KEY-puias
$ rpm --import RPM-GPG-KEY-puias

安装:

$  yum install tesseract tesseract-en ImageMagick 
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment