[mmfractal] [Up] [mmglblshow] Measurements

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

Synopsis

function h = mmpatspec ( f , type , n , Bc , Buser )

Input

f Image Binary image
type String

Default: 'OCTAGON'

Disk family: 'OCTAGON', 'CHESSBOARD', 'CITY-BLOCK', 'LINEAR-V', 'LINEAR-H', 'LINEAR-45R', 'LINEAR-45L', 'USER'.

n Double

Default: 65535

Maximum disk radii.

Bc Structuring Element

Default: 3x3 elementary cross

Connectivity for the reconstructive granulometry. Used if '-REC' suffix is appended in the 'type' string.

Buser Structuring Element

Default: 3x3 elementary cross

User disk, used if 'type' is 'USER'.

Output

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

a uint16 vector.

Description

Compute the Pattern Spectrum of a binary image. See [Mar89]. The pattern spectrum is the histogram of the open transform, not taking the zero values.

Examples

f = mmbinary([...
     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]);
Warning: converting image from double to int32
mmpatspec( f, 'city-block')'
processing r=  0
processing r=  1
processing r=  2
ans =
      2     11
f=mmreadgray('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
obj1 obj2 obj3
stem(h1);
axis([0 5 0 400]);
stem(h2);
axis([0 5 0 400]);
stem(h3);
axis([0 5 0 400]);
h1 h2
h3

Equation

See also

mmopen Morphological opening.
mmopentransf Open transform.
mmsedisk Create a disk or a semi-sphere structuring element.
[mmfractal] [Up] [mmglblshow]