-subimage-search of two grayscale images provides a correlation map, but correlation and anti-correlation cannot be distinguished. I would like a way to keep the sign of the ressemblance.
To give an example, here is a search for a bright disc (p.png) in an image containing a white and a black disc (test.png):
Code: Select all
convert -size 15x15 xc:black -fill white -draw 'circle 7,7 11,7' p.png
convert -size 100x50 xc:grey -fill white -draw 'circle 25,25 29,25' -fill black -draw 'circle 75,25 79,25' test.png
compare test.png p.png -metric NCC -subimage-search tiff:- 2>/dev/null | convert tiff:- -delete 0 show
TIA,
Adrian