...
 
Commits (3)
--- ---
title: Morphological filters title: Morphological Filters
layout: page layout: module
permalink: /filtermorphological prerequisites:
--- - "[Neighbourhood filters](filter_neighbourhood)"
- "[Rank filters](filter_rank)"
# Morphological filters objectives:
- "Design morphological filters using rank filters"
## Requirements - "Execute morphological filters on binary or grayscale images and explain the output"
motivation: >
- Neighbourhood filters Filters can be used to change size and shape of objects in an image. [*] Concept map below assumes bright objects on dark background. For dark objects on bright background effect of min and max filters is inverted.
- Rank filters concept_map: >
graph TD
## Motivation
This module explains how filters can be used to change size and shape of objects in the image.
## Learning objectives
- Understand how to design morphological filters using rank filters
- Execute morpholofical filters on binary or grayscale images and explain the output
## Concept map
```mermaid
graph TD
image --> max1[max] image --> max1[max]
image --> min1[min] image --> min1[min]
image --> max2[max] image --> max2[max]
image --> min2[min] image --> min2[min]
image --> d image --> d
subgraph rank filter sequence subgraph rank filter sequence
max2 --> min3[min] max2 --> min3[min]
min2 --> max3[max] min2 --> max3[max]
max1 max1
...@@ -46,40 +35,42 @@ subgraph rank filter sequence ...@@ -46,40 +35,42 @@ subgraph rank filter sequence
closing closing
gradient gradient
end end
```
[*] Concept map above assumes bright objects on dark background. For dark objects on bright background effect of min and max filters inverses # figure: TODO
# figure_legend: TODO
### Activity: Explore erosion and dilation on binary images activity_preface: >
Open the image, `xy_8bit_binary_two_spots_different_size.tif`, and explore how structures grow and shrink, using erosion and dilation
- Open image: xy_8bit_binary__two_spots_different_size.tif # activities:
- Explore how structures grow and shrink, using erosion and dilation # "Platform": "path/to/file.md"
### Activity: Explore opening and closing on binary images exercises_preface: |
### Exercise 1
- Open image: xy_8bit_binary__for_open_and_close.tif Fill in the blanks, using those words: "shrinks", "increases", "decreases", "enlarges".
- Explore effects of morphological closing and opening:
- closing can fill holes
- closing can connect gaps
- opening can remove thin structures
### Formative assessment 1. An erosion \_\_\_\_\_ objects in a binary image.
2. An erosion in a binary image \_\_\_\_\_ the number of foreground pixels.
3. A dilation in a grayscale image \_\_\_\_\_ the average intensity in the image.
4. A dilation \_\_\_\_\_ objects in a binary image.
Fill in the blanks, using those words: shrinks, increases, decreases, enlarges.
1. An erosion _____ objects in a binary image. ### Exercise 2
2. An erosion in a binary image _____ the number of foreground pixels.
3. A dilation in a grayscale image _____ the average intensity in the image.
4. A dilation _____ objects in a binary image.
True of false? Discuss with your neighbour!
True of false? Discuss with your neighbour! 1. Morphological openings on binary images can decrease the number of foreground pixels.
2. Morphological closings on binary images never decreases the number of foreground pixels.
3. Performing a morphological closing a twice in a row does not make sense, because the second closing does not further change the image.
1. Morphological openings on binary images can decrease the number of foreground pixels. # exercises:
2. Morphological closings on binary images never decreases the number of foreground pixels. # "Platform": "path/to/file.md"
3. Performing a morphological closing a twice in a row does not make sense, because the second closing does not further change the image.
## Learn more learn_next:
- TODO
- https://en.wikipedia.org/wiki/Morphological_gradient external_links:
- https://imagej.net/MorphoLibJ#Grayscale_morphological_filters - "[Wikipedia: Morphological Gradient](https://en.wikipedia.org/wiki/Morphological_gradient)"
- "[ImageJ docs: Greyscale morphological filters](https://imagej.net/MorphoLibJ#Grayscale_morphological_filters)"
---