a function to find with lower similarity (code snippet)
Basically a wrapper for an auto de-focus method. I wanted to pass in an image and have a method automatically adjust it's percent of recognition. figured i would share it and see what comments and suggestions i would get. One i have though of right now just stitting here i would like to pass the gui's own region method as is with out having to key in the actual numbers.
class unFocus():
def target(self, image, percentmatch=0.70, regionlist=
"""This method aquires an object. It gives four chances to find and image starting with 70 percent match and degrading by 10 percent each loop.
The regionlist variable is optional, if you don't supply cordinates it will default with the screen cordinates. The off center click is optional too"""
if regionlist=
regionlist=
cannotfind = 0
while True:
if Region(
return Region(
else:
if cannotfind ==4:
return False
#return popup("
percentmatch = percentmatch-10
cannotfind = cannotfind+1
Question information
- Language:
- English Edit question
- Status:
- Solved
- For:
- SikuliX Edit question
- Assignee:
- No assignee Edit question
- Solved by:
- RaiMan
- Solved:
- Last query:
- Last reply: