Latest Page Update: 23-09-2026
Exercise 5 - BLOB Analysis (connected component analysis and object classification)¶
The purpose of this exercise is to implement, test and validate connected component analysis methods. Also known as BLOB (binary large object) analysis.
The methods will be used to create a small program that can count cell nuclei.
Learning Objectives¶
After completing this exercise, the student should be able to do the following:
- Preprocess a colour image so it is suitable for BLOB analysis using color to gray transformations and threshold selection.
- Use slicing to extract regions of an image for further analysis.
- Use
segmentation.clear_borderto remove border BLOBs. - Apply suitable morphological operations to remove small BLOBs, close holes and generally make a binary image suitable for BLOB analysis.
- Use
measure.labelto create labels from a binary image. - Visualize labels using
label2rgb. - Compute BLOB features using
measure.regionpropsincluding BLOB area and perimeter. - Remove BLOBs that have certain features.
- Extract BLOB features and plot feature spaces as for example area versus perimeter and area versus circularity.
- Choose a set of BLOB features that separates objects from noise.
- Implement and test a small program for cell nuclei classification and counting.
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.