Is there a way to pass parameters to leptonica

Asked by Irakli

I see a leptonica library in libs, so my guess is before passing image to tesseract there is some preprocessing going on.
Assuming I know what is the best way to preprocess my image for OCR is there a way to tell sikuli how to preprocess image in leptoinca (make it black and white enlarge by certain % , etc)?

Question information

Language:
English Edit question
Status:
Answered
For:
SikuliX Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
RaiMan (raimund-hocke) said :
#1

principally yes ;-)

… but you would have to write your own C/C++ interface and make it accessible from Java via JNI/JNA.

Alternatively you might use any Image library or basic image features, that are useable with Java.

Another possibility is to use Tess4J (that I will use later this year to reimplement the text/OCR feature in SikuliX).

Revision history for this message
Irakli (imatchabelli) said :
#2

Wow, that was quick, I guess I just spawn a process and use leptonica/tesseract from the shell for now.

On the other note, I saw a message saying libs not in the path and it was added to the path and I have to log off log on,
you can avoid that on windows if you send a message like this. Use id multiple times before.

SendMessageTimeout(HWND_BROADCAST, WM_SETTINGCHANGE, 0,
    (LPARAM) "Environment", SMTO_ABORTIFHUNG,
    5000, &dwReturnValue);

http://support.microsoft.com/kb/104011

Can you help with this problem?

Provide an answer of your own, or ask Irakli for more information if necessary.

To post a message you must log in.