[mmunion] [Up] [mmsebox] Structuring Elements

mmimg2se
Create a structuring element from a pair of images.

Synopsis

function B = mmimg2se ( fd , FLAT , f )

Input

fd Image Binary image

The image is in the matrix format where the origin (0,0) is at the matrix center.

FLAT String

Default: 'FLAT'

Structuring element: 'FLAT' or 'NON-FLAT'.

f Image Unsigned gray-scale (uint8 or uint16), signed (int32) or binary image

Default: NULL

Description

mmimg2se creates a flat structuring element B from the binary image fd or creates a non-flat structuring element b from the binary image fd and the gray-scale image f. fd represents the domain of b and f represents the image of the points in fd.

Examples

Let us apply mmimg2se to create structuring elements. In the example below, the flat 3x3 diamond is created.

a = mmimg2se(mmbinary([0 1 0;1 1 1;0 1 0]));
Warning: converting image from double to int32
mmseshow(a)
ans =
     0     1     0
     1     1     1
     0     1     0

In this next example, the image sizes are even. Note the origin of the structuring element.

b = mmbinary([0 1 1 1; 1 1 1 0])
Warning: converting image from double to int32
b =
     0     1     1     1
     1     1     1     0
b1 = mmimg2se(b);
mmseshow(b1)
ans =
     0     0     0     0     0
     0     0     1     1     1
     0     1     1     1     0

In the example below, a non-flat diamond is created.

c = mmbinary([0 1 0;1 1 1;0 1 0]);
Warning: converting image from double to int32
d = int32([0 0 0;0 1 0;0 0 0]); 
e = mmimg2se(c,'NON-FLAT',d);
format short g
mmseshow(e)
ans =
 -2147483647           0 -2147483647
           0           1           0
 -2147483647           0 -2147483647

Equation

Flat structuring element:
Non-flat structuring element:
H and W are the number of rows and columns of f, respectively.

See also

mmfreedom Control automatic data type conversion.
mmsebox Create a box structuring element.
mmsecross Diamond structuring element and elementary 3x3 cross.
mmsedisk Create a disk or a semi-sphere structuring element.
mmseline Create a line structuring element.
mmseshow Display a structuring element as an image.
mmdil Dilate an image by a structuring element.
[mmunion] [Up] [mmsebox]