[SciPy-user] ndimage.convolve behaviour?

Robert Kern robert.kern@gmail....
Tue Jun 23 14:38:49 CDT 2009


On Tue, Jun 23, 2009 at 14:35, David Warde-Farley<dwf@cs.toronto.edu> wrote:
> On 23-Jun-09, at 5:54 AM, Stéfan van der Walt wrote:
>
>> Convolution flips the filter around, unlike correlation, so you are
>> seeing:
>>
>> (X[:5, :5] * np.fliplr(np.flipud(fm.filter))).sum()
>
>
> Ah, thanks. Is there some reason/convention for this that I'm unaware
> of?

Yes. Convolution flips the filter around and correlation doesn't.
That's the convention. :-)

> Should this be documented somewhere?

Oh, probably.

-- 
Robert Kern

"I have come to believe that the whole world is an enigma, a harmless
enigma that is made terrible by our own mad attempt to interpret it as
though it had an underlying truth."
  -- Umberto Eco


More information about the SciPy-user mailing list