Skip to content

saryoni23/aplikasiocrandroid

Repository files navigation

Android TessTwo OCR example

Add dependency to app/build.gradle

dependencies {
...
compile 'com.rmtheis:tess-two:5.4.1'
...
}

Get text from bitmap

private String getText(Bitmap bitmap){
    try{
      tessBaseAPI = new TessBaseAPI();
    }catch (Exception e){
      Log.e(TAG, e.getMessage());
    }
    tessBaseAPI.init(DATA_PATH,"eng");
    tessBaseAPI.setImage(bitmap);
    String retStr = "No result";
    try{
      retStr = tessBaseAPI.getUTF8Text();
    }catch (Exception e){
      Log.e(TAG, e.getMessage());
    }
    tessBaseAPI.end();
    return retStr;
}

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages