[SciPy-user] Bilinear Interpolation

Stefan van der Walt stefan at sun.ac.za
Wed Sep 27 21:48:07 CDT 2006


Hi Ryan

On Wed, Sep 27, 2006 at 10:41:21AM -0500, Ryan May wrote:
> Here's some example code that demonstrates what I mean, but I think 
> Scott Sinclair hit the nail on the head in another reply.  The methods 
> are just different except in the case of 4 points, since the splines are 
> performing a global fit and the bilinear interpolation is only
> local.

Thanks for the code (and Scott for the explanation).  I also attach a
script I whipped up to demonstrate this effect on images.  If you
change the spline order from 2 to 1, you will notice weird things
happening.

For example, compare

http://mentat.za.net/refer/spline_order2.png

and

http://mentat.za.net/refer/spline_order1.png

Notice how dark the spline interpolated image of order 1 is.

Can anyone explain this?  Possibly due to pre-filtering?

Cheers
Stéfan
-------------- next part --------------
A non-text attachment was scrubbed...
Name: splint.py
Type: text/x-python
Size: 1373 bytes
Desc: not available
Url : http://projects.scipy.org/pipermail/scipy-user/attachments/20060928/bf9afd78/attachment.py 


More information about the SciPy-user mailing list