← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #190795]: Image search out of the region

 

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

    Status: Open => Answered

RaiMan proposed the following answer:
With your Google+ page
https://plus.google.com/u/0/116251563727288108300/posts

If there is only one object with blue background, then you have to use a solid blue rectangle, that can be found.
With an image editor I reduced the blue search image to dimension 14x4 and with the region restricted to the above images, I had no problem.

the relevant script part:
# page open in browser
imgBlue = "blue-1.png"
imgTop = "UbermichBeit.png"
top = find(imgTop)
top.highlight(1)
reg = top.below(100)
reg.highlight(1) # contains the images
mBlue = reg.find(imgBlue)
mBlue.highlight(1)
reg.highlight(1)
for m in reg.findAll(imgBlue):
    m.highlight(1) 

the single find() matches in the solid blue rectangle.

The findAll() returns many matches, that have to be somehow filtered.
But in your case, the best match (first) might be sufficient already.

-- 
You received this question notification because you are a member of
Sikuli Drivers, which is an answer contact for Sikuli.