[mmopenth] [Up] [mmskelmrec] Residues

mmskelm
Morphological skeleton (Medial Axis Transform).

Synopsis

function y = mmskelm ( f , B , option )

Input

f Image Binary image
B Structuring Element

Default: 3x3 elementary cross

option String

Default: 'binary'

Choose one of: binary: output a binary image (medial axis); value: output a grayscale image with values of the radius of the disk to reconstruct the original image (medial axis transform).

Output

y Image Gray-scale (uint8 or uint16) or binary image

Description

mmskelm creates the image y by computing the morphological skeleton by B of the image f, when option is BINARY. In this case, the pixels of value 1 in y are center of maximal balls (generated from B) included in f. This is also called Medial Axis. If option is VALUE, the non zeros pixels in y are the radius plus 1 of the maximal balls. This is called Medial Axis Transform or valued morphological skeleton.

Examples

a=mmneg(mmframe(mmbinary(ones(7,9))))
Warning: converting image from double to int32
a =
     0     0     0     0     0     0     0     0     0
     0     1     1     1     1     1     1     1     0
     0     1     1     1     1     1     1     1     0
     0     1     1     1     1     1     1     1     0
     0     1     1     1     1     1     1     1     0
     0     1     1     1     1     1     1     1     0
     0     0     0     0     0     0     0     0     0
mmskelm(a)
ans =
     0     0     0     0     0     0     0     0     0
     0     1     0     0     0     0     0     1     0
     0     0     1     0     0     0     1     0     0
     0     0     0     1     1     1     0     0     0
     0     0     1     0     0     0     1     0     0
     0     1     0     0     0     0     0     1     0
     0     0     0     0     0     0     0     0     0
mmskelm(a,mmsebox)
ans =
     0     0     0     0     0     0     0     0     0
     0     0     0     0     0     0     0     0     0
     0     0     0     0     0     0     0     0     0
     0     0     0     1     1     1     0     0     0
     0     0     0     0     0     0     0     0     0
     0     0     0     0     0     0     0     0     0
     0     0     0     0     0     0     0     0     0
a=mmreadgray('pcbholes.tif');
b=mmskelm(a);
mmshow(a);
mmshow(b);
a b
c=mmskelm(a,mmsecross,'value');
mmshow(c);
c

Equation

Algorithm

function y=mmskelm_equ(f, B)
  y = mmbinary(zeros(size(f)));
  for i=0:length(f)
    nb = mmsesum(B,i);
    f1 = mmero(f,nb);
    f2 = mmopenth(f1,B);
    y = mmunion(y,f2);
  end; 

See also

mmfreedom Control automatic data type conversion.
mmcbisector N-Conditional bisector.
mmlastero Last erosion.
mmthin Image transformation by thinning.
mmskelmrec Morphological skeleton reconstruction (Inverse Medial Axis Transform).
[mmopenth] [Up] [mmskelmrec]