Question #275451 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/275451

    Status: Open => Answered

RaiMan proposed the following answer:
I am sorry for the situation, but ...

... this simply means, that the feature findText() does not work as expected, 
due to the weak and buggy current implementation.
I will not touch this hardcoded C++ implementation in 1.1.x (which I have 
inherited from the original developers of Sikuli), but try to find a better 
solution in  version 2 next year.

You simply can do nothing currently with the means of SikuliX, to
improve the situation.

--- find("some text") and findText("some text") ...
... are the same feature internally. The only difference is, that findText does 
not try to interpret the given parameter as an image filename, but instantly 
switches to text search.

You might experiment with the following experimental, not documented feature 
Region.listText():
might be, that it is helpful in some situations.
Whereas findText internally uses a completely different approach than 
Region.text(), leading to the differences in behavior, listText() uses the same 
approach as Region.text(), but before doing OCR it visually separates the text 
in the given regions into words with respect to the horizontal and vertical 
spacing.
the returned matches are sorted top-down along the lines of text found.

matches = reg.listText() # get the match regions occupied by the pixels of a 
word
for m in matches:
  m.highlight(1)
  print m.getText() # get the word textually form this match region

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

_______________________________________________
Mailing list: https://launchpad.net/~sikuli-driver
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~sikuli-driver
More help   : https://help.launchpad.net/ListHelp

Reply via email to