[SciPy-user] Ignoring pixels with gaussian_filter

Thomas Robitaille thomas.robitaille@gmail....
Fri May 1 19:49:31 CDT 2009


Thanks a lot for pointing this out! In the end I've used this property  
and implemented a fortran routine to do the smoothing, wrapped using  
f2py. The resulting routine is almost as fast as the default  
gaussian_filter from scipy.

Cheers,

Thomas

On 24 Apr 2009, at 23:51, alex wrote:

> Thomas Robitaille wrote:
>> ...
>> # define gaussian function
>> def gaussian(cx, cy, w):
>>     return lambda x,y: np.exp(-(((cx-x)/w)**2+((cy-y)/w)**2)/2)
>> ...
>
> A neat mathematical property of gaussian blur that is not true of 2d
> kernels in general is that it can be applied to the x and y axes
> separately.  That is, it can be implemented as two 1d passes instead  
> of
> one 2d pass.  This could speed up your code a lot if you aren't  
> already
> doing it.
>
> Alex
> _______________________________________________
> SciPy-user mailing list
> SciPy-user@scipy.org
> http://mail.scipy.org/mailman/listinfo/scipy-user



More information about the SciPy-user mailing list