error in binary options help?

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

error in binary options help?

Volker Baecker
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hello,
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?

Volker
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFIRUCKxZKX7A/4oMERAqg0AJ9flPMdqk/X/1pFgIcUIZFmlxrkPQCg7GTU
ReG4vFRYoJsuYtw/ml+QBFY=
=TM41
-----END PGP SIGNATURE-----

--
passerelle antivirus du campus CNRS de Montpellier
--
Reply | Threaded
Open this post in threaded view
|

Re: error in binary options help?

Gabriel Landini
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
Reply | Threaded
Open this post in threaded view
|

Re: error in binary options help?

Michael Schmid
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
Reply | Threaded
Open this post in threaded view
|

Re: error in binary options help?

Gabriel Landini
On Tuesday 03 June 2008 14:39:14 Michael Schmid wrote:
> you are right that "opening and closing are idempotent procedures".
> Nevertheless, the "iterations" count influences the result a lot!

Oh I see, In this case the opening would be n erosions followed by n
dilations. Yes that is correct.

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

Yes, that is right, however the results are (obviously) not the same).

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

That is called "polarity". IJ is so flexible that it can sometimes become
confusing! (and I haven't mentioned Inverted LUTs! :-) )

Regards

Gabriel