[Top] [Up] [Prev] [Next] [Up] [Basic Concepts] [Demonstrations] [Functions] SDC Morphology Toolbox V1.1 15Jan02

mmskelm - Morphological skeleton (Medial Axis Transform).


Synopsis
y = mmskelm( f, B, option )
Input
f: Binary image (logical uint8).
B: Structuring element. Default: Elementary cross (mmsecross).
option: String. 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). Default: "binary".
Output
y: Gray-scale (uint8 or uint16) or binary image (logical uint8).
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 uint16.
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);
image
(a)
image
(b)
c=mmskelm(a,mmsecross,'value');
mmshow(c);
image
(c)
Equation

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
mmcbisector - N-Conditional bisector.
mmfreedom - Control automatic data type conversion.
mmlastero - Last erosion.
mmskelmrec - Morphological skeleton reconstruction (Inverse Medial Axis Transform).
mmthin - Image transformation by thinning.

[Top] [Up] [Prev] [Next] [Up] [Basic Concepts] [Demonstrations] [Functions] Valid XHTML 1.0!
Copyright (c) 1998-2002 by SDC Information Systems