[SciPy-User] Difference in quality from different interpolation orders
David Baddeley
david_baddeley at yahoo.com.au
Thu Jun 16 17:46:55 EDT 2011
I'd have to disagree with Zach on the making up data count. If you've got
microscopy images, you know that the original data is band limited, and can in
theory reconstruct it perfectly from your samples (assuming you've satisfied
Nyquist). To do this you'd theoretically have to use sinc interpolation, but as
this is computationally expensive (and only valid on an infinite interval) most
people approximate with cubic-spline instead. In a lot of circumstances, linear
will be sufficient, but it depends very much on the application - one nasty
feature of linear interpolation is that the derivative is
discontinuous, whereas for cubic spline it is guaranteed to be continuous. What
are you trying to do with the images that makes the speed difference so
important? The other thing you've got to watch with microscopy images is the
noise ....
cheers,
David
________________________________
From: Chris Weisiger <cweisiger at msg.ucsf.edu>
To: SciPy Users List <scipy-user at scipy.org>
Sent: Fri, 17 June, 2011 3:59:06 AM
Subject: Re: [SciPy-User] Difference in quality from different interpolation
orders
On Thu, Jun 16, 2011 at 8:52 AM, Zachary Pincus <zachary.pincus at yale.edu>wrote:
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.
>
>
Okay, thanks for that information. Interesting that higher-order interpolations
could actually make the problem worse. I'd assumed that "higher order == more
accurate" would hold true, but I guess it makes sense that for sharply
discontinuous inputs, that breaks down.
I'm still very much inexperienced when it comes to scientific programming; I've
only really done application programming and graphical work before. There's a
lot of new background knowledge I have to get for many of these projects...
-Chris
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.scipy.org/pipermail/scipy-user/attachments/20110616/179b1d2f/attachment.html>
More information about the SciPy-User
mailing list