Use Majority/Minority Analysis to apply majority or minority analysis to a classification image. Use majority analysis to change spurious pixels within a large single class to that class. You enter a kernel size and the center pixel in the kernel will be replaced with the class value that the majority of the pixels in the kernel has. If you select Minority analysis, then the center pixel in the kernel will be replaced with the class value that the minority of the pixels in the kernel has.

  1. From the Toolbox, select Classification > Post Classification > Majority/Minority Analysis. The Classification Input File dialog appears.
  2. Select the classification input file and any optional spatial and spectral subsetting, then click OK. The Majority/Minority Parameters dialog appears.
  3. In the list of classes, select the classes that you want to apply the analysis to.

    If the center pixel is from a class that you did not select in the Select Classes list, ENVI does not change that pixel. However, if the unselected class is the majority class in the kernel, ENVI can change center pixels of selected classes into an unselected class.

  4. Select the analysis method, by clicking the corresponding toggle button.
  5. Enter a kernel size. Kernel sizes are odd and the kernels do not have to be square. Larger kernel sizes produce more smoothing of the classification image.

    If you select Majority analysis, enter the Center Pixel Weight. The center pixel weight is the weight used to determine how many times the class of the center pixel is counted when determining which class is in the majority. For example, if you enter a weight of 1, ENVI will count the center pixel class only one time; if you enter 5, ENVI will count the center pixel class five times.

  6. Select output to File or Memory.
  7. Click OK. ENVI adds the resulting output to the Layer Manager.