Re: [Sikuli-driver] [Question #673704]: How to get program to capture part of the App.focusedWindow()?

2018-09-16 Thread Winnie Hsu
Question #673704 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/673704

Status: Answered => Solved

Winnie Hsu confirmed that the question is solved:
Thanks RaiMan, that solved my question.

-- 
You received this question notification because your team Sikuli Drivers
is an answer contact for Sikuli.

___
Mailing list: https://launchpad.net/~sikuli-driver
Post to : sikuli-driver@lists.launchpad.net
Unsubscribe : https://launchpad.net/~sikuli-driver
More help   : https://help.launchpad.net/ListHelp


Re: [Sikuli-driver] [Question #673704]: How to get program to capture part of the App.focusedWindow()?

2018-09-13 Thread Winnie Hsu
Question #673704 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/673704

Status: Answered => Open

Winnie Hsu is still having a problem:
The output makes me confused.  Why screenshot Masked matches score
max/min below 0.8, the image is same as  shotMasked. But shotMasked's
score is so higher.

The Output is :
# searching for: (1536898174.png) original image

found: 1 matches score max/min: 0.7643 / 0.7643

# searching for: (P(test20180914-1.png) S: 0.7 masked) masked with
other image (image-masked)

found: 1 matches score max/min: 0.9995 / 0.9995

# searching for:
(P(D:/Sikuli1.1.3/Reports/Screenshot/test20180914.png) S: 0.7 masked)
masked with screen image (image-masked)

found: 1 matches score max/min: 0.7790 / 0.7790
---

My Code is as Follows:

some_region = App.focusedWindow()
imgabc = capture(some_region)
screenshotsDir = "D:\Sikuli1.1.3\Reports\Screenshot"
shutil.move(imgabc, os.path.join(screenshotsDir, "test"+ 
time.strftime('%Y%m%d') +".png"))
wait(1)  
#baseimg = os.path.join(screenshotsDir, "test"+ time.strftime('%Y%m%d') +".png")
baseimg = os.path.join(screenshotsDir, "test20180914.png")
wait(1)  
shot = "1536898174.png"
shotA = "test20180914-1.png"
# image with black/white parts useable as mask
shotMask = "bbb-1.png"

wait(5)

# Image masked with black/white image shotMask (image-masked)
shotMasked = Pattern("test20180914-1.png").mask(shotMask)
shotMaskedscreen = Pattern(baseimg).mask(shotMask)
# find the search area
# the image shot-tile-small.png must be visible on screen
reg = None
for match in findAllList(shot):
if reg: reg = reg.union(match)
else: reg = match
if reg:
reg = reg.grow(0)
reg.highlight(2, "green")
else:
print "search area not visible"
exit(-1)

# a generalized function for this demonstration
def search(image, descr = ""):
print "# searching for: (%s) %s" % (image, descr)
matches = reg.findAllList(image)
if len(matches) > 0:
scoreMax = 0
scoreMin = 1
for match in matches:
match.highlight()
score = match.getScore()
if score > scoreMax: 
scoreMax = score
if score < scoreMin: 
scoreMin = score
print "found: %d matches score max/min: %.4f / %.4f" % (len(matches), 
scoreMax, scoreMin)
else:
print "found: no matches"
wait(2)
highlightOff()

# showcase original image
search(shot, "original image")

# showcase image-masked
search(shotMasked, "masked with other image (image-masked)")
search(shotMaskedscreen, "masked with screen image (image-masked)")

-- 
You received this question notification because your team Sikuli Drivers
is an answer contact for Sikuli.

___
Mailing list: https://launchpad.net/~sikuli-driver
Post to : sikuli-driver@lists.launchpad.net
Unsubscribe : https://launchpad.net/~sikuli-driver
More help   : https://help.launchpad.net/ListHelp


Re: [Sikuli-driver] [Question #673704]: How to get program to capture part of the App.focusedWindow()?

2018-09-13 Thread Winnie Hsu
Question #673704 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/673704

Status: Answered => Open

Winnie Hsu is still having a problem:
sorry, It's hard for me to understand how to specify a specific area in the 
app, when that area's background has been changed. But thank you so much!  
--With 1.1.4 you have the masking feature, that allows to ignore parts of the 
image when searching.
pImg = Pattern(someOtherImage).mask(ImageOrPattern)
Does this have an example?  I try to use, but failed.

-- 
You received this question notification because your team Sikuli Drivers
is an answer contact for Sikuli.

___
Mailing list: https://launchpad.net/~sikuli-driver
Post to : sikuli-driver@lists.launchpad.net
Unsubscribe : https://launchpad.net/~sikuli-driver
More help   : https://help.launchpad.net/ListHelp


Re: [Sikuli-driver] [Question #673704]: How to get program to capture part of the App.focusedWindow()?

2018-09-11 Thread Winnie Hsu
Question #673704 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/673704

Status: Answered => Open

Winnie Hsu is still having a problem:
oh, thanks.  I don't want to compare entire app, cause a part of area will 
always change. I want to compare another area to confirm a button is clickable 
and work well. 
My English is bad, hope somebody can understand :(   
I try to adjust the similar to ignore the always changed part, but sometimes 
the result is wrong. I don't use region because can't make sure that the window 
is always in the same range.

-- 
You received this question notification because your team Sikuli Drivers
is an answer contact for Sikuli.

___
Mailing list: https://launchpad.net/~sikuli-driver
Post to : sikuli-driver@lists.launchpad.net
Unsubscribe : https://launchpad.net/~sikuli-driver
More help   : https://help.launchpad.net/ListHelp


[Sikuli-driver] [Question #673704]: How to get program to capture part of the App.focusedWindow()?

2018-09-10 Thread Winnie Hsu
New question #673704 on Sikuli:
https://answers.launchpad.net/sikuli/+question/673704

How to decrease the size captured?  the app is 1200x720, but I just want to 
capture 800x600 to compare them, Thanks in advance!

My Code is as Follows:

some_region = App.focusedWindow()
imgabc = capture(some_region)
screenshotsDir = "D:\Sikuli1.1.3\Reports\Screenshot"
shutil.move(imgabc, os.path.join(screenshotsDir, "A.png"))  
  
wait(1)  

baseimg = os.path.join(dir, "A.png")

wait(10)  
img = os.path.join(dir, "B.png")
shutil.move(capture(some_region), img)

f = Finder(baseimg)

f.find(Pattern(img).similar(0.85)) 
if f.hasNext():
print "Image is matching"
else:
print "Image is not matching"
f.destroy()

-- 
You received this question notification because your team Sikuli Drivers
is an answer contact for Sikuli.

___
Mailing list: https://launchpad.net/~sikuli-driver
Post to : sikuli-driver@lists.launchpad.net
Unsubscribe : https://launchpad.net/~sikuli-driver
More help   : https://help.launchpad.net/ListHelp


Re: [Sikuli-driver] [Question #673647]: How would I stop a while loop after n amount of time?

2018-09-10 Thread Winnie Hsu
Question #673647 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/673647

Status: Answered => Solved

Winnie Hsu confirmed that the question is solved:
Thanks RaiMan, that solved my question.

-- 
You received this question notification because your team Sikuli Drivers
is an answer contact for Sikuli.

___
Mailing list: https://launchpad.net/~sikuli-driver
Post to : sikuli-driver@lists.launchpad.net
Unsubscribe : https://launchpad.net/~sikuli-driver
More help   : https://help.launchpad.net/ListHelp


[Sikuli-driver] [Question #673647]: How would I stop a while loop after n amount of time?

2018-09-10 Thread Winnie Hsu
New question #673647 on Sikuli:
https://answers.launchpad.net/sikuli/+question/673647

how would I stop a while loop after 20 seconds if it does not achieve what I 
want it to achieve.

like this:

from interruptingcow import timeout
try:
with timeout(60*5, exception=RuntimeError):
while True:
except RuntimeError:
pass


My Code is as Follows:
while not exists(A.png):   #A.png=
mouseMove(B.png)   #B.png=PLUS
mouseDown(Button.LEFT) 
else:
print("check!")
mouseUp()

p.s. I want to add from 0 until , and don't want use click instead 
mouseDown, 
hope someone can help me, thanks.


-- 
You received this question notification because your team Sikuli Drivers
is an answer contact for Sikuli.

___
Mailing list: https://launchpad.net/~sikuli-driver
Post to : sikuli-driver@lists.launchpad.net
Unsubscribe : https://launchpad.net/~sikuli-driver
More help   : https://help.launchpad.net/ListHelp


Re: [Sikuli-driver] [Question #176005]: [HowTo] Nice unit test runner with html output

2018-09-05 Thread Winnie Hsu
Question #176005 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/176005

Winnie Hsu posted a new comment:
Can't access this modified version link either.  How can i get this file?  
thanks.
https://dl.dropboxusercontent.com/u/42895525/HTMLTestRunner.zip

-- 
You received this question notification because your team Sikuli Drivers
is an answer contact for Sikuli.

___
Mailing list: https://launchpad.net/~sikuli-driver
Post to : sikuli-driver@lists.launchpad.net
Unsubscribe : https://launchpad.net/~sikuli-driver
More help   : https://help.launchpad.net/ListHelp