Latest Page Update: 23-09-2026
Exercise 4b - Image Morphology¶
The purpose of this exercise is to implement, test and validate different approaches to binary image morphological operations.
Learning Objectives¶
After completing this exercise, the student should be able to do the following:
- Define a structuring element (also called a footprint) using the
diskfunction from theskimage.morphologypackage. - Perform the morphological operations: erosion, dilation, opening and closing on binary images.
- Compute the outlines seen in a binary image.
- Use morphological operations to remove holes in objects.
- Use morphological operations to separate binary objects.
- Select appropriate footprints based on image properties and object appearance.
- Combine morphological operations to clean and separate objects.
Installing Python packages¶
In this exercise, we will be using scikit-image. You should have this library installed, else instructions can be found in the previous exercises.
We will use the virtual environment from the previous exercise (course02503).
Exercise data and material¶
Download the data you'll need for this exercise by clicking here: Data
Alternatively, you can also fetch the data for the whole course through the Image Analysis GitHub repository. See the Data and GitHub section for more information. If you're using Git, it may be wise run:
git pull
As this will fetch updates to the material, which may happen throughout the course.