464 The Image Processing Handbook, Seventh Edition
software packages the ranking method is used for continuous tone grayscale and color images
(using just the brightness values and ignoring color) and for binary images.
There is a rich literature for the field of mathematical morphology with a specific language
and notation for the operations that is generally presented in terms of set theory. A much
simpler approach is taken here: operations can be described in terms of adding or removing
pixels from the binary image according to certain rules, which depend on the number or pat-
tern of neighboring pixels. Each operation is performed on each pixel in the original image.
Only the original pixel values are used in evaluating the neighbor patter ...