Theory of Operation
GrayMorph Filter processes an input region by replacing each pixel with a function of its neighbors. The simplest grayscale operations are erosion and dilation:
All other grayscale morphological operations are derived from MIN and MAX. The interpretation of MIN and MAX is based on the Polarity setting.
- When Polarity is set to Light, this means a correspondence of MIN to dark pixels and MAX to light pixels. Therefore, erosion, in this case, would shrink the light pixels, whereas dilation would grow the light pixels.
- When Polarity is set to Dark, this means a correspondence of MIN to light pixels and MAX to dark pixels. Therefore, erosion, in this case, would shrink the dark pixels, whereas dilation would grow the dark pixels.
Erosion and dilation are complementary. Eroding the light is the same as dilating the dark.