[1.0] [error] Region.text: text recognition is currently switched off

Asked by rohit

*** solution

How to switch it on can be found in the "Preferences" part of
https://github.com/RaiMan/SikuliX-IDE/wiki/Release-Notes-IDE

--------------------------------------------------------------------------------------

Hi,

I have started using Sikuli recently & found the text recognition feature very exciting.

I am facing a problem in reading text using Region.text().

Here is my program

r = [defined a region using "Create Region" button]
text = r.text()
openApp("C:\\Windows\\system32\\notepad.exe")
wait(2)
type(text)

On running this I get, ----- no text --- in the notepad and the following message

[error] Region.text: text recognition is currently switched off
[log] App.open C:\Windows\system32\notepad.exe(5480)

[log] TYPE "--- no text ---"

[info] Exit code: 0

Do I have to enable to enable text recognition somewhere? I am using SikuliX-IDE-Beta999 and running it using the sikuli-ide.cmd provided for windows.

Question information

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

I recommend to switch to the final version Sikuli-IDE 1.0.0:

start here and read carefully: http://www.sikuli.org/download.html

how to switch on the text features you can find in the section
"new features or major changes" https://github.com/RaiMan/SikuliX-IDE/wiki

Revision history for this message
rohit (rohitsinghjadaun) said :
#2

Thanks .. should have read this earlier, my bad...

Have a great day

Revision history for this message
Reinaldo Burgos (reinaldo-burgos-y) said :
#3

How to allow this on Eclipse?
I try this but not working. Settings.OcrTextRead=true

//RB

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

@Reinaldo
- you must have setup your stuff including option 5

then the above should work for using Region.text()

If not, use -Dsikuli.Debug=3 as Java runtime parameter and paste the relevant debug output.

Revision history for this message
Reinaldo Burgos (reinaldo-burgos-y) said :
#5

Ok Thank you.

Revision history for this message
Mujeebu Rahman (mujeeburahman007) said :
#6

Hi RaiMan,

I am getting the below error even after installing sikuli with option 5 and setting "Settings.OcrTextSearch" option to ON,

Code:
Settings.OcrTextSearch = True
r = [defined a region using "Create Region" button]
text = r.text()
print text

Error Message:
[error] Region.text: text recognition is currently switched off
--- no text ---

Please let me know if i am doing anything wrong.

Regards.

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

As mentioned in the above solution link:
Settings.OcrTextRead
is the respective option.

Revision history for this message
Veronika (norika1111) said :
#8

Hello, please, provide some details how get rid of this error in Eclipse IDE. (jython script)
Settings.OcrTextSearch = True doesn't help.
Should I add link to sikuli-tessdata.jar file in pythonpath to Pydev project? (Already did but it still doesn't works.)
I use sikuli 1.0.1, jython 2.5.3, mac os 10.10.
Thanks.

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

@Veronika
if you have run setup with the tesseract option, the simply delete the libs folder and start again.
The libs AND the tessdata folder will now be exported.