A histogram is an important characteristic of an image's content. If you look at an image area that shows a particular texture or a particular object, then the histogram of this area can be seen as a function that gives the probability that a given pixel belongs to this specific texture or object. In this recipe, you will learn how the concept of histogram backprojection can be used advantageously to detect specific image content.
Backprojecting a histogram to detect specific image content
How to do it...
Suppose you have an image and you wish to detect specific content inside it (for example, in the following image, the clouds in the sky):
- The first thing to do is select a region of interest (ROI) that contains a sample...