Find image in region > Then set new region around image

Asked by xyz_User on 2020-07-12

Trying to find an image which appears at different section of the screen, then search within that image region for other things

so at first I'm setting a relatively large area to search

largeArea = Region(149,108,1621,645)

if largeArea.exists(image):

Now i'd like to find the location of the image and set a new region around this image (lets say newRegion)

so moving forward I'd like to search just within the (newRegion) area and look for other things

I'm doing this so it cuts the search region into something much smaller to find it quickly for the next set of searches.

I hope that makes sense, thank you

Question information

Language:
English Edit question
Status:
Solved
For:
Sikuli Edit question
Assignee:
No assignee Edit question
Solved by:
RaiMan
Solved:
2020-07-13
Last query:
2020-07-13
Last reply:
2020-07-12
Best RaiMan (raimund-hocke) said : #1

if largeArea.exists(image):
    largeAreaRegion = largeArea.getLastMatch()
    largeAreaRegion.highlight(2) # only for proving

xyz_User (userseven) said : #2

Thanks RaiMan, that solved my question.