Sikuli doesn't recognize any images while running!

Asked by Karan Rajpal

The basic function of recognizing an image while running the script doesn't seem to be working for me. I'm on a Mac and I've set up the Sikuli IDE.

I tried scripts without recognizing images and it worked. If I run a simple command like click(<image from screenshot>) it doesn't work!

I tried the Hello World tutorial on the mac and took a screenshot of the Spotlight icon. It shows up in code but when I run I get the following error :

[error] Region.find(text): text search is currently switched off
[error] script [ Testsh ] stopped with error in line 1
[error] FindFailed ( Text search currently switched off )

Maybe I missed something in the setup? Any help would be appreciated! :)

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
Phillip Kelly (pjk-1966) said :
#1

Yes you did miss something in the preferences settings.
Go to File>>Prefences and select More Options from the bottom menu.
You have to turn on "allow OCR" setting, and if you want sikuli to read text in an image you will need to turn on the "allow searching for text" setting.

Good Luck

Revision history for this message
Eugene S (shragovich) said :
#2

Hi there,

From the resulting error, it seems that you are searching for text and not for image.
Make sure that your screenshot path is correct (Sikuli can see it) and check that you use FULL image name (with extension). For example:

find("image.png")

and NOT:
find("image")

Revision history for this message
Karan Rajpal (karanrajpal001) said :
#3

Thank you for your prompt replies!

But I did try both of the above!

@Philip - The error message now reads

[error] TextRecognizer: init: tessdata folder not found at
[error] Region.find(text): text search is now switched off
[error] script [ Testsh ] stopped with error in line 1
[error] FindFailed ( Text search currently switched off )

@Eugene - Sikuli does see my image! I took a screenshot using the IDE tools and the the code has the image in it.
I've shown you my issue with a screenshot -
http://img842.imageshack.us/img842/4414/04l9.png

Additionally, if I close the saved Sikuli script file and open it again, the image vanishes and it's replaced by a link to recapture the image!

Revision history for this message
RaiMan (raimund-hocke) said :
#4

You seem to have the text search/OCR options switched on in Preferences -> ... more options, but have not installed the Tessdata option.

Switch these options off and restart the IDE.

If this does not help, delete your setup folder and run the setup again with a fresh copy of sikuli-setup.jar, to get the latest fixes.

Revision history for this message
JonyGreen (jonygreen) said :
#5

I'm not a developer, i always use the free online ocr http://www.online-code.net/ocr.html to recognize and scan text from image.

Can you help with this problem?

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

To post a message you must log in.