extreme edge effects with Gaussian filters
Posted by
Jeremy Adler-2 on
Aug 17, 2017; 9:15am
URL: http://imagej.273.s1.nabble.com/extreme-edge-effects-with-Gaussian-filters-tp5019221.html
I was playing with Gaussian filters, using images with a few dots, and noticed an extreme edge effect.
Run the code.
The dot on the edge of the image and even more markedly the dot in the corner produce disproportionate Intensities (x5 and x30 for the edge and corner).
I was expecting an edge and corner effect but not of this magnitude.
The effect increases further with larger radii.
Note the edge effect vanishes for the dot that is one pixel from the edge.
As a work around I make the images two pixels wider before running a Gaussian, but I was expecting to reduce the problem by simply halving the intensities of edge pixels and reducing corner pixels by 4.
// Gaussian filter edge problem
sz=64;
newImage("Untitled", "32-bit black", sz, sz, 1); setPixel(0,0,1);// corner setPixel(sz-1,sz/2,1);// edge setPixel(1,sz/2,1);// 1 pixel from edge setPixel(sz/2,sz/2,1);// centre run("Gaussian Blur...", "sigma=4"); run("16_colors"); getRawStatistics(n,mea,min,max); setMinAndMax(0,max/4);
--
ImageJ mailing list:
http://imagej.nih.gov/ij/list.html