[SciPy-User] Difference in quality from different interpolation orders

Zachary Pincus zachary.pincus at yale.edu
Thu Jun 16 11:52:24 EDT 2011


Hi Chris,

Interpolation is by definition making up data, so there's no clear way to evaluate "error induced" in the general case -- it depends on the image. You could decimate and then magnify a test image (using ndimage.zoom) and compare the that to the original to get a sense of the error from using different interpolators, say... but that's not really authoritative either since you're testing a roundtrip. Or you could just downsample the test image (not using any low-pass filtering; just do 'smaller = larger[::2,::2]') and try interpolating that back up to the original size. Or do the roundtrip the other direction...

Personally, I find that the higher-order spline filters in ndimage are prone to ringing artifacts at any sort of sharp edges, so I use order=1 almost exclusively. If your micrographs are bandlimited by the optics to something below the sensor's Nyquist frequency, you should be fine with the higher order filters. For ringing, though, it seems that visual inspection is a pretty good way to check the results.

Zach



On Jun 15, 2011, at 5:34 PM, Chris Weisiger wrote:

> Various methods in scipy use spline interpolation, and let you choose the order for the interpolation with the default being 3. I've noticed that for one task my program performs, order = 1 is about three times faster than order = 3, and visually I don't notice any decrease in data quality. However, visual inspection isn't enough. Is there some way I can measure the error introduced from using a lesser interpolation order? All else being equal, faster is better, but if it comes at a significant cost in data quality, then it's out of the question.
> 
> -Chris
> _______________________________________________
> SciPy-User mailing list
> SciPy-User at scipy.org
> http://mail.scipy.org/mailman/listinfo/scipy-user




More information about the SciPy-User mailing list