Tess-two OCR not working

谁说我不能喝 提交于 2019-12-02 03:39:37

Here change the language code for image text language.

eg: if you want English language text recognition, then use 'eng', or Spanish language for 'spa'

1)

   TessBaseAPI baseApi = new TessBaseAPI();
        baseApi.init("/mnt/sdcard/external_sd/tess/", "eng");
        baseApi.setImage(bitmap);
        String recognizedText = baseApi.getUTF8Text();
        Log.d("Texto leido", "texto: "+recognizedText);
        baseApi.end();

2)Download language package files from Download here you must download osd.traineddata.zip file and tesseract-ocr-3.01.eng.tar.zip(here eng for English, spa for Spanish.. etc) files paste into assets folder.

3)before set bitmap convert into gray scale image bitmap

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!