Which makes faster scans, increasing or decreasing similarity

Asked by Raymond

Does increasing the similarity scale or decreasing produce faster find and exists operations? Even if it's a few milliseconds, I need to know.

Thanks.

Question information

Language:
English Edit question
Status:
Answered
For:
SikuliX Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
RaiMan (raimund-hocke) said :
#1

I made this test:

x = 50
for s in [0.2, 0.99]:
 start = time.time()
 for i in range(20):
  m = find(Pattern("some_image.png").similar(s))
 print '***', s, (time.time()-start)*1000/x

 m.highlight(2)

In general, it seems to be, that searching with 0.2 is faster than searching with 0.99 (the match always has a similarity of 1.0). The difference increases with increased size of the searched image.

e.g. searching on a screen of 1280x800 in average an image of 600 x 500 is matched at 0.2 after 350 msec and with 0.99 after 750 msec. - with 100 x 150 it is about 130 to 150.

But be aware, lowering the min similarity increases the risk to match the wrong object.

one more thing:
the best way to speed up searches is to make the region of interest as small as possible.

Revision history for this message
RaiMan (raimund-hocke) said :
#2

I have to correct the absolute values, since there is a "bug" in the script:

x = 50
for s in [0.2, 0.99]:
 start = time.time()
 for i in range(x):
  m = find(Pattern("some_image.png").similar(s))
 print '***', s, (time.time()-start)*1000/x

 m.highlight(2)

e.g. searching on a screen of 1280x800 in average an image of 600 x 500 is matched at 0.2 after 1.1 sec and with 0.99 after 2.3 sec.

Can you help with this problem?

Provide an answer of your own, or ask Raymond for more information if necessary.

To post a message you must log in.