如何将Tesseract OCR库集成到C ++程序中

时间:2012-02-05 20:38:04

标签: c++ ubuntu computer-vision ocr tesseract

我正在尝试使用Tesseract OCR Library来创建一个程序来读取电梯楼层号码的图片。我还没有找到关于如何将Tesseract库包含到C ++文件中的任何示例。类似的东西:

#include "tesseract.h"

我在Ubuntu 10.10上使用Tesseract v 3.00。

1 个答案:

答案 0 :(得分:8)

PlatformStatus页面对如何安装它有一些评论。它有依赖(leptonica),也需要安装。

来自上述讨论的

Another solution与其他Linux发行版有类似的细节。

在与您的计划关联时,this post有一些细节

is also a C wrapper to the underlying API calls;查看包含的文件应告诉您要包​​含的内容。 Other wrappers可在此处找到。

base API class are here...

的文档

Platform Status页面中有关安装的评论。

评论由tim.lawr ... @ gmail.com,2011年11月23日 我使用以下命令在Ubuntu 11.10 64Bit上成功安装了tesseract-ocr:

sudo apt-get install libleptonica-dev autoconf automake libtool libpng12-dev libjpeg62- dev libtiff4-dev zlib1g-dev subversion g++
cd
svn checkout http://tesseract-ocr.googlecode.com/svn/trunk/ tesseract-ocr
cd tesseract-ocr
./autogen.sh
./configure
make
sudo make install
sudo ldconfig
cd /usr/local/share/tessdata/
sudo wget http://tesseract-ocr.googlecode.com/files/eng.traineddata.gz
sudo gunzip eng.traineddata.gz
cd ~/tesseract-ocr/
tesseract phototest.tif phototest
cat phototest.txt