OCR fails "silently" (no error message)

Asked by tjonnyc

I'm trying this code, which I got from the answer to another thread (marked as solved):

myReg= Region(100,100,500,600)
myReg.highlight(2)
myText = myReg.text()
print myText

There is definitely text there, but I don't get ANY result.
The red highlight appears, sits there for a moment, then goes back to the Sikuli screen.
No error messages, no console message, no test trace... nothing.

Any suggestions?

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
RaiMan (raimund-hocke) said :
#1

guess you get either spaces or unprintable text.

try:
print "#%s#"%myText

to better see, what is printed.

Revision history for this message
tjonnyc (tjonnyc) said :
#2

Tried it, still nothing.

1.) Other OCR programs have no problem recognizing the text (took screenshot, MS Office OCR and CorelDraw OCR recognized it perfectly).

2.) The same script applied to 1/2 of this page also recognized nothing - not even the large-print headers.

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

What happens, if you restrict the region to one line or even one word of text?

use:
print "#%s#"%(selectRegion().text())

Revision history for this message
tjonnyc (tjonnyc) said :
#4

If I run that line, all I get is

##

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

ok, then OCR does not work for your font.

You simply have to forget it for now or look for other solutions/workarounds in the net (if it is vital),

Can you help with this problem?

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

To post a message you must log in.