Failed to Extract text from image

Asked by siddu

Hi,

Image has text "site_1" and when I tried to grep the text with below code ,i couldn't able to grep the text.

textSearch = find("sites.png").highlight(1)
    textFound = textSearch.text()
    print "Grepped text is",textFound

O/P---->

Actual O/p: Grepped text is

Expect O/p: Grepped text is site_1

Note: I have used the similar code for other Images and it is able to grep the text

I have tried with below code and it is able to grep the text "site_1".
find(Pattern("sites.png").exact()).below(10).text()

Im using sikuli 1.1.0(with options 1 and 3) and windows machine.

Thanks in Advance

regards
Siddu

Question information

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

text() extract the text contained in the region

[case1:]
textSearch = find("sites.png").highlight(1)

textSearch is a Match object, not a Region.

[case2:]
textSearch = find(Pattern("sites.png").exact()).below(10)

In this case, textSearch is a Region.

Revision history for this message
siddu (siddum-meti) said :
#2

Thanks masuo, that solved my question.