Content
- Order Statistics filters
- Morphological filtering
- Morphological operations for object detection
- Morphological operations for edge detection
Audiovisual Processing CMP-6026A
Dr. David Greenwood
Linear filters compute the sum of products between kernel coefficients and the image neighbourhood.
Instead, replace intensity with a measure obtained by ordering the pixel intensities in the neighbourhood.
Crop a part of a larger image to uses as an example.
First, window a region of size 3x3:
Sort the intensities in the region:
Sort the intensities in the region, and select the middle value:
Max filter is similar to median filter, but selects the maximum value:
Min filter is again similar, but selects the minimum value:
Order-statistics filters are good for noise removal where:
For example, the salt and pepper noise model:
Aside: What is salt and pepper noise?
If we consider this 5 pixel neighbourhood, what will the median filter do?
The median filter removes spike noise.
The Gaussian filter amplifies noise.
Operation of the filter is characterised by mathematical morphology.
For binary images:
\[\text{Let } A \text{ be a set in } \mathbb{Z}^{2}\]
the set of all integers in 2 dimensions…
\[ a \in A \text{ if } a = (x, y) \text{ is an element of set } A \]
this is the element symbol…
\[ a \notin A \text{ if } a \text{ is not in } A \]
not in…
\[ C = \{ w|w = -d, ~ for ~ d \in D \} \]
the set of all \(w\) such that…
\[\emptyset \text{ is the empty set} \]
Given two sets, A and B, the following can be defined:
\[C \subseteq B, A \nsubseteq B\]
Subset: a set where all members belong to a given set.
\[A \cup B\]
Union: all elements that are either in set A or set B.
\[A \cap B\]
Intersection: all elements that are common to both A and B.
\[A^{c} \{w|w ~\notin ~ A\}\]
Complement: the elements not contained in set A
\[A \setminus B = \{w|w ~\in ~ A,~ w ~\notin ~ B \}\]
Difference: the elements of set A that are not in set B
A binary image (or mask) that allows us to define neighbourhood structures.
A structuring element is said to fit the image if, for each of its pixels set to 1, the corresponding image pixel is also 1.
The set of all displacements such that the image and the structuring element overlap at every pixel.
A structuring element is said to hit, an image if, at least for one of its pixels set to 1 the corresponding image pixel is also 1.
The set of all displacements such that the image and the structuring element overlap at any pixel.
\[A \oplus B = \{ x, y| B_{x, y} \cap A \neq \emptyset \} \]
Defines dilation of binary image \(A\) by structuring element \(B\).
Calculate the binary OR of elements in \(A\) masked by \(B\).
The structuring element hits the image.
\[A \oplus B\]
\[A \ominus B = \{ x, y| B_{x, y} \subseteq A \} \]
Defines erosion of binary image \(A\) by structuring element \(B\).
Calculate the binary AND of elements in \(A\) masked by \(B\).
The structuring element fits the image.
\[A \ominus B\]
\[A \circ B = (A \ominus B) \oplus B \]
Erosion followed by Dilation.
\[A \bullet B = (A \oplus B) \ominus B \]
Dilation followed by Erosion.
After performing dilation of A by B, what does the resulting binary image look like?
After performing dilation of A by B, what does the resulting binary image look like?
Using difference images, we can detect edges.
\[(A \oplus B) - A\]
Dilation Difference image.
\[(A \ominus B) - A\]
Erosion Difference image.
\[(A \oplus B) - (A \ominus B)\]
Dilation Erosion Difference.
Digital Image Processing