Can sikuli compare a given region on the screen with an existing database of images?

Asked by Shekhar on 2017-08-09

Hi,

I have worked with the find(image file) to find an image i have in my computer on the screen.

Does sikuli have the functionality to do the reverse - i.e. observe a given region on the screen, compare what it sees there with a set of pre-saved images and let me know if there's a match.

I have tied the Region.onAppear(), Region.onChange() objects but the look for a single specific pattern in a given region. I need my program to observe a region and compare whatever it sees with a bunch of saved images and let me know if there's a match.

Thanks
Shekhar

Question information

Language:
English Edit question
Status:
Solved
For:
Sikuli Edit question
Assignee:
No assignee Edit question
Solved by:
masuo
Solved:
2017-08-16
Last query:
2017-08-16
Last reply:
2017-08-09
Best masuo (masuo-ohara) said : #1

I think an easy way is to repeat exists() and highlight() for the number of image files.

read image folder and set image file path to list "imagelist".

r = Region(x,y,w,h)
for image in imagelist:
    m = r.exists(image)
    if m:
        m.highlight(1)

Shekhar (shekharpr10015) said : #2

Thanks masuo, that solved my question.