**1 Answer**

written 4.7 years ago by |

**Dilation:**

Dilation is a process in which the binary image is expanded from its original shape. The way the binary image is expanded is determined by the structuring element.

This structuring element is smaller in size compared to the image itself, and normally the size used for the structuring element is 3 x 3.

The dilation process is similar to the convolution process, that is, the structuring element is reflected and shifted from left to right and from top to bottom, at each shift; the process will look for any overlapping similar pixels between the structuring element and that of the binary image.

If there exists an overlapping then the pixels under the center position of the structuring element will be turned to 1 or black.

Let us define X as the reference image and B as the structuring clement. The dilation operation is defined by equation,

$$X⊕B=\{{z|[(\hat{B})_Z ∩X ]∈X \} }$$

where B is the image B rotated about the origin. Equation states that when the image X is dilated by the structuring element B, the outcome element z would be that there will be at least one element in B that intersects with an element in X.

If this is the case, the position where the structuring element is being centered on the image will be 'ON'. This process is illustrated in Fig. a. The black square represents I and the white square represents 0.

Initially, the center of the structuring element is aligned at position •. At this point, there is no overlapping between the black squares of B and the black squares of X; hence at position • the square will remain white.

This structuring element will then be shifted towards right. At position **, we find that one of the black squares of B is overlapping or intersecting with the black square of X.

Thus, at position • • the square will be changed to black. Similarly, the structuring element B is shifted from left to right and from top to bottom on the image X to yield the dilated image as shown in Fig. a.

The dilation is an expansion operator that enlarges binary objects. Dilation has many uses, but the major one is bridging gaps in an image, due to the fact that B is expanding the features of X.

**Erosion:**

Erosion is the counter-process of dilation. If dilation enlarges an image then erosion shrinks the image. The way the image is shrunk is determined by the structuring element. The structuring element is normally smaller than the image with a 3 x 3 size.

This will ensure faster computation time when compared to larger structuring-element size. Almost similar to the dilation process, the erosion process will move the structuring element from left to right and top to bottom.

At the center position, indicated by the center of the structuring element, the process will look for whether there is a complete overlap with the structuring element or not.

If there is no complete overlapping then the center pixel indicated by the center of the structuring element will be set white or 0. Let us define X as the reference binary image and B as the structuring element. Erosion is defined by the equation

$$X⊝B=\{{z|(\hat{B})_Z ∈X}\}$$

Equation states that the outcome element z is considered only when the structuring element is a subset or equal to the binary image X. This process is depicted in Fig. b. Again, the white square indicates O and the black square indicates 1.

The erosion process starts at position •. Here, there is no complete overlapping, and so the pixel at the position • will remain white.

The structuring element is then shifted to the right and the same condition is observed. At position u, complete overlapping is not present; thus, the black square marked with • • will be turned to white.

The structuring element is then shifted further until its center reaches the position marked by •• •. Here, we see that the overlapping is complete, that is, all the black squares in the structuring element overlap with the black squares in the image.

Hence, the center of the structuring element corresponding to the image will be black. Figure b shows the result after the structuring element has reached the last pixel. Erosion is a thinning operator that shrinks an image. By applying erosion to an image, narrow regions can be eliminated while wider ones are thinned.