If you want to use API you need to spend some time with docs and source
code.
You could fine out quite quickly that  CUBE  was removed from tesseract and
is not available in version 4.

Zdenko


ne 8. 12. 2019 o 2:37 NY C <[email protected]> napĂ­sal(a):

> Hi, I am using tess-two for OCR.
>
>
> (Alex Chon version : https://github.com/alexcohn/tess-two
> <https://www.google.com/url?q=https%3A%2F%2Fgithub.com%2Falexcohn%2Ftess-two&sa=D&sntz=1&usg=AFQjCNEQGm3c_HnjOOVpdOoDYCwnElOb5Q>
> )
>
>
> Code:
>
>         TessBaseAPI baseApi = new TessBaseAPI();
>         baseApi.setDebug(true);
>         baseApi.init(pathfiles, language);
>         //baseApi.setVariable(TessBaseAPI.VAR_CHAR_WHITELIST, "0123456789");
>         baseApi.setPageSegMode(TessBaseAPI.PageSegMode.PSM_AUTO);
>         baseApi.setImage(bmp);
>         result= baseApi.getUTF8Text();
>         baseApi.end();
>
>
> The code run perfectly when I use this tessdata :
> https://github.com/tesseract-ocr/tessdata
>
> But when I use tessdata_fast (
> https://github.com/tesseract-ocr/tessdata_fast), The code crashes on
> baseApi.init.
>
>
> There is no error message since the init method calls native C++. As far
> as I can trace, the init method crashes on this line:
>
> boolean success = nativeInitOem(mNativeData, datapath, language, 
> ocrEngineMode);
>
>
> I also tried to set the OEM like this:
>
>   baseApi.init(pathfiles, language, TessBaseAPI.OEM_CUBE_ONLY);
>
>
> All the OEM parameters have been tried :
>
> (OEM_TESSERACT_ONLY = 0, OEM_CUBE_ONLY = 1, OEM_TESSERACT_CUBE_COMBINED =
> 2, OEM_DEFAULT = 3)
>
> Crashes as well.
>
>
> How could I fix this?
>
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "tesseract-ocr" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/tesseract-ocr/189fd3e5-4894-4a60-a6b3-480093d6f8ad%40googlegroups.com
> <https://groups.google.com/d/msgid/tesseract-ocr/189fd3e5-4894-4a60-a6b3-480093d6f8ad%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"tesseract-ocr" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tesseract-ocr/CAJbzG8x-GnsxfmXzn5fGjLURgUq4wVUpBXUvE4ZYk1xFNysE6Q%40mail.gmail.com.

Reply via email to