The importance of binary images
To understand the notion of morphological operations, we will have to revisit the thresholding techniques presented in the previous chapter. We have already mentioned that thresholding an image leads to binary images, which are defined by their two possible pixel values; 0 (for black) and 1 (for white). The way to convert a grayscale image to binary is through thresholding; that is, setting the pixels above a certain value to 1 and the rest to 0. Let's now explain the basic reasons for binarizing an image. The purpose of image binarization can be split into two levels. At a first level, it is used to pinpoint the pixels of an image that interest us (usually called regions of interest or simply, ROIs), thus giving us a quick and easy overview of the image content. The binary images derived, are often called masks. At a second level, it can be used for processing only the selected ROIs (with pixel values equal to 1) defined by the mask, leaving the rest of the image unaffected. Let's see the difference using, an example that covers both the functionalities.