can sikuli search in a rectangular frame?

Asked by rob

suppose there are some images of framed paintings, and i want to determine which images have matching frames. there may or may not duplicate paintings in the set of images. how would i set a region to be shaped like a rectangular frame? or how can i compare the edges of an image?

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:
Revision history for this message
Best RaiMan (raimund-hocke) said :
#1

In Sikuli currently region and images to search can only be compound rectangular areas.

If you want to check, wether a rectangular frame around a rectangular area (whose content does not matter in the first place), then you have to search in the edge areas with according images.

In many cases it might be sufficient, to only search one edge area to decide, that the whole frame matches. And it might be sufficient to capture only a small part of the frame as search image.

fr = some_region # the outer shape of the frame
frw = 50 # the frame width - supposed to be even at all 4 edges

frl = fr.left(1).right(frw) # the left edge area
frt = fr.above(1).below(frw) # the top edge area
...

Revision history for this message
rob (reg82) said :
#2

Thanks RaiMan, that solved my question.