[Numpy-discussion] numarray bug in gaussian_filter1d?

Alexandre Guimond guim at guim.org
Thu Sep 22 08:50:08 CDT 2005


Hi.
 I think I found a bug in gaussian_filter1d.
 roughly the function creates a 1d kernel and then calls correlate1d. The
problem I see is that the kernel should be mirrored prior to calling
correlate1d since we want to convolve, not correlate.
 as a result:
 >>> import numarray.nd_image
>>> numarray.nd_image.gaussian_filter1d( ( 0.0, 1.0, 0.0 ), 1, order = 1,
axis = 0, mode = 'constant' )
array([-0.24197145, 0. , 0.24197145])
>>>
 when it should be [ 0.24197145, 0. , -0.24197145]) (notice the change in
the sign of coefficients)
 Or did I get that wrong?
 alex.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://projects.scipy.org/pipermail/numpy-discussion/attachments/20050922/cf5e5035/attachment.html 


More information about the Numpy-discussion mailing list