All Projects → kylemcdonald → ofxTesseract

kylemcdonald / ofxTesseract

Licence: other
tesseract-ocr wrapper for openFrameworks

Programming Languages

C++
36643 projects - #6 most used programming language

ofxTesseract is an addon for openFrameworks that provides access to the Tesseract OCR library.

Warning: the training data provided here causes a segmentation fault in some cases. Please use the latest version available from the Tesseract project.

Overview

I've included a copy of eng.traineddata in the example, but if you need a newer one or a different language you can get it from the tesseract-ocr website:

https://code.google.com/p/tesseract-ocr/downloads/detail?name=eng.traineddata.gz&can=2&q=eng

Once downloaded, it should be placed in your data directory under a special directory named 'tessdata':

myApp/bin/data/tessdata/eng.traineddatat

Example usage of ofxTesseract looks like:

#include "ofxTesseract.h"
...
ofxTesseract ocr;
ofImage img;
...
ocr.setup();
ocr.setWhitelist("0123456789");
tess.setAccuracy(ofxTesseract::ACCURATE);
img.loadImage("text.png");
string result = ocr.findText(img);
cout << result << endl;

Building Tesseract

If you need to build the library from scratch, you need to be familiar with building static libraries. For Tesseract, after downloading the source, it looks something like this:

cd /Users/username/tesseract
./runautoconf
./configure --disable-shared --enable-static --prefix=/Users/username/tesseract
make
sudo make install
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].