Remember the difference between a match and non match is not actually the square, but just a few pixels (the bars) which seems to get swamped by the other matching pixels.
What is wanted is some way of matching a smaller neighbourhood in the sub-image we are searching for (the bars) and have it ignore the square colors. I think the first step is to thus pre-process both sub-image and the main image to hightlight the part we are interested in (black bars).
For example fill anything that is NOT black as white, in BOTH images, before giving it to compare
afterwards you can get all matches at the same time.
Code: Select all
convert 58SetLava.gif 18greenCMD.gif -fuzz 25% -fill white +opaque black -depth 16 miff:- |
compare - -dissimilarity-threshold 1.0 -subimage-search null: