Login  Register

Re: error in binary options help?

Posted by Michael Schmid on Jun 03, 2008; 1:39pm
URL: http://imagej.273.s1.nabble.com/error-in-binary-options-help-tp3696081p3696083.html

Hi Gabriel,

you are right that "opening and closing are idempotent procedures".
Nevertheless, the "iterations" count influences the result a lot!

If the iteration count is n, ImageJ applies "dilate" n times,
then "erode" n times (or reverse, depending on whether it is
"open" or "close".
This is very different from doing the full "open" or "close"
operation n times!


A side remark - for large iteration counts, it is faster to
use Process>Filters>Minimum and Process>Filters>Maximum instead
of "dilate" and "erode".
These operations also have the advantage that they have a
circular, not a square kernel, which is usually desirable.

The downside: there is not 1:1 correspondence, it depends on
the setting of "black background" whether "Dilate" is Maximum" or
"Minimum".


Michael
________________________________________________________________

On 3 Jun 2008, at 15:22, Gabriel Landini wrote:

> On Tuesday 03 June 2008 14:00:58 Volker Bäcker wrote:
>> The help text for the binary options on
>> http://rsb.info.nih.gov/ij/docs/menus/process.html#binary
>> reads
>>
>> "Iterations specifies the number of times erosion, dilation, opening,
>> and closing are performed."
>>
>> In my opinion this is wrong, or at least very confusing. It should
>> rather be something like:
>>
>> "Iterations specifies the number of erosions and/or dilations  
>> executed
>> when one of the operations erosion, dilation, open or close is run."
>>
>> Maybe I'm missing something here?
>
> You are correct, I guess that the wording is a bit confusing.
>
> Furthermore, opening and closing are idempotent procedures. After  
> applying
> them once, the image does not change anymore, so this can safely  
> restricted
> to dilation and erosion only (so there is no point in doing more  
> than 1
> closing or opening on the same image).
>
> Now that we are discussing morphological operations...  A colleague  
> here in
> Bham (David Randell) noted that the strict definition of erosion is  
> not what
> ImageJ returns. ImageJ erodes the borders of an image too, and this  
> is not
> the dual of the dilation.
>
> This may, nevertheless, be useful sometimes, and some other imaging  
> packages
> do it this way as well.
>
> To perform an exact erosion (that does not process the borders) one  
> needs to
> do:
> invert,
> dilate,
> invert.
>
> This way, the borders are not eroded.
>
> Regards,
>
> Gabriel