← Back to team overview

sikuli-driver team mailing list archive

[Question #289149]: text recognition issue without IDE

 

New question #289149 on Sikuli:
https://answers.launchpad.net/sikuli/+question/289149

I wrote a test program:

addImportPath("D:\\SikuliScripts")
import Biblioteca
reload(Biblioteca)
from Biblioteca import *
#----------------------------------------------------------------------------
#
#
def leTexto(reg):
    i = 6
    reg1 = Region(reg)
    reg1.setX(reg.getX()-i)
    reg1.setY(reg.getY())
    reg1.setW(reg.getW()+i)
    reg1.setH(reg.getH()+i)
    reg1.highlight(3)
    resp = decod(reg1.text()).rstrip().lstrip()
    return resp
#
#
Settings.OcrReadText = True
Settings.OcrTextSearch = True
x = selectRegion("Selecione regiao")
y = leTexto(x)
popup("Li texto da NL =" + y)

When I use the IDE it works fine and pops the text up.

But, when I run it from the command line (windows 7) using this:

D:\Sikulix\runsikulix.cmd -f teste.txt -r D:\SikulixScripts\teste1.sikuli

It returns "--- no text read ---"

The log file reads:

[log] highlight R[571,257 232x25]@S(0)[0,0 1366x768] E:Y, T:3,0 for 3.0 secs
[error] text: text recognition is currently switched off

So, it seems ocr is turned on only in the IDE environment, but not in API.

I have Sikulix 1.1.0 installed with tesseract-ocr-3.02.eng.tar.gz

How can I read text in the API?

-- 
You received this question notification because your team Sikuli Drivers
is an answer contact for Sikuli.