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

mmimg2se - Create a structuring element from a pair of images.


Synopsis
B = mmimg2se( fd, FLAT, f )
Input
fd: Binary image (logical uint8).
FLAT: String. 'FLAT' or 'NON-FLAT'. Default: "FLAT".
f: Gray-scale (uint8 or uint16) or binary image (logical uint8). Default: No parameter.
Output
B: Structuring element.
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 elementary cross is created.

a = mmimg2se([0 1 0;1 1 1;0 1 0]);
Warning: Converting image from double to binary uint8.
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 = uint8([0 1 1 1; 1 1 1 0])

b =
     0     1     1     1
     1     1     1     0
b1 = mmimg2se(b);
Warning: Converting image from uint8 to binary uint8.
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 cross is created.

c = [0 1 0;1 1 1;0 1 0];
d = [0 0 0;0 1 0;0 0 0];
e = mmimg2se(c,'NON-FLAT',d);
Warning: Converting image from double to binary uint8.
Warning: Converting image from double to uint16.
mmseshow(e)

ans =
     0     1     0
     1     2     1
     0     1     0
Equation

Flat structuring element:

equation

Non-flat structuring element:

equation

H and W are the number of rows and columns of f, respectively.
See Also
mmdil - Dilate an image by a structuring element.
mmfreedom - Control automatic data type conversion.
mmsebox - Create a box structuring element.
mmsecross - Cross structuring element.
mmsedisk - Create a disk or a semi-sphere structuring element.
mmseline - Create a line structuring element.
mmseshow - Display a structuring element as an image.

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