Xococode
Xococode

Reputation: 1

Why OCR Tess-two only numbers doesn´t works?

I´am using "rmtheis:tess-two" (tesseract) for identify numbers (only digits), but this don´t work.

My code:

import com.googlecode.tesseract.android.TessBaseAPI;
...
mTess = new TessBaseAPI();
// mTess.setPageSegMode(TessBaseAPI.PageSegMode.PSM_OSD_ONLY);
mTess.setVariable(TessBaseAPI.VAR_CHAR_WHITELIST, "0123456789");
mTess.setVariable(TessBaseAPI.VAR_CHAR_BLACKLIST,"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmopqrstuvwxyz");
...
mTess.setImage(bitmap);
String str = mTess.getUTF8Text();

I use this image: Image "number_57689.png"

And "str" var get "s7esy" instead of "57689".

Curiously, if I use "tess4j.Tesseract" (http://tess4j.sourceforge.net/) in Java outside of Android (With identical image), this works fine.

Can you help me, please? @rmtheis

Thanks!

Upvotes: 0

Views: 533

Answers (0)

Related Questions