[SciPy-user] ndimage.convolve behaviour?

Stéfan van der Walt stefan@sun.ac...
Mon Jun 29 05:14:02 CDT 2009

2009/6/29 David Cournapeau <david@ar.media.kyoto-u.ac.jp>:
> David Warde-Farley wrote:
>> So the only difference is which direction the axes are read? Odd. Is
>> this a convention in other packages too?
> That's more than a convention: that's the definition of the operations.
> Although the effect on signals often is similar, the underlying
> mathematical operation is quite different. For example convolution is a
> commutative operator, whereas correlation isn't. I guess it depends on
> the background, but for anyone with a bit of EE background, there is no
> ambiguity at all I guess.

You can think of a convolution as calculating the response of a system
g(x) on a signal f(x).  Since the first values of f(x) (i.e., at x=0)
are the first values to enter the system g(x), when doing convolution
you need to flip f(x) around before moving it across.  See


for a nice illustration.


More information about the SciPy-user mailing list