Remotely-sensed images are not just pictures; they are data. The value of the pixels has meaning that can be automatically analyzed by a computer. The ability to run statistical algorithms on a dataset is key to remote sensing. This recipe counts the number of unique combinations of pixels across multiple bands. A use case for this recipe will be to assess the results of image classification, which is a recipe that we'll cover later in this chapter. This recipe is in contrast to the typical histogram function, which totals the unique values and the frequency of each value per band.
We will use the SatImage raster available at https://geospatialpython.googlecode.com/files/SatImage.zip.
Place this raster in your /qgis_data/rasters
directory.