[SciPy-user] problems with ndimage spline filtering

Zachary Pincus zpincus@stanford....
Wed Mar 14 09:31:50 CDT 2007


Hello folks,

I've started to use the ndimage package in scipy, and had noticed  
that I got really ugly results from image interpolation with spline  
orders greater than 1.

I tracked this down to the 'pre-filtering' step with  
scipy.ndimage.spline_filter, which is (I presume) supposed to smooth  
out the image signal so that splines with large support can be used  
for interpolation.

Unfortunately, this function doesn't smooth anything; instead it  
appears to introduce very strong ringing artifacts (and not much  
else). I've attached example images, filtered with orders 2, 3, and  
4. The ringing is extremely pronounced on the piecewise-constant  
image (input2.png), but even for natural, continuous tone images  
(e.g. input1.png) there is a big problem.

Here are examples:
http://www.stanford.edu/~zpincus/spline.html

Note that in all cases, the image was processed as 64-bit floating  
point before clamping to 8-bit for output, so this isn't likely to be  
a precision problem. the filter command I used was:
 >>> filtered = scipy.ndimage.spline_filter(input_array, order=n)
where n varied.

Is this the expected results? Does anyone have any idea what's going  
on here?

Thanks,
Zach Pincus

Program in Biomedical Informatics and Department of Biochemistry
Stanford University School of Medicine




More information about the SciPy-user mailing list