I have an image (10000x10000 pixels) and I have a kernel (5x5 pixels). I want to find the place(s) in the image that best matches the kernel.
I vaguely remember from my studies that I need to compute a correlation coefficient for each pixel in the large image with respect to the kernel. But having something like (10000 - 4) * (10000 - 4) pixels to go through, I expect to get a huge performance hit doing this in python
.
Having only a very brief knowledge on the subject I was hoping to find something in either numpy
or scipy
that would do this relatively fast, but I haven't been able to find anything.
Does either numpy
or scipy
contain a method for doing this?