Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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.

like image 621
locorecto Avatar asked Feb 05 '12 20:02

locorecto


1 Answers

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 [email protected], 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
like image 82
VSOverFlow Avatar answered Oct 20 '22 10:10

VSOverFlow