The opening top-hat and closing top-hat results correspond to the gray parts of
Figs. 8.3a and 8.3b, respectively.
As a filter, opening can clean the boundary of an object by eliminating
small extrusions, but it does this in a much finer manner than erosion. The
net effect is that the opened image is a much better replica of the original
than the eroded image (compare Fig. 8.3a with Fig. 8.2a). Analogous remarks
apply to closing and the filling of small intrusions (compare Fig. 8.3b with
Fig. 8.2b).
Binary images can have both additive noise (extraneous foreground pixels in
the background) and subtractive noise (extraneous background pixels in the
foreground). One strategy for correcting this is to open the image to eliminate
additive noise and then to ...