Thursday, February 9, 2012

Morphological Dilation

Morphological dilation is the second basic operator in MM [see TOC] and the counterpart of the erosion [see post].

Some formulas...

In Wikipedia, this is defined by the union between the image and the structuring element.

and this definition can be extended to the gray-level images as:

δ(I)(x) = max(I(x + s) )  with s ∈ S
where I is the image and S is the structuring element.

1- Dilation in ImageJ

Dilation is available in Process > Binary > Dilate and only works with binary images. In this implementation, a 3x3 (square ?) structuring element is used expanding the TRUE (white) pixels.

Fig.1: A) Original image. B) Dilated image after 3 cycles of dilation.

Note: For sake of clarity, I consider that white pixels (value of 255) are TRUE and I've configured ImageJ in such a way that the background color is black (Process > Binary > Options check 'Black Background' [see explanation in this post]).

2- Use

Dilation is used to remove pepper noise (black dots in your image) or FALSE defects as shown in Fig.2.

Fig. 2: A) Original image. B) Dilated image.

3- Dilation of gray-level images: Maximum filter

The equivalent for gray-level images is the maximum filter available in Process > Filters > Maximum. Here, dilation is used to remove darkest features in your image. In Fig. 3B, the Lena's eyes appear brightest than those of the original gray-level image (Fig. 3A).

Fig.3: A) Original image Lena converted to 8-bit. B) Dilation using a square 3x3 structuring element (radius = 1 in Maximum filter).

4- Influence of the structuring element

One of the main problem of erosion and dilation is the fact that the shape of structuring element distorts the objects of interest and can't be used for an analysis (specially if you are interested in areas).

Experiment this phenomenon by choosing different structuring elements in this example of my series Drawing a chessboard [see post].

5- Conclusion

In most cases, dilation and erosion are really interesting when they are combined together yielding two new operations of MM: Opening and Closing...

No comments:

Post a Comment