A classification algorithm is similar to a segmentation algorithm in that it produces a cartoon image in which each pixel is assigned to one of a set of predefined classes. The number of regions in a segmentation may be quite high, but these segments may usually be classified into a small number of categories: for example fields/roads/hedges; forest/clearings; potatoes/wheat/ploughed/grass. For many purposes the classification is more useful than the segmentation.
classify performs Maximum Likelihood classification of intensity images. Currently, only real images are supported. Maximum likelihood classification is based upon the assumption that there exist statistical models describing the distribution of the classes in the attribute space. Given these models, the class of a new object is determined by calculating which of the models is more likely to describe that object. In other words, the model with maximum likelihood is selected.
Starting with a sementation of the original image, which has the correct statistical model for the data and a plausible boundary model, classify will allocate each region to one of a number of classes. The output is multi-dimensional with number of layers equal to the number of classes. Each output layer has pixels either coloured with value 1 (indicating that they belong to the associated class) or with value 0 (they don't belong to that class).
The classify routine supports both supervised and unsupervised classification:
Figure 4.8 shows one of a sequence of images of the Indonesian rain forest and the resultant image from a jointly segmentation process. Using this segmentation, the images can then be classified as shown in figure 4.9. The reason for using the sequence of images for classification is that the information is in the temporal change. Joint segmentation provides better definition of boundaries. The low resolution and speckle associated with just a single image would give rise to a much poorer result.
A further example of supervised classification is given in the images directory. Full Python script and function syntaxes are given in section A.4.6.
Figure 4.8(a) Figure 4.8(b) |
The mask_stats routine calculates the mean and order parameters, necessary for supervised classification, from the masked regions of an image. Each layer of the mask image should indicate the training data for each class. The resultant file is a single layered real valued image with height equal to the number of layers and width equal to the number of classes.
There is an example of a temporal sequence of SAR images, a sequence of associated mask images and detailed instructions on how to process the images using mask_stats and classify in the images directory. Full Python script and function syntaxes are given in section B.4.3.
InfoSAR Ltd