[Numpy-discussion] strange behavior convolving via fft

Stéfan van der Walt stefan at sun.ac.za
Mon May 11 16:06:33 EDT 2009


Hi Chris

2009/5/11 Chris Colbert <sccolbert at gmail.com>:
> When convolving an image with a large kernel, its know that its faster to
> perform the operation as multiplication in the frequency domain. The below
> code example shows that the results of my 2d filtering are shifted from the
> expected value a distance 1/2 the width of the filter in both the x and y
> directions. Can anyone explain why this occurs? I have been able to find the
> answer in any of my image processing books.

Just as a reminder, when doing this kind of filtering always pad
correctly.  Scipy does this in

scipy.signal.fftconvolve

I've also got some filtering implemented in

http://mentat.za.net/cgi-bin/hgwebdir.cgi/filter/file/e97c0a6dd0ea/lpi_filter.py

Regards
Stéfan



More information about the NumPy-Discussion mailing list