<br>Hi Joel,<br><br>The WindowedSinc interpolator should have taken care of<br>removing artifacts during the resampling. IF the spectrum<br>of your image can be masked by a box in the frequency<br>domain.<br><br><br>I don't see this interpolator being used in your code at:<br>
<a href="http://cvs.creatis.insa-lyon.fr/viewvc/clitk3/filters/clitkImageResampleGenericFilter.cxx?revision=1.10&view=markup">http://cvs.creatis.insa-lyon.fr/viewvc/clitk3/filters/clitkImageResampleGenericFilter.cxx?revision=1.10&view=markup</a><br>
<br><br><br>How big are the squares of your checkerboard ?<br><br>If your input image is:<br><a href="http://www.creatis.insa-lyon.fr/~schaerer/checkerboard.png">http://www.creatis.insa-lyon.fr/~schaerer/checkerboard.png</a><br>
<br>It looks like the squares are one-pixel wide.<br>Is that the case ?<br><br><br>If so, you are addressing an unrealistic case, since no<br>possible sub-sampling will be able to maintain the <br>information of that high frequency image.<br>
<br>Think of it in the frequency domain:<br><br>Your checker board image when it gets <br>to boxes that are 1-pixel wide, is equivalent to a<br>sinusoidal function of the highest frequency.<br><br><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> ^ ^<br> | | </span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> |------------|</span><br style="font-family: courier new,monospace;">
<br><br><br>Any sub-sampling of this image will result in the<br>overlaps of the spectrum when it gets replicated<br>due to the sampling of the coarser grid.<br><br><br>Smoothing will not help here, since, there is no<br>
other frequency different from the highest ones,<br>so attenuating the high frequencies doesn't <br>results in a diminished level of frequency warping.<br><br> <br><br>BTW: This is not really an "ITK problem". :-)<br>
<br> It is an "image processing" problem. <br><br><br>ITK provides tools, but you still have to use them<br>properly and in the case where they are applicable.<br><br>We can't blame the hammer for not doing a good<br>
job of removing a screw.<br><br><br><br> Regards,<br><br><br> Luis<br><br><br>----------------------------------------------------------------------------------------------------<br><div class="gmail_quote">On Mon, Jun 14, 2010 at 3:43 AM, poireau <span dir="ltr"><<a href="mailto:joelthelion@laposte.net">joelthelion@laposte.net</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div class="im"><br>
<br>
Xiaofeng Z wrote:<br>
><br>
> Let me get the question right. You started with a uniform image and down<br>
> sampled it. The image the URL point to is the down sampled image,<br>
> correct?<br>
> What is the size of the downsized image? What software do you use to see<br>
> the checkerboard? Could the alias a result of the view software?<br>
><br>
<br>
</div>Hi Xiaofeng,<br>
<br>
No, I started with the checkerboard image I linked to (try to view it with a<br>
decent program, such as vv or even gimp), and tried downsampling it with<br>
several different methods. Using a checkerboard pattern is a good way to<br>
test a resampling algorithm, because it has a lot of high frequences.<br>
<br>
The aliasing I observe is not a result of the software I use, as I have<br>
studied the values of the individual pixels of the output image.<br>
<br>
My conclusion is that you indeed need a low-pass filter before you<br>
downsample an image. While a Gaussian filter may be OK if you want a<br>
scale-space representation, it is clearly not the best when what you want is<br>
an approximation of the original image at a lower resolution. However, since<br>
ITK doesn't seem to provide the adequate filters, I think I will have to go<br>
with the Gaussian for the time being.<br>
<a href="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" target="_blank">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</a><br>
This article , by a guy working for Apple, seems to have a couple answers on<br>
the problem.<br>
<font color="#888888">--<br>
View this message in context: <a href="http://itk-insight-users.2283740.n2.nabble.com/What-is-the-correct-way-to-downsample-an-image-with-ITK-tp5167122p5176455.html" target="_blank">http://itk-insight-users.2283740.n2.nabble.com/What-is-the-correct-way-to-downsample-an-image-with-ITK-tp5167122p5176455.html</a><br>
Sent from the ITK Insight Users mailing list archive at Nabble.com.<br>
</font><div><div></div><div class="h5">_____________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at<br>
<a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Kitware offers ITK Training Courses, for more information visit:<br>
<a href="http://www.kitware.com/products/protraining.html" target="_blank">http://www.kitware.com/products/protraining.html</a><br>
<br>
Please keep messages on-topic and check the ITK FAQ at:<br>
<a href="http://www.itk.org/Wiki/ITK_FAQ" target="_blank">http://www.itk.org/Wiki/ITK_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.itk.org/mailman/listinfo/insight-users" target="_blank">http://www.itk.org/mailman/listinfo/insight-users</a><br>
</div></div></blockquote></div><br>