[SciPy-dev] scipy.signal.convolve2d significantly slower than matlab

Tom Waite twaite at berkeley.edu
Tue Jun 17 10:53:42 EDT 2008


In addition to fftconvole, if the filter kernel is separable (Gaussian,
Sinc, difference-of-sinc), you can use the scipy.ndimage correlate1d.
Correlate1D is very fast and checks for kernel symmetry so can reduce the
number of mults. In your application script you are building a stack of
filtered images. I wrote a registration package in ndimage that has a 3D
separable filter for volume filtering prior to registration. I am about to
check in changes to the code that will include a test that shows how to get
both 3D and a stack of 2D filtered slices (which is an intermediate result
of the 3D). I typically do 3D filtering of 256x256x90 volumes and it is
under 1 second. I agree the convole2D needs to be improved for speed.

On Tue, Jun 17, 2008 at 2:27 AM, Stéfan van der Walt <stefan at sun.ac.za>
wrote:

> Hi Joel
>
> 2008/6/16 Joel Schaerer <joel.schaerer at insa-lyon.fr>:
> > I've found that the 2D convolution code in scipy is significantly slower
> than
> > matlab's. The following code:
>
> Also take a look at fftconvolve.
>
> Regards
> Stéfan
> _______________________________________________
> Scipy-dev mailing list
> Scipy-dev at scipy.org
> http://projects.scipy.org/mailman/listinfo/scipy-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/scipy-dev/attachments/20080617/eaa3e8a5/attachment.html>


More information about the SciPy-Dev mailing list