Fundamental operations

Mathematical morphology is a set of non-linear operations and techniques related to the shape or features of an image. There are two base elements of image morphology:

We have already discussed the prerequisites regarding image and color scheme, but the structuring element is new to us. The structuring element is usually a 3x3 binary block that slides over the image and updates it. There are two fundamental operations achieved by sliding the structuring element:

At the time of writing, erode and dilate from the ImageMorphology package support 3x3 structuring elements only. The 3×3 square is the most popular structuring element used in morphological operations. A larger structuring element creates a more extreme erosion or dilation effect although, usually, very similar results can be achieved by repeating the process many times.