English 中文(简体)
改变锡克利特的敏感性?
原标题:Change Sikuli s sensitivity?

我已经使用sikuli一段时间了,但我有一个问题...它不够敏感。我试图在屏幕上匹配一个-完全相同的-东西,但屏幕上有一些其他看起来相似的东西,sikuli会把它们误认为我实际要寻找的东西,所以我需要让它仅搜索这个没有任何变化的项目。

我该怎么做?

哦,为了更详细地解释我的问题,我正在为一个游戏编写一个循环,一旦进度条达到100% - 它需要允许该循环结束(并重新开始),但进度条只是一个简单的条形图 - 因此当Sikuli在屏幕上寻找它时,它会发现部分完成的进度条(因为显然它匹配正在寻找的图像的不同长度/宽度/尺寸),并进行触发。

最佳回答

您可以在Sikuli IDE中执行以下操作:

  • Click on the image
  • In Pattern Settings > Matching Preview, drag the Similarity bar to 1.0 (all the way to the right)
  • Click OK
问题回答

If you are using Sikuli IDE click image miniature, for which you want to change sensitivity. You will be presented screenshot of your desktop with and occurrences of pattern(your image). Below there is a slider witch changes sensitivity. While changing it you will notice that highlighted occurrences of the pattern increase or decrease accordingly.
This method assumes that you have your game on screen (so windowed mode, not fullscreen), but even if you don t you still can adjust sensitivity, just you won t see live results of search.

If you call sikuli from Java code, you have to use Pattern(image.png).similar(y.xx)
where the argument of simmilar is something between 0.00 and 1.00.
I haven t used second method so you may need to experiment with it.

Will the following work?
You are looking for the progress to reach 100% then loop again?

  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:BUILDSDaily_BUILDSQA_MainBranch_Install*.install")
BuildNumber =  glob.glob("Z:BUILDSDaily_BUILDSQA_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) 




相关问题
Can Django models use MySQL functions?

Is there a way to force Django models to pass a field to a MySQL function every time the model data is read or loaded? To clarify what I mean in SQL, I want the Django model to produce something like ...

An enterprise scheduler for python (like quartz)

I am looking for an enterprise tasks scheduler for python, like quartz is for Java. Requirements: Persistent: if the process restarts or the machine restarts, then all the jobs must stay there and ...

How to remove unique, then duplicate dictionaries in a list?

Given the following list that contains some duplicate and some unique dictionaries, what is the best method to remove unique dictionaries first, then reduce the duplicate dictionaries to single ...

What is suggested seed value to use with random.seed()?

Simple enough question: I m using python random module to generate random integers. I want to know what is the suggested value to use with the random.seed() function? Currently I am letting this ...

How can I make the PyDev editor selectively ignore errors?

I m using PyDev under Eclipse to write some Jython code. I ve got numerous instances where I need to do something like this: import com.work.project.component.client.Interface.ISubInterface as ...

How do I profile `paster serve` s startup time?

Python s paster serve app.ini is taking longer than I would like to be ready for the first request. I know how to profile requests with middleware, but how do I profile the initialization time? I ...

Pragmatically adding give-aways/freebies to an online store

Our business currently has an online store and recently we ve been offering free specials to our customers. Right now, we simply display the special and give the buyer a notice stating we will add the ...

Converting Dictionary to List? [duplicate]

I m trying to convert a Python dictionary into a Python list, in order to perform some calculations. #My dictionary dict = {} dict[ Capital ]="London" dict[ Food ]="Fish&Chips" dict[ 2012 ]="...

热门标签