Posted by
Stephan Saalfeld on
URL: http://imagej.273.s1.nabble.com/downsampling-methods-tp3690444p3690445.html
Hi Aviva,
you should try Gaussian downsampling:
In Fiji, there is a Javascript in PLugins->Examples->downsample
explained at
http://pacific.mpi-cbg.de/wiki/index.php/Downsamplethe same Javascript is at the ImageJ website
http://rsb.info.nih.gov/ij/macros/js/Downsample.jsor, alternatively a public API method in the packages of mpicbg_.jar
that are part of Fiji, such that you can call it for a nopen Image, say,
from Plugins->Scripting->BeanshellInterpreter:
import ij.*;
import mpicbg.ij.util.Filter;
new ImagePlus( "downsampled", Filter.scale( IJ.getImage().getProcessor(),
0.2f ) ).show();
Lanczos being just an approximation of a bandpass filter in the
frequency domain, you could also try to do the downsampling directly
through that bandpass-filter, ImageJ has the respective functions.
Depends very much on what you want. For most cases, the Gaussian thing
is just optimal.
Best,
Stephan
On Mon, 2009-11-16 at 08:07 +0200, Aviva Vaknin wrote:
> Hello all!
>
> I have implemented a Lanczos8 kernel convolution to downsample images
> which works well for 30-40 iterations.
>
> After that ringing artifacts enter, even if I reduce a 1600x1200 image one
> pixel
> each iteration.
>
> Should this be occurring ? Is there a way around it ?
> Is there a better down sampling method for this type of problem ?
>
> thanks,
> aviva