Search code examples
androidwindowsocrtesseractdifference

Tess-Two, Tesseract Windows, different results


I use tess-two for my android app. The recognition is bad but sometimes i works. I also use tesseract on my windows 7 pc and the same pictures get recognized 100% here. I tried different Options.

On windows i use:

    tesseract test.png output -eng -psm6

On android:

    Bitmap bMap = btm;
    final TessBaseAPI baseApi = new TessBaseAPI();
    baseApi.init(dpath, lang);
    baseApi.setPageSegMode(TessBaseAPI.PageSegMode.PSM_SINGLE_BLOCK);
    baseApi.setImage(bMap);
    outputText = baseApi.getUTF8Text();

I also tried different PageSegMode's but do not get better recognitions.

Why is Windows tesseract working better? Do i make any mistakes?

I noticed that in Windows tesseract recognizes the numbers from top to bottom and in Tess-Two from left to right. Don't know if this helps any.

PS: here the picture I trie to recognize: http://pbrd.co/1q4DClR


Solution

  • I managed to recognize the same answers like on windows. I made a new testcase in witch i didnt set any options. I used

    Bitmap bMap = btm;
    final TessBaseAPI baseApi = new TessBaseAPI();
    baseApi.init(dpath, lang);
    baseApi.setImage(bMap);
    outputText = baseApi.getUTF8Text();
    

    Thats all. And it worked. Needet two weeks to figure that out. I dont't know why there is a difference between

    baseApi.setPageSegMode(TessBaseAPI.PageSegMode.PSM_SINGLE_BLOCK);

    and no option, as this PageSegMode is the default mode. Hope i could help anybody.