题
我一直在使用sikuli一段时间,但是我有一个问题。它不够灵敏。我想要匹配的东西在屏幕上就是精确的和有几个其他的项目在屏幕上看起来足够相似,sikuli是把他们误认为我实际上要找的,所以我需要让它看起来只有这个项目没有差异。
我怎么可以这样做?
哦,解释我的问题一点还有,我写一个循环的一个游戏,一旦取得进展吧已经达到了100%,它需要允许回路完成(并重新开始),但是取得的进展吧只是一个普通的酒吧-那当sikuli看起来对它在屏幕上发现的该部分完成条(因为显然这比赛不同长度/宽度/大小的图像,它正在寻找)和触发器。
解决方案
你可以做如下的Sikuli IDE:
- 点击图片
- 在图案设置>匹配的预,拖的相似性条1.0(所有方式的权利)
- 点击OK
其他提示
如果您使用Sikuli IDE点击图像微型,为此要更改的灵敏度。您将看到您的桌面屏幕快照和事件的图案(图像)的。下面有一个滑块女巫变化的敏感性。虽然改变它,你会发现,高亮模式增长出现相应的增减。结果 此方法假定你有你的屏幕上的游戏(所以窗口模式下,非全屏),但即使你没有,你仍然可以调节灵敏度,只是你不会看到搜索的“活”的结果。
如果您从Java代码中调用sikuli,你必须使用Pattern(image.png).similar(y.xx)
结果
其中simmilar的参数是0.00和1.00之间的事情。结果
我还没有使用第二方法因此可能需要与它进行试验。
请问以下工作?点击 您正在寻找的进度达到,然后100%循环再?
f = open("C:\\test.htm",'W')
f.write('<font color="#347C2C">lOOPtEST</font><br />')
f.write('loop iteration' + (str (count)) + '<br />')
count = count + 1
f.close()
COUNT =10
POPUP("LOOPTEST")
//image compare from progress bar
import sikuli.Sikuli *
WebPath =('Z:\\ZZZautomation\\Web\\')
BuildPath = ("Z:\BUILDS\Daily_BUILDS\QA_MainBranch_Install\*.install")
BuildNumber = glob.glob("Z:\BUILDS\Daily_BUILDS\QA_MainBranch_Install\*.install")
for filename in BuildNumber:
SmokeTestInfo = "SmokeTest_Build " + filename[45:50] + " Iteration 44"+".htm"
global Number
Number = filename[45:50]
global SmokeTest
SmokeTest = SmokeTestInfo
global count
count = 0
defMidProgress():
while not exists ("//path to image of progress bar @ 50%//",FOREVER)
//or
wait("//path to image of progress bar @ 50%//", FOREVER)
//using forevEr means sikuli will checK FOR 50% PROGRESS FOREVER
//the bottom execures once the condition above is met
open(WebPath + SmokeTest,'w')
f.write('<font color="#0000FF">Progress is at 50%</font><br />')
f.close()
// writes entry to html log fie
defFinalProgress():
while not exists ("//path to image of progress bar @ 100%//",FOREVER)
//or
wait("//path to image of progress bar @ 100%//", FOREVER)
//using forever means sikuli will check FOR 100% PROGRESS FOREVER
//the bottom execures once the condition above is met
open(WebPath + SmokeTest,'a')
f.write('<font color="#0000FF">Progress is at 100%</font><br />')
f.close()
// writes entry to html log fie
def Loop
count =0
def midProgress():
def FinalProgress():
要匹配我使用精确图像:
image1 = ("image1.png")
while not exists (Pattern(image1).exact()):
# Wait until that exact image appears.
wait(1)
不隶属于 StackOverflow