[SciPy-user] strange behavior of scipy.interpolate.interp2d ?

Jean-Luc Menut jeanluc.menut@free...
Mon Mar 16 08:33:09 CDT 2009


Hello All,

I'm testing scipy.interpolate.interp2d, and it looks like there is a 
strange behavior of the 'linear' interpolation. It looks like only a 
part of the image is interpolated.

Maybe I'm mistaking, but the cubic interpolation looks fine to me.


I attach 3 examples images to this mail :
original.png is the original image, linear.png is the original image 
linearly interpolated (with twice the number of pixel of original.png) 
and cubic.png is the same but with a cubic interpolation.


here the corresponding few lines of code:

a=zeros([5,5])
x=y=arange(5)
b=scipy.interpolate.interp2d(x,y,a,'cubic') #or 'linear
xx=yy=arange(9)/2.
imshow(b(xx,yy),interpolation='nearest')


Have you any idea on what's is going on ?

Best regards,
Jean-Luc
-------------- next part --------------
A non-text attachment was scrubbed...
Name: linear.png
Type: image/png
Size: 7194 bytes
Desc: not available
Url : http://mail.scipy.org/pipermail/scipy-user/attachments/20090316/1819b100/attachment-0003.png 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: original.png
Type: image/png
Size: 6450 bytes
Desc: not available
Url : http://mail.scipy.org/pipermail/scipy-user/attachments/20090316/1819b100/attachment-0004.png 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: cubic.png
Type: image/png
Size: 7406 bytes
Desc: not available
Url : http://mail.scipy.org/pipermail/scipy-user/attachments/20090316/1819b100/attachment-0005.png 


More information about the SciPy-user mailing list