In this section, we shall demonstrate how to use the functions from scikit-image's morphology module to implement a few morphological operations, first on binary images and then on grayscale images.
The scikit-image morphology module
Binary operations
Let's start with morphological operations on binary images. We need to create a binary input image (for example, with simple thresholding which has a fixed threshold) before invoking the functions.
Erosion
Erosion is a basic morphological operation that shrinks the size of the foreground objects,...