| [Top] [Up] [Prev] [Next] | [Up] [Tutorial] | mmtutor V1.0 30abr2001 |
mm022str A flat structuring element is a set of points at given coordinates:
B = { (0,-2),
(-1,-1),(0,-1),(1,-1),
(-2, 0),(-1, 0),(0, 0),(1, 0),(2, 0),
(-1, 1),(0, 1),(1, 1),
(0, 2)}
The set of points can be represented by a binary image. The 1-pixels are the points in the set and the 0-pixels are the rest. The convention here is to have the central pixel at the (0,0) coordinates. In this way, it is possible to represent negative coordinates without the need of any additional parameter.
b=mmsecross(2);
mmseshow(b)
ans =
0 0 1 0 0
0 1 1 1 0
1 1 1 1 1
0 1 1 1 0
0 0 1 0 0
|
mmseshow can also return an image suitable for displaying (Note that the pixel at the origin is marked):
A=mmsecross(2); B = mmseshow(A,'EXPAND'); mmshow(B); ;
|

Below is an example to compute the Minkowski addition of two 3x3 cross structuring element. This is implemented by the dilation of a larger image of the first structuring element by the second structuring element.
B = mmsecross;
Bi = mmseshow(B)
Bi =
0 1 0
1 1 1
0 1 0
Ai=uint8(zeros(5));
Ai(2:4,2:4) = Bi
Ai =
0 0 0 0 0
0 0 1 0 0
0 1 1 1 0
0 0 1 0 0
0 0 0 0 0
Ci=mmdil(Ai,B)
Ci =
0 0 1 0 0
0 1 1 1 0
1 1 1 1 1
0 1 1 1 0
0 0 1 0 0
|
In the example below, we have the Minkowski addition of D and E:

D=uint8(zeros(7,9)); D(4,5)=1; D(3,6)=1; D(3,7)=1; D(2,8)=1; mmshow(D); ; str=mmsecross; E = mmseshow(str,'EXPAND'); mmshow(E); ; F=mmdil(D,str); mmshow(F); ;
|
Digital disks of radius r can be created by successive Minkowski additions of a primitive SE. mmsesum implements this Minkowski additions.

bi = logical(uint8([ 0 0 1; 1 1 1; 0 1 1])); B1=mmimg2se(bi); BD1=mmseshow(B1,'EXPAND'); mmshow(BD1); ; % B2=mmsesum(B1,2); BD2=mmseshow(B2,'EXPAND'); mmshow(BD2); ; % B3=mmsesum(B1,3); BD3=mmseshow(B3,'EXPAND'); mmshow(BD3); ; % B4=mmsesum(B1,4); BD4=mmseshow(B4,'EXPAND'); mmshow(BD4); ;
|
function A=mink(B,C). Use the functions mmdil, mmseshow, mmimg2se. | [Top] [Up] [Prev] [Next] | [Up] [Tutorial] |
|
| Copyright (c) 1998-20001 by SDC Information SystemsCopyright (c) 1998-20001 by SDC Information Systems | ||