tesseract是一个开源的OCR文字识别工具
tesseract 4.0一直安装失败,后来参照网上的方法,成功安装3.04
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
|
yum -y install automake libtool autoconf gcc gcc-c++
wget http: //www .leptonica.com /source/leptonica-1 .73. tar .gz
tar -xvf leptonica-1.73. tar .gz;\
cd leptonica-1.73;\
. /configure && make && make install
wget https: //github .com /tesseract-ocr/tesseract/archive/3 .04.01. tar .gz;\
mv 3.04.01. tar .gz tesseract-3.04.01. tar .gz;\
tar xzvf tesseract-3.04.01. tar .gz;\
cd tesseract-3.04.01/;\
. /autogen .sh;\
. /configure ;\
make ;\
make install
ldconfig 安装后tesseract位于以下位置 /usr/local/bin/tesseract export TESSDATA_PREFIX= /usr/local/share/tessdata/
wget --no-check-certificate https: //github .com /tesseract-ocr/tessdata/raw/master/eng .traineddata;\
wget --no-check-certificate https: //github .com /tesseract-ocr/tessdata/raw/master/chi_sim .traineddata;\
wget --no-check-certificate https: //github .com /tesseract-ocr/tessdata/raw/master/chi_tra .traineddata;
mv *.traineddata /usr/local/share/tessdata/
install Ghostscript for processing png:
wget https: //github .com /ArtifexSoftware/ghostpdl-downloads/releases/download/gs920/ghostscript-9 .20. tar .gz;\
tar xzvf ghostscript-9.20. tar .gz;\
cd ghostscript-9.20/;\
. /autogen .sh;\
. /configure ;\
make ;\
make install
|
更简便的方法是使用yum方式安装
1
2
3
4
5
6
|
yum install epel-release
yum install tesseract
中文包 yum install tesseract-langpack-chi_sim.noarch
训练文件位于 /usr/share/tesseract/tessdata/ |