Binary morphology describes objects as sets of foreground locations. Gray-scale morphology extends the same geometric ideas to images whose pixels have ordered intensity values.
1. From Binary Sets to Gray-Scale Functions
A binary image can be represented by a foreground set \(X\). A gray-scale image instead assigns an intensity to every spatial location:
where \(D\) is the image domain and \(Q\) is an ordered set of gray levels.
For an 8-bit image,
2. Pointwise Minimum, Maximum, and Ordering
Given two gray-scale functions \(f\) and \(g\), their pointwise meet and join are
Pointwise Meet
Pointwise Join
3. The Umbra of a Gray-Scale Function
A useful way to connect a gray-scale function to set morphology is to imagine stacking points underneath its intensity graph.
For a nonnegative discrete gray-scale function \(f\), define its umbra as
4. Threshold Sets
For a gray level \(t\), define the threshold set
Each \(T_t(f)\) is a binary set containing the locations whose gray level reaches at least \(t\).
5. Reconstructing Gray Levels from Threshold Sets
The threshold representation does not discard the original gray-level information.
For the unit-spaced discrete gray scale
the original value at \(p\) can be recovered by counting the positive threshold sets that contain \(p\):
6. Gray-Scale Structuring Elements
In binary morphology, a structuring element mainly specifies a set of spatial locations relative to its origin. In gray-scale morphology, the structuring element may also assign a height value to each location in its support.
This leads to an important distinction between flat and non-flat structuring elements.
Flat Structuring Element
Because every active value is zero, only the spatial support of the structuring element affects the flat gray-scale operation.
Non-Flat Structuring Element
A non-flat structuring element therefore contributes both its spatial support and its gray-level height values to the operation.
7. Gray-Scale Dilation
For a gray-scale image \(f\) and a gray-scale structuring element \(b\), dilation combines the image values with the structuring-element values and selects the largest result:
If the structuring element is flat, then \(b(u,v)=0\) on its support. The equation simplifies to
Flat Dilation
The output pixel receives the largest intensity found under the active structuring-element support.
8. Gray-Scale Erosion
Gray-scale erosion performs the complementary operation. It subtracts the structuring-element values from the image values and selects the smallest result:
For a flat structuring element, \(b(u,v)=0\), so erosion simplifies to
Flat Erosion
The output pixel receives the smallest intensity found under the active structuring-element support.
9. Gray-Scale Opening and Closing
The compositions are the same as in binary morphology, but the intermediate images now contain gray levels.
Gray-Scale Opening
Opening suppresses bright structures that are too small to survive the erosion stage.
Gray-Scale Closing
Closing suppresses small dark structures and fills narrow dark valleys.
10. Morphological Gradient and Top-Hats
Once gray-scale dilation, erosion, opening, and closing are available, several useful intensity-domain operations follow naturally.
Morphological Gradient
Measures the difference between the local upper and lower morphological envelopes.
Large values often occur near strong intensity transitions.
White Top-Hat
Extracts bright structures removed by the opening.
Black Top-Hat
Extracts dark structures removed by the closing.
11. Gray-Scale Morphology Through Threshold Sets
For flat morphology, thresholding and the basic morphological operations fit together in a particularly useful way.
12. Stack Filters
Threshold decomposition also provides the architecture for a broader family of nonlinear filters called stack filters.
A stack filter applies the same positive Boolean function to the neighborhood in each binary threshold layer, then reconstructs the gray-scale result.
Example: Three-Point Median as a Stack Filter
For three binary inputs \(a,b,c\), the majority function is
It outputs 1 when at least two of its three binary inputs are 1.
At each threshold,
For the unit-spaced gray scale \(Q=\{0,1,\ldots,L\}\),
13. Comparing Gray-Scale Morphological Operations
| Operation | Flat-SE Interpretation | Typical Gray-Scale Effect |
|---|---|---|
| Dilation | Local maximum over \(B\) | Expands bright structures and raises local peaks |
| Erosion | Local minimum over \(B\) | Expands dark structures and lowers local valleys |
| Opening | Erosion → dilation | Suppresses small bright features |
| Closing | Dilation → erosion | Suppresses small dark features |
| Morphological Gradient | Dilation − erosion | Emphasizes local intensity transitions |
| White Top-Hat | \(f-\text{opening}\) | Extracts small bright structures |
| Black Top-Hat | \(\text{closing}-f\) | Extracts small dark structures |
14. Interactive Gray-Scale Morphology Explorer
The visualizer below deliberately has two different modes so it does not repeat the binary morphology or nonlinear-filter visualizers.
Gray-Scale Morphology
Edit a gray-scale image and inspect dilation, erosion, opening, closing, morphological gradient, and top-hats.
The visualizer uses a symmetric flat cross or square structuring element and shows the neighborhood used at the selected pixel.
Threshold Stack
Edit a 1-D image on \(Q=\{0,1,2,3\}\).
See all threshold sets, apply a three-point majority Boolean filter to each layer, and reconstruct the gray-scale output.
15. Summary
| Concept | Main Idea |
|---|---|
| Gray-Scale Function | \(f:D\rightarrow Q\) |
| Meet / Join | Pointwise minimum and maximum |
| Umbra | Set of spatial locations and gray-level coordinates at or below \(f\) |
| Threshold Set | \( T_t(f) = \{p\mid f(p)\ge t\} \) |
| Flat SE | \(b(u,v)=0\) on its support |
| Non-Flat SE | \(b:D_b\rightarrow\mathbb{R}\) assigns a height to each support location |
| Flat Dilation | Maximum over the active SE support |
| Flat Erosion | Minimum over the active SE support |
| Opening / Closing | Gray-scale extensions of the binary compositions |
| Threshold Decomposition | Represent a gray-scale image as nested binary layers |
| Stack Filter | Apply the same positive Boolean function to every threshold layer and reconstruct the gray-scale result |
Be First to Comment