For each group of pixels considered in the input map, a majority filter assign the predominant (=mostly frequently occurring) value or class name of these to the center pixel in the output map. Undef-majority filters only do this when the center pixel in the input map is undefined; zero-majority filters only do this when the value of the center pixel in the input map is 0.
Undef-Majority filters are often used as a post-classification operation to reduce the number of undefined pixels in the output map of an image classification.
Standard majority filters:
For each 3x3 pixels considered, the standard MAJORITY filter assigns the predominant value or class name to the central pixel in the output map. If no predominant value is found, for instance when all 9 input pixels have a different value or class name, the value or class name which is encountered first is used as output.
The standard undef-majority filter (MAJUNDEF) will only assign the predominant value or class name to the central pixel in the output map if the central pixel in the input map is undefined.
The standard zero-majority filter (MAJZERO) will only assign the predominant value or class name to the central pixel in the output map if the central pixel in the input map has value zero.
User-defined majority filters:
In the Filter dialog box as well as on the command line, you can define your own majority filters: specify the size of the filter and whether a condition has to be used. For more information, refer to user-defined majority filters.
See also: