text, OCR, tesseract not working --- tessdata folder not found

Created by RaiMan
Keywords:
Last updated by:
RaiMan

How to switch it on at runtime:
-----------------------------------------------
TextSearch (find("some text")) and OCR (Region.text()) are currently switched off in the default with respect to the many issues.

The related Settings options to be used (set to true) with Sikuli API (or outside the IDE):

Python scripts:
Settings.OcrTextRead = True # to switch on the Region.text() function
Settings.OcrTextSearch = True # to switch on finding text with find("some text")

Running scripts from inside the IDE alternatively the respective options in the Preferences -> …more options can be selected.

Java:
Settings.OcrTextRead = true; // to switch on the Region.text() function
Settings.OcrTextSearch = true; // to switch on finding text with find("some text")

When using the Java API, the class Settings has to be imported as
import org.sikuli.basics.Settings;

------------------------------------- this only applies up to versions before 1.1.0 --------------
You get the following error, after having successfully setup with option 5 (Tesseract support) and switched on the Settings options for text and/or OCR (see below):

[error] TextRecognizer: init: tessdata folder not found at <path-to-Sikuli-stuff>/libs/
[error] Region.find(text): text search is now switched off

To overcome this problem:
- delete the libs folder mentioned in the error message
- run again, whatever you did before to get the above error
- the libs folder should be recreated and now contain the tessdata folder

This workaround should be done once after a setup with option 5 (... and is a bug, that will soon be fixed)
end of ------------------------------------- this only applies up to versions before 1.1.0 --------------