< 

 Lazy Erode Dilate 

 > 


 

bitmap with a lot of noise

 

 

INTRODUCTION

The purpose of the Lazy Erode Dilate macros is to perform structural filtering on bitmaps such as may be obtained by segmentation.

Image SXM provides an extensive menu for binary operations. However, the menu is not so easy to access, in particular, if settings are to be changed, the pull-down menu has to be opened once to change the setting, and a second time to perform the actual operation. The Lazy Erode Dilate macro simply provides a means to perform the operations with one single key stroke.


 

 

   

 

GETTING STARTED

Load Lazy Erode Dilate macro.

The macros are grouped in six groups:

  • erosion with different thresholds
  • dilation with different thresholds
  • noise filtering
  • structural filtering
  • scaling and converting
  • reverting and restoring

 

 

EROSION

erosion with settings 1, 3, 5, 7 top to bottom

 

DILATION

dilation with settings a, c, e, g top to bottom

 

 

EROSION - DILATION

Erosion and dilation refer to the (black) segments on a bitmap. Contiguous black pixels are viewed as "islands". Erosion means taking off the boundary pixels. Dilation means adding pixels to the boundary.

The so-called Neighborhod Count (1 - 8) represent threshold limits for the erosion or dilation process.

Consider the 3x3 neighborhood of a given pixel.

  • Neighborhood Count = 1:

    the pixels is set to black/white, if 1 of the neighboring pixels is black/white

  • Neighborhood Count = 2:

    the pixels is set to black/white, if 2 of the neighboring pixels are black/white

  • Neighborhood Count = 3:

    the pixels is set to black/white, if 3 of the neighboring pixels are black/white

    ... etc. ...

  • Neighborhood Count = 8:

    the pixels is set to black/white, if 8 of the neighboring pixels are black/white




 

 

OPENING

opening with settings 1a, 3c, 5e, 7g top to bottom

 

CLOSING

closing with settings a1, c3, e5, g7 top to bottom

 

 

OPEN - CLOSE

If an erosion is followed by a dilation, the resulting operation is called opening because black segments that are only poorly connected tend to be separated in the process. Conversely, if a dilation is followed by an erosion, the resulting opreation is called closing because black segments that are very close to one another tend to be connected.

Opening is useful if touching grains are to be separated, closing is useful if grain boundaries are to be connected across gaps.