public class RatioNonMode extends FeatureHistogramStatistic
Calculates the ratio of non-mode pixels to total pixels in a Histogram.

The mode is the most frequent value in the histogram.

  • Constructor Details

    • RatioNonMode

      public RatioNonMode()
  • Method Details

    • calculateStatisticFrom

      protected double calculateStatisticFrom(Histogram histogram) throws FeatureCalculationException
      Description copied from class: FeatureHistogramStatistic
      Calculates the statistic from the histogram, that is subsequently returned as the feature-value.
      Specified by:
      calculateStatisticFrom in class FeatureHistogramStatistic
      Parameters:
      histogram - the histogram to calculate the statistic from.
      Returns:
      the calculated statistic.
      Throws:
      FeatureCalculationException - if the calculation cannot succeed.
    • isIgnoreZero

      public boolean isIgnoreZero()
      Whether to ignore the zero value when calculating the ratio.

      If true, pixels with value 0 are not considered in the calculation.

    • setIgnoreZero

      public void setIgnoreZero(boolean ignoreZero)
      Whether to ignore the zero value when calculating the ratio.

      If true, pixels with value 0 are not considered in the calculation.