Re: Fill holes
Posted by Gabriel Landini on Dec 31, 2009; 12:11pm
URL: http://imagej.273.s1.nabble.com/Fill-holes-tp3689890p3689891.html
On Thursday 31 December 2009, you wrote:
> I was wondering; the 'fill holes' option in the binary submenu as well
> as filling holes in the image itself helps remove noise from the
> background too doesn't it?
Only if your background is the object (as set in the binary options).
> I ask this because I get a reduction in the
> background noise in my image when I use it.
It shouldn't fill the background. Perhaps your background is in the foreground
colour.
> I was wondering, what is the nature of the algorithm? Does it look at the
> average intensity of pixels around or something? Or am I confused somewhere?
It flood-fills the background of the image (using a temporary colour) from the
borders, so if there are holes in the object, the flooding will not reach them
(as they are completely surrounded by "object pixels"). Then a second pass
converts all the temporary (flooded) pixels into background and all the rest
into foreground (thus converting non-flooded holes into foreground).
This is implemented in the Binary.java file.
G.