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

mmpatspec - Pattern spectrum (also known as granulometric size density).


Synopsis
h = mmpatspec( f, type, n )
Input
f: Binary image (logical uint8).
type: String. Disk family: 'OCTAGON', 'CHESSBOARD', 'CITY-BLOCK', 'LINEAR-V', LINEAR-H'. Default: 'OCTAGON'.
n: Maximum disk radius. Default: 65535.
Output
h: Gray-scale (uint8 or uint16) or binary image (logical uint8). a uint16 column vector.
Description
Compute the Pattern Spectrum of a binary image. See [Mar89] .
Examples
f = logical(uint8([...
     0     0     0     0     0     0     0;...
     0     1     1     1     1     0     0;...
     0     1     1     1     1     1     0;...
     0     1     1     1     1     0     0;...
     0     0     0     0     0     0     0]));
mmpatspec( f, 'city-block')'

processing r=  0
processing r=  1
processing r=  2
ans =
     2    11

f=imread('numbers.tif');
fr = mmlabel(f);
obj1=mmcmp(fr,'==', uint16(1));
obj2=mmcmp(fr,'==',uint16(2));
obj3=mmcmp(fr,'==',uint16(3));
mmshow(obj1);
mmshow(obj2);
mmshow(obj3);
h1 = mmpatspec( obj1,'OCTAGON')'

processing r=  0
processing r=  1
processing r=  2
processing r=  3
h1 =
     9    59   322
h2 = mmpatspec( obj2, 'OCTAGON')'

processing r=  0
processing r=  1
processing r=  2
processing r=  3
processing r=  4
h2 =
     0   107   142   114
h3 = mmpatspec( obj3, 'OCTAGON')'

processing r=  0
processing r=  1
processing r=  2
processing r=  3
h3 =
     5   103   276
image
(obj1)
image
(obj2)
image
(obj3)
stem(h1);
axis([0 5 0 400]);
stem(h2);
axis([0 5 0 400]);
stem(h3);
axis([0 5 0 400]);
image
(h1)
image
(h2)
image
(h3)
Equation

equation

See Also
mmopen - Morphological opening.
mmopentransf - Open transform.
mmsedisk - Create a disk or a semi-sphere structuring element.
Source code
mmpatspec.m

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