| [Top] [Up] [Prev] [Next] | [Up] [Tutorial] | mmtutor V1.0 30abr2001 |
mm027ero There are two main geometrical interpretation of the erosion: the duality with dilation, and the robot path.
The duality property of the erosion is given by the equation below.

The erosion can be modeled by the dilation of the background (black pixels).
A=imread('blob.tif');
mmshow(A);
B=mmero(A,mmsedisk(10));
mmshow(B);
|
Below, the duality between the dilation and erosion is illustrated. As the SE used is simmetric, there is no need to reflect it.
A=imread('blob.tif');
C=mmneg(A);
mmshow(C);
D=mmdil(C,mmsedisk(10));
mmshow(D);
E=mmneg(D);
mmshow(E);
mmis(B,'==',E)
ans =
1
|
The equation for the erosion for the robot path geometric interpretation is shown below. The erosion are all the points that the translation of the SE by it, fits inside the image. One can think as the SE as a robot shape and the image as the room where the robot can move. As the robot moves by translation only (no rotations), there is a pencil at the robot origin that marks the floor. The result of the erosion is the region that the robot marks the floor, as the robot translated over the whole (room) image.

In the example below, in the final image, the room (original image) is in white, the robot contours, placed at selected points in the room, chosen randomly from the border of the eroded image and the eroded image itself, are overlayed in green, the centers of the translated robot are marked in blue. In red is the eroded image.
The Distance Transform (DT) of a binary image is a gray-scale image where the pixel values gives the distance to the background. The DT can also be seen as an Erosion Transform where each erosion by a disk of radius r is stacked to form a gray-scale image.


In the example below, A is the original binary image, d is its Distance Transform and C is an erosion by a cross SE of radius 10. You can notice that C, obtained by thresholding d with value above 10, is equal to the erosion.
A=imread('blob.tif');
mmshow(A);
d=mmdist(A);
mmshow(d);
mmdtshow(d);
C=mmero(A,mmsecross(10));
mmshow(C);
D=mmcmp(d,'>', uint16(10));
mmis(D,'==',C)
ans =
1
|

| [Top] [Up] [Prev] [Next] | [Up] [Tutorial] |
|
| Copyright (c) 1998-20001 by SDC Information SystemsCopyright (c) 1998-20001 by SDC Information Systems | ||