← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #194144]: How to make exists(img, 0.01) return immediately even if it fails --- solution: Settings.WaitScanRate

 

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

Eugene Maslov posted a new comment:
Raimund, I still face this problem, and it is reproduced in both 1.0.1
and the last version rc3

Recognizing unrecognizable texts, I need quick response about missing images, searching quickly in very small regions (10x20px in 80x30px), I hope it should not cause hardware performance problems even with high scan rates. Nevertheless, nothing helps to reduce negative response time to less than 0.3 sec, while positive response is returned within 0.02 sec. It extends the whole processes to dozens of seconds. AutoWaitTimeout, ObserveScanRate, WaitScanRate parameters seem to help to reduce to 0.3 sec, but not less.
This is the sample:

(menu_modify.png is a small screenshot of "Modify" main menu of any
program, M.png, o, d.png are just tiny characters cut out from it . I
don't know how to attach them to this message. Before start, I open
menu_modify.png in any image editor)

import time
oldsim=Settings.MinSimilarity
smallArea=SCREEN.find("menu_modify.png")
smallArea.highlight(2)
oldtimeout=smallArea.getAutoWaitTimeout()
oldrateO=Settings.ObserveScanRate
oldrateW=Settings.WaitScanRate

for i in "Modus":
    tofind=i+".png"
    
    Settings.MinSimilarity=0.95 
    smallArea.setAutoWaitTimeout(0.01)
    Settings.ObserveScanRate=100
    Settings.WaitScanRate=100
    
    starttime=time.time()
    if smallArea.exists(tofind) is not None:
        print i+" found"
    else:
        print i+" not found"
    print "elapsed for "+i+" : "+ str(time.time()-starttime)
    
    Settings.WaitScanRate=oldrateW
    Settings.ObserveScanRate=oldrateO
    smallArea.setAutoWaitTimeout(oldtimeout)    
    Settings.MinSimilarity=oldsim

This is the printed output:

M found
elapsed for M : 0.00999999046326
o found
elapsed for o : 0.00999999046326
d found
elapsed for d : 0.0199999809265
u not found
elapsed for u : 0.31500005722
s not found
elapsed for s : 0.31500005722


Are there any more parameters, allowing to reduce the time of negative exists() response?

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