[mmedgeoff] [Up] [mmcloserecth] Residues

mmcbisector
N-Conditional bisector.

Synopsis

y = mmcbisector( f, B, n )

Implemented in Python.

Input

f Image Binary image.
B Structuring Element
n Double

positive integer ( filtering rate)

Output

y Image Binary image.

Description

mmcbisector creates the binary image y by performing a filtering of the morphological skeleton of the binary image f, relative to the structuring element B. The strength of this filtering is controlled by the parameter n. Particularly, if n=0, y is the morphological skeleton of f itself.

Examples

>>> a=mmreadgray('blob2.tif')

              
>>> b=mmcbisector(a,mmsebox(),1)

              
>>> c=mmcbisector(a,mmsebox(),3)

              
>>> d=mmcbisector(a,mmsebox(),10)

              
>>> mmshow(a,b)

              
>>> mmshow(a,c)

              
>>> mmshow(a,d)

            
a,b a,c
a,d

Equation

Source Code

def mmcbisector(f, B, n):
    y = mmintersec(f,0)
    for i in range(n):
        nb = mmsesum(B,i)
        nbp = mmsesum(B,i+1)
        f1 = mmero(f,nbp)
        f2 = mmcdil(f1,f,B,n)
        f3 = mmsubm(mmero(f,nb),f2)
        y  = mmunion(y,f3)
    return y
    

See also

mmfreedom Control automatic data type conversion.
mmskelm Morphological skeleton (Medial Axis Transform).
mmthin Image transformation by thinning.
[mmedgeoff] [Up] [mmcloserecth] Python