Morphological Operations in Binary Images
Morphological processing deals with the analysis of structures. The primitive operations of erosion and dilation, as well as their combinations (opening and closing), can be applied to binary images. By using a small image (a structure element) it is possible to filter the image and to analyze shapes and structures in the image. This Demonstration shows the usefulness of the morphological processing on binary (black and white) images.
 P. Soille, Morphological Image Analysis, 2nd ed., Berlin: Springer–Verlag, 2004.