[request] Linux: leave the creation of the tessdata folder to the user

Bug #1237522 reported by Luciana Moreira Sá de Souza
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
SikuliX
Fix Released
High
RaiMan

Bug Description

The functionality to find text on the screen does not work properly. The following error appears:

[debug] ResourceLoaderBasic: loadLib: Is already loaded: VisionProxy
[error] TextRecognizer: init: tessdata folder not found at /usr/local/share/
[error] Region.find(text): text search is now switched off
[error] script [ test1 ] stopped with error in line 6
[error] FindFailed ( Text search currently switched off )

I have seen the bug 1214589, and followed the steps there. I deleted the folder libs, and I do have a subfolder tessdata now. Unfortunately, this does not seem to be enough. The error still occurs.

RaiMan, I did some debuging and found out the source of the problem. In the class org.sikuli.basics.ResourceLoader line 342, you have the following:

if (Settings.OcrDataPath == null) {
      if (Settings.isWindows() || Settings.isMac()) {
        log(lvl, "Using this as OCR directory (tessdata) too");
        Settings.OcrDataPath = libPath;
      } else {
        Settings.OcrDataPath = "/usr/local/share";
      }
    }

I am not sure why on linux we end up on a location different from libPath. Is this a bug or a feature? :)

Revision history for this message
RaiMan (raimund-hocke) wrote : Re: [1.0.1] Linux: leave the creation of the tessdata folder to the user

Are you on Linux?

If yes: absolutely right.

On Linux systems option 5 should not be presented, since it is your own job, to completely install Tesseract (including the tessdata folder, that then usually is at /usr/local/share, if not, you have to change that).

Thanks for pointing out.

summary: - tessdata folder is not found
+ [1.0.1] Linux: leave the creation of the tessdata folder to the user
Revision history for this message
RaiMan (raimund-hocke) wrote :

I will change the behavior for Linux for setup and runtime

Changed in sikuli:
status: New → Fix Committed
importance: Undecided → High
assignee: nobody → RaiMan (raimund-hocke)
milestone: none → 1.1.0
Revision history for this message
Luciana Moreira Sá de Souza (lso) wrote :

Thank you RaiMan!

Yes I am on linux, I use Opensuse.

Is there any chance of defining the path to the tessaract in the SikuliX-IDE? Either via a system property or on the preferences dialog?

For now I can put a symlink, but this is not ideal. Although I see this as a low priority.

Revision history for this message
RaiMan (raimund-hocke) wrote :

--- Is there any chance of defining the path to the tessaract in the SikuliX-IDE?

... you already saw it ;-)
Settings.OcrDataPath = <tell Sikuli your path to the tessdata folder>;

at the very beginning of a script should do it.

BTW: What are the standard places on OpenSuse for the OpenCV and Tesseract stuff?

Revision history for this message
Luciana Moreira Sá de Souza (lso) wrote :

Hey RaiMan,

Unfortunately, tesseract is not available in the default opensuse repository. I had to take it from a third party location to get it installed. See: http://software.opensuse.org/package/tesseract (click on "Show unstable packages"). So I am not sure how much we can count on the install location provided by these packages.

In any case, with this unstable package, it got installed on my machine under: /usr/share/tessdata

Regards

Revision history for this message
RaiMan (raimund-hocke) wrote :

thanks.

this is the second most location for such stuff besides /usr/local/Share

RaiMan (raimund-hocke)
Changed in sikuli:
status: Fix Committed → In Progress
milestone: 1.1.0 → 2.0.0
summary: - [1.0.1] Linux: leave the creation of the tessdata folder to the user
+ [request] Linux: leave the creation of the tessdata folder to the user
RaiMan (raimund-hocke)
Changed in sikuli:
status: In Progress → Fix Released
milestone: 2.0.0 → none
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.