[Insight-developers] Code Review of BinaryMorphologicalOpening/Closing

Gaëtan Lehmann gaetan.lehmann at jouy.inra.fr
Wed May 11 14:27:45 EDT 2011


Le 11 mai 11 à 19:53, Luis Ibanez a écrit :

> Hi Gatean,

Hi Luis,

>
> 2011/5/11 Gaëtan Lehmann <gaetan.lehmann at jouy.inra.fr>:
>>
>> Please look at the figures in
>> http://insight-journal.org/download/viewpdf/58/2
>>
>
> mm,
> Still doesn't make sense to me.
>
> There seems to be an underlying assumption
> that the image is not really binary, but that
> instead it contains more than two labels.

Yes, there is that assumption. Foreground is defined as the pixels  
with the value equal to m_ForegroundValue. Every pixel with another  
value is in the background.

I assume that you agree on usefulness of the pad and crop.

>
>
>>> and why are not an issue in the Opening filter, where
>>> on would expect to find a dual implementation of the
>>> Closening filter ?
>>>
>>
>> This is because this is a binary filter, so some optimisations can  
>> be made
>> for the opening.
>
>
> I'm referring in both cases to the Binary version of the filters.
> The implementation of Opening is not the dual of Closening.
>
> Why ?
>
> Are we building on the assumption that the "outside"
> of the image is supposed to be at background level ?

We have to assume that there is a value outside, but foreground or  
background without padding would both produce some border effect.

>
>
>> In grayscale, both closing and opening must have this extra padding  
>> to
>> produce border effect free result.
>>
>
> Not talking about grayscale yet...
> (we should get there soon)...
>
>>>
>>> The two extra Padding and Cropping filters are an onerous
>>> addition to the pipeline, and don't seem to be justified...
>>>
>>
>> Sure they are onerous, but needed in most of cases.
>> There is an option to disable them in case the user wants more  
>> efficiency,
>> at the cost of the border effects.
>>
>
>
> Why is this option only in the Closing filter
> and not in the Opening one ?
>
> They are supposed to be dual operations, isn't it ?
>
> Closening the foreground should produce the
> same result as Opening the background.
>
> That is, I should be able to run an Opening operation
> by using the Closing filter, and switching the values
> of Foreground and Background.


Yes, you're right.

I've assumed that the erosion can only shrink the object, but it also  
enlarge the background.
So there should also be a padding in the opening version.

Gaëtan

Gaëtan


-- 
Gaëtan Lehmann
Biologie du Développement et de la Reproduction
INRA de Jouy-en-Josas (France)
tel: +33 1 34 65 29 66    fax: 01 34 65 29 09
http://voxel.jouy.inra.fr  http://www.itk.org
http://www.mandriva.org  http://www.bepo.fr

-------------- next part --------------
A non-text attachment was scrubbed...
Name: PGP.sig
Type: application/pgp-signature
Size: 203 bytes
Desc: Ceci est une signature ?lectronique PGP
URL: <http://www.itk.org/mailman/private/insight-developers/attachments/20110511/730e7978/attachment.pgp>


More information about the Insight-developers mailing list