[Numpy-discussion] nd_image.affine_transform edge effects

Zachary Pincus zpincus at stanford.edu
Fri Mar 23 02:20:37 EDT 2007


Hello all,

> By the way, ringing at sharp edges is an intrinsic feature of higher-
> order spline interpolation, right? I believe this kind of interpolant
> is really intended for smooth (band-limited) data. I'm not sure why
> the pre-filtering makes a difference though; I don't yet understand
> well enough what the pre-filter actually does.
>
> I'm not sure what people normally do in computer graphics, since I'm
> working more with natural band-limited images, but in the case of
> Stefan's "rotate_artifacts" example, wouldn't it be appropriate to
> use the 1st- or 0th-order spline instead of the 2nd order? If your
> real-life data are smooth enough, however, then in theory the
> ringing with higher orders should go away.

James is indeed correct. This whole thing is my mistake based on a  
mis-interpretation of terminology. I've more carefully re-read the  
paper on which the ndimage spline code is based ('Splines: A Perfect  
Fit for Signal/Image Processing' by Michael Unser; it's on citeseer).  
I now (hopefully) understand that the spline "pre-filter", while  
explicitly analogous to a traditional anti-aliasing pre-filter, is  
actually computing the spline coefficients via a filtering-type  
operation. While a traditional anti-aliasing filter should blur an  
image (as a band-limiting step), the fact that the anti-aliasing pre- 
filter does not is of no concern since the filtered output isn't a  
band-limited set of pixels, but a set of coefficients for a band- 
limited spline.

The actual transform operators then use these coefficients to  
(properly) compute pixel values at different locations. I just  
assumed that the "pre-filtering" was broken (even on natural images  
with smooth variations) because images pre-filtered with the spline  
filter didn't look like traditional pre-filtered images ought.

IMO, ticket 213 should be closed as PEBCAK (I'll do that forthwith);  
further I'm sorry to have caused Peter to be further bothered about  
this non-issue.

Zach






On Mar 22, 2007, at 8:13 PM, James Turner wrote:

> By the way, ringing at sharp edges is an intrinsic feature of higher-
> order spline interpolation, right? I believe this kind of interpolant
> is really intended for smooth (band-limited) data. I'm not sure why
> the pre-filtering makes a difference though; I don't yet understand
> well enough what the pre-filter actually does.
>
> I'm not sure what people normally do in computer graphics, since I'm
> working more with natural band-limited images, but in the case of
> Stefan's "rotate_artifacts" example, wouldn't it be appropriate to
> use the 1st- or 0th-order spline instead of the 2nd order? If your
> real-life data are smooth enough, however, then in theory the
> ringing with higher orders should go away.
>
> Sorry if I'm stating the obvious and missing the real point! I just
> wanted to make sure this hasn't been overlooked... Likewise, sorry I
> didn't mention this before if it does turn out to be relevant. Let
> me know if you want references to explain what I said above.
>
> James.
>
> _______________________________________________
> Numpy-discussion mailing list
> Numpy-discussion at scipy.org
> http://projects.scipy.org/mailman/listinfo/numpy-discussion




More information about the NumPy-Discussion mailing list