Tesseract error. Illegal min or max specification

2019-04-29 23:04发布

问题:

Trying to run sample code from here http://tess4j.sourceforge.net/codesample.html I got an error saying

Error: Illegal min or max specification!
signal_termination_handler:Error:Signal_termination_handler called:Code 5002

I found solution e.g. here https://code.google.com/p/tesseract-ocr/issues/detail?id=228 ppl say that setting locale is enough to get rid of error. My problem is that I write it in Java not C++ and I cannot find anywhere how I can set locale in my code as they did it like that

 #include <locale.h>
 setlocale (LC_NUMERIC, "C");

I was trying to use setTessVariable(String, String) method but it didn't work. I will mention that my pdf files, which are on input, are in polish language so if someone know how I should set these locale I would be grateful. I try to run it on linux x64 platform.

回答1:

'Can you export LC_NUMERIC="C" at the command line when you launch your program?'

– nguyenq



回答2:

Open a terminal, export LC_NUMERIC="C" and launch Eclipse or NetBeans from there also (important!).