Ofek Agmon
Ofek Agmon

Reputation: 5198

android - using the tess-two library

I am following this tutorial and manage to build the library just fine.

My State Now:

The problem-

I couldn't understand how do I use this piece of code:

TessBaseAPI baseApi = new TessBaseAPI();
// DATA_PATH = Path to the storage
// lang = for which the language data exists, usually "eng"
baseApi.init(DATA_PATH, lang);
// Eg. baseApi.init("/mnt/sdcard/tesseract/tessdata/eng.traineddata", "eng");
baseApi.setImage(bitmap);
String recognizedText = baseApi.getUTF8Text();
baseApi.end();

not really sure what I need to do and the tutorial doesn't explain it.

any help would be appreciated!

Upvotes: 0

Views: 3444

Answers (1)

Lesther Vega
Lesther Vega

Reputation: 528

put the file in your devices (download folder for example)

File Manager

Open the file properties in your devices:

Devices properties

and copy the path in your DATA_PATH var, for example: /mnt/sdcard/download/eng.traineddata

the TessBaseAPI need the file for initialization.

Upvotes: 1

Related Questions