Finder - how to match multiple sub-images within a captured image --- currently not possible
Attempting to scan a previously saved screen capture. The screen capture contains multiple (similar) blocks of data. Each block contains three fields. Field 1 is a unique identifier, Field 2 will vary and must be ignored, Field 3 contains the content that will pass/fail this test step, but that content can also appear in other blocks of data.
Desired Algorithm Pseudo Code:
full_block = Pattern( "image1.png" ).similar(0.70) # image of block to find
field1 = Pattern(
field2 = Pattern(
field3 = Pattern(
f = Finder( "path\previousl
f.findAll(
while f.hasNext():
current_match = f.next()
if current_match.find( field1 ):
# We've uniquely the block, check unique identifier field1
if current_
else:
# We can exit now because we found unique identifier field1
break
else:
# no match on unique identifier field 1, this means current_match is a different block, so skip to the next one
This style of code works when using the Screen as the target of the find commands, but doesn't appear to work when using a previously saved image of the screen as the target. Any ideas on how to accomplish something similar? If my example isn't clear enough please let me know.
Question information
- Language:
- English Edit question
- Status:
- Answered
- For:
- SikuliX Edit question
- Assignee:
- RaiMan Edit question
- Last query:
- Last reply:
Can you help with this problem?
Provide an answer of your own, or ask Ryan Paterson for more information if necessary.