Goodluck making something faster than ndimage without considerable effort (I've already tried in Cython and was 10x slower). I read the ndimage source and it goes to great lengths to make optimum use of the cpu cache by allocating line buffers etc...
2011/4/19 Stéfan van der Walt <stefan@sun.ac.za>:
> Apparently, neither of these routines like integer images as inputsTo be more specific, scipy.ndimage.convolve does not upcast
> (should be mentioned in the docs). Here's the output for float
> images:
appropriately when convolving integer arrays with floating point
arrays. This alone seems like a good enough reason to have our own
version, although I agree that we should use the 1D separated filters.
It doesn't look as if there is an easy way to coerce numpy.convolve to
do the job, so I guess I should write something in Cython?
Regards
Stéfan