return of find() unlike Subregion().inside().find()
Bug #518011 reported by
RaiMan
This bug affects 2 people
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
SikuliX |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
find() returns the first/best Match. If you want to work with the Matches, you have to use find.regions.
If you use Subregion(
Subregion(
This is confusing and not straight forward.
find() and Subregion(
tags: | added: 0.10 api |
Changed in sikuli: | |
milestone: | none → 0.10.0 |
To post a comment you must log in.
# ------- ------- ------- ------- ----- a script to test it
img =( ) # its the apple logo ;-)
# standard find whole screen
tf = find(img)
print tf
print ">>> with find: x = "+str(tf.getX())
# standard find upper left corner only, match from find.region ).find( img)
ts = Subregion(0, 0, 200, 200).inside(
ts = find.region
print ts
print ">>> with find_inside_region using find.region: x = "+str(ts.getX())
# standard find upper left corner only, using mach directly ).find( img)
ts = Subregion(0, 0, 200, 200).inside(
print ts
print ">>> with find_inside_region using find.region: x = "+str(ts.getX())
# ------- ------- ------- ------- ----- the result Rectangle[ x=0,y=0, width=1920, height= 1200] var/folders/ C9/C9+A8gl7F9GR QtCP6jc+ VU+++TI/ -Tmp-/sikuli877 320193828907184 2.png csail.uid. SikuliScript@ 10b755d Rectangle[ x=0,y=0, width=200, height= 200] var/folders/ C9/C9+A8gl7F9GR QtCP6jc+ VU+++TI/ -Tmp-/sikuli877 320193828907184 2.png csail.uid. SikuliScript@ 10b755d Rectangle[ x=0,y=0, width=200, height= 200] var/folders/ C9/C9+A8gl7F9GR QtCP6jc+ VU+++TI/ -Tmp-/sikuli254 707864392250391 3.png] C9/C9+A8gl7F9GR QtCP6jc+ VU+++TI/ -Tmp-/sikuli- tmp335193976208 1648958. py", line 17, in ?
capture: java.awt.
1 matches found
Match[470,122-25x24 1,00]@/
>>> with find: x = 470
[sikuli] SubregionJ: 0,0,200,200 edu.mit.
capture: java.awt.
1 matches found
Match[470,122-25x24 1,00]@/
>>> with find_inside_region using find.region: x = 470
[sikuli] SubregionJ: 0,0,200,200 edu.mit.
capture: java.awt.
1 matches found
[Match[16,1-25x24 1,00]@/
[sikuli] [Error] source lineNo: 17
[sikuli] [Error] Traceback (innermost last):
File "/var/folders/
AttributeError: getX