Fill holes

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Fill holes

Sinead Roberts
Dear all,

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? I ask this because I get a reduction in the  
background noise in my image when I use it. 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?

Thanks in advance for your help,
All the best for the New Year,
Sinead Roberts
Reply | Threaded
Open this post in threaded view
|

Re: Fill holes

Gabriel Landini
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.