[Insight-users] What is the *correct* way to downsample an image with ITK?
Luis Ibanez
luis.ibanez at kitware.com
Mon Jun 14 08:12:02 EDT 2010
Hi Joel,
The WindowedSinc interpolator should have taken care of
removing artifacts during the resampling. IF the spectrum
of your image can be masked by a box in the frequency
domain.
I don't see this interpolator being used in your code at:
http://cvs.creatis.insa-lyon.fr/viewvc/clitk3/filters/clitkImageResampleGenericFilter.cxx?revision=1.10&view=markup
How big are the squares of your checkerboard ?
If your input image is:
http://www.creatis.insa-lyon.fr/~schaerer/checkerboard.png
It looks like the squares are one-pixel wide.
Is that the case ?
If so, you are addressing an unrealistic case, since no
possible sub-sampling will be able to maintain the
information of that high frequency image.
Think of it in the frequency domain:
Your checker board image when it gets
to boxes that are 1-pixel wide, is equivalent to a
sinusoidal function of the highest frequency.
^ ^
| |
|------------|
Any sub-sampling of this image will result in the
overlaps of the spectrum when it gets replicated
due to the sampling of the coarser grid.
Smoothing will not help here, since, there is no
other frequency different from the highest ones,
so attenuating the high frequencies doesn't
results in a diminished level of frequency warping.
BTW: This is not really an "ITK problem". :-)
It is an "image processing" problem.
ITK provides tools, but you still have to use them
properly and in the case where they are applicable.
We can't blame the hammer for not doing a good
job of removing a screw.
Regards,
Luis
----------------------------------------------------------------------------------------------------
On Mon, Jun 14, 2010 at 3:43 AM, poireau <joelthelion at laposte.net> wrote:
>
>
> Xiaofeng Z wrote:
> >
> > Let me get the question right. You started with a uniform image and down
> > sampled it. The image the URL point to is the down sampled image,
> > correct?
> > What is the size of the downsized image? What software do you use to see
> > the checkerboard? Could the alias a result of the view software?
> >
>
> Hi Xiaofeng,
>
> No, I started with the checkerboard image I linked to (try to view it with
> a
> decent program, such as vv or even gimp), and tried downsampling it with
> several different methods. Using a checkerboard pattern is a good way to
> test a resampling algorithm, because it has a lot of high frequences.
>
> The aliasing I observe is not a result of the software I use, as I have
> studied the values of the individual pixels of the output image.
>
> My conclusion is that you indeed need a low-pass filter before you
> downsample an image. While a Gaussian filter may be OK if you want a
> scale-space representation, it is clearly not the best when what you want
> is
> an approximation of the original image at a lower resolution. However,
> since
> ITK doesn't seem to provide the adequate filters, I think I will have to go
> with the Gaussian for the time being.
>
> http://www.google.fr/url?sa=t&source=web&cd=1&ved=0CBcQFjAA&url=http%3A%2F%2Fwww.worldserver.com%2Fturk%2Fcomputergraphics%2FResamplingFilters.pdf&ei=ad0VTKSXFtGT4gb6od3IDA&usg=AFQjCNErH2yYYjbTVImVBeDM16blDdsL1w
> This article , by a guy working for Apple, seems to have a couple answers
> on
> the problem.
> --
> View this message in context:
> http://itk-insight-users.2283740.n2.nabble.com/What-is-the-correct-way-to-downsample-an-image-with-ITK-tp5167122p5176455.html
> Sent from the ITK Insight Users mailing list archive at Nabble.com.
> _____________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Kitware offers ITK Training Courses, for more information visit:
> http://www.kitware.com/products/protraining.html
>
> Please keep messages on-topic and check the ITK FAQ at:
> http://www.itk.org/Wiki/ITK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.itk.org/mailman/listinfo/insight-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20100614/9a896cb3/attachment.htm>
More information about the Insight-users
mailing list