Your subsection is not terribly unique (too much white). Nevertheless, in principle, it should have worked. However, there has been an issue with proper normalization since I wrote this script and cannot figure out how to fix it. There is a caution about this in the documentation.
"# WARNING: I believe due to the way ImageMagick normalizes images internally
# to a dynamic range of 0 to 1 before doing any processing, the correlation
# surface will not generally have a perfect match score of +1, but will be
# image dependent and smaller than 1. Nevertheless, it does seem to find the
# correct best match location.
All the tests I did, seemed to find a good solution for unique subsections. See
http://www.fmwconcepts.com/imagemagick/ ... mcrosscorr
http://www.fmwconcepts.com/imagemagick/ ... /index.php
In principle a perfect match should return a value of 1. But the script is returning smaller values. With your test images, it seems to find something slightly higher in match score at some other locations, because the normalization is not working correctly.
I find the same results as you did with your example.
normcrosscorr1 -s -c white wizard_sub_130_80.png wizard.png wizard_corr.png wizard_location.png
Match Coords: (168,326) And Score In Range 0 to 1: (0.0943717)
But if I cut the input image in half, to avoid those false positives, it does find the correct results.
normcrosscorr1 -s -c white wizard_sub_130_80.png wizardhf.png wizardhf_corr.png wizardhf_location.png
Match Coords: (130,80) And Score In Range 0 to 1: (0.111959)
Strangely, the match score is higher in this case than the previous. The normalization should be independent of the size of the larger image. It does depend upon the size of the smaller image. So this is a mystery to me at the moment.
I will try to review this script further. But I am not sure I will be able to fix the normalization issue.
In the mean time I will modify the script to fix the standard deviation issue and update the warning.