449Processing Binary Images
image using either black or white may be difficult to read if the image contains a full range of
brightness values or colors. In this example, the label is used to create a mask that is one pixel
larger in all directions, using dilation (introduced in a subsequent section). This mask is then
used to erase the pixels in the grayscale image to white, or some other color, before writing
in the label in black or color. The result maintains legibility for the label while obscuring a
minimum amount of the image.
From pixels to features
The Boolean operations described thus far deal with individual pixels in the image. For
many purposes, and especially for measurement, it is necessary to identify the pixels form-
ing part of ...