[mmsecross] [Up] [mmseline] Structuring Elements

mmsedisk
Create a disk or a semi-sphere structuring element.

Synopsis

B = mmsedisk ( r = 3, DIM = "2D", METRIC = "EUCLIDEAN", FLAT = "FLAT", h = 0 )

Input

r Double Non-negative integer.

Disk radius.

Default: 3 (3)

DIM String

'1D', '2D, or '3D'.

Default: "2D" ('2D')

METRIC String

'EUCLIDEAN', ' CITY-BLOCK', 'OCTAGON', or ' CHESSBOARD'.

Default: "EUCLIDEAN" ('EUCLIDEAN')

FLAT String

'FLAT' or 'NON-FLAT'.

Default: "FLAT" ('FLAT')

h Double

Elevation of the center of the semi-sphere.

Default: 0 (0)

Description

mmsedisk creates a flat structuring element B that is disk under the metric METRIC , centered at the origin and with radius r or a non-flat structuring element that is a semi-sphere under the metric METRIC, centered at (0, h) and with radius r. This structuring element can be created on the 1D, 2D or 3D space.

Examples

Examples of flat structuring elements.
a=mmseshow(mmsedisk(10,'2D','CITY-BLOCK'))
b=mmseshow(mmsedisk(10,'2D','EUCLIDEAN'))
c=mmseshow(mmsedisk(10,'2D','OCTAGON'))
mmshow(a)
mmshow(b)
mmshow(c)
        
a b c
Examples of non flat structuring elements.
d=mmseshow(mmsedisk(10,'2D','CITY-BLOCK','NON-FLAT'))
e=mmseshow(mmsedisk(10,'2D','EUCLIDEAN','NON-FLAT'))
f=mmseshow(mmsedisk(10,'2D','OCTAGON','NON-FLAT'))
mmshow(d)
Warning: downcasting image from int32 to uint16 (may lose precision)
mmshow(e)
Warning: downcasting image from int32 to uint16 (may lose precision)
mmshow(f)
        
Warning: downcasting image from int32 to uint16 (may lose precision)
d e f
g=mmsedisk(3,'2D','EUCLIDEAN','NON-FLAT')
mmseshow(g)
array([[-2147483647, -2147483647,           1,           1,           1,
        -2147483647, -2147483647],
       [-2147483647,           2,           2,           2,           2,
                  2, -2147483647],
       [          1,           2,           3,           3,           3,
                  2,           1],
       [          1,           2,           3,           3,           3,
                  2,           1],
       [          1,           2,           3,           3,           3,
                  2,           1],
       [-2147483647,           2,           2,           2,           2,
                  2, -2147483647],
       [-2147483647, -2147483647,           1,           1,           1,
        -2147483647, -2147483647]])
h=mmsedisk(3,'2D','EUCLIDEAN','NON-FLAT',5)
mmseshow(h)
        
array([[-2147483647, -2147483647,           6,           6,           6,
        -2147483647, -2147483647],
       [-2147483647,           7,           7,           7,           7,
                  7, -2147483647],
       [          6,           7,           8,           8,           8,
                  7,           6],
       [          6,           7,           8,           8,           8,
                  7,           6],
       [          6,           7,           8,           8,           8,
                  7,           6],
       [-2147483647,           7,           7,           7,           7,
                  7, -2147483647],
       [-2147483647, -2147483647,           6,           6,           6,
        -2147483647, -2147483647]])

Equation

Flat structuring element:
Euclidean distance:
City block distance (4-connectivity):
Chess board distance (8-connectivity):
Octagon distance:
Non-flat structuring element:
Euclidean distance:
city block distance:
chess board distance:

See also

mmfreedom Control automatic data type conversion.
mmsebox Create a box structuring element.
mmsecross Diamond structuring element and elementary 3x3 cross.
mmseline Create a line structuring element.
mmimg2se Create a structuring element from a pair of images.
mmseshow Display a structuring element as an image.
mmdil Dilate an image by a structuring element.
[mmsecross] [Up] [mmseline]