Sorry it took so long for me to reply to your email.

Unfortunately, I'm not sure what the problem is here. You're correct in thinking that values shouldn't be outside of [-1, 1], but as your code demonstrates, there are apparently inputs that break the current implementation. I've played around with isolating a small test image, but I haven't had much luck.


On Wed, Nov 20, 2013 at 12:38 PM, Jon Schull <> wrote:
Greetings, we're using SciKit template_matching and getting confidence values   > 3.   Does that make sense?

A simple example with test images is attached.

Thanks for the fine work!

import numpy, sys
from skimage import data
from skimage import io
from skimage.feature import match_template

def containsLikelyhood(needleLoc, haystackLoc):
haystack = data.imread(haystackLoc, as_grey=True)
needle = data.imread(needleLoc, as_grey=True)
greyLoc  = match_template(haystack, needle)

ij = numpy.unravel_index(numpy.argmax(greyLoc), greyLoc.shape)
x, y = ij[::-1]

height, width = needle.shape
return greyLoc[y][x], (x, y, width, height)

if __name__ == "__main__":
print containsLikelyhood("locatedStar.PNG", "screenshot.PNG")

You received this message because you are subscribed to the Google Groups "scikit-image" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
For more options, visit