How to integrate Tesseract OCR Library to a C++ program

和自甴很熟 提交于 2019-12-07 10:29:14

问题


I am trying to use Tesseract OCR Library in order to create a program to read pictures of elevator floor numbers. I haven't found any example on how to include the Tesseract Library into a C++ file. Something like:

#include "tesseract.h"

I am using Tesseract v 3.00 on Ubuntu 10.10.


回答1:


The PlatformStatus Page has some comments on how to install it. It has dependencies (leptonica) which also need to be installed.

Another solution also linked from the above discussion has similar details for other linux distributions.

When it comes to linking with your program, this post has some specifics

There is also a C wrapper to the underlying API calls; looking at the files included should tell you what to include. Other wrappers are available here.

The documentation of the base API class are here...

A comment from the Platform Status page for the installation.

Comment by tim.lawr...@gmail.com, Nov 23, 2011 I successfully installed tesseract-ocr on Ubuntu 11.10 64Bit using these commands:

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


来源:https://stackoverflow.com/questions/9152803/how-to-integrate-tesseract-ocr-library-to-a-c-program

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!