Class SkewnessParamCalculator

  • All Implemented Interfaces:
    IParamCalculator

    public class SkewnessParamCalculator
    extends BaseMeanCalculator
    implements IParamCalculator
    This class is designed to compute the skewness of each patch of the given BufferedImage, based on the following formula:

         μ _3 = SUM{((z_i - m)^3) * p(z_i)}

    or to be precise, using Skewness in Apache library:
         [n / (n -1) (n - 2)] SUM[(x_i - mean)^3] / std^3
    where:
    • p: the histogram of this patch.
    • z_i: the intensity value of the i-th pixel in this patch.
    • p(z_i): The frequency of the intensity z_i in the histogram of this patch whose skewness parameter is being calculated.
    • m: the mean intensity value of this patch.
    Note: For each patch, the histogram of that particular patch is used in the formula, and NOT the histogram of the entire image.
    Author:
    Azim Ahmadzadeh, Data Mining Lab, Georgia State University
    • Constructor Detail

    • Method Detail

      • calculateParameter

        public double[][] calculateParameter​(double[][] image)
        Description copied from interface: IParamCalculator
        This polymorphic method is designed to compute any of the 10 parameters at a time. It iterates over the given image, patch by patch, and then in every patch, pixel by pixel, to compute the parameter value for each patch.
        Note: In all the classes, matrices are read and write, row by row.
        Note: It is required that each class works independently, meaning that they must rely on their own computations. Therefore, some calculations (e.g. mean intensity value) might be calculated several times for different parameters (e.g. once for skewness and another time for std. deviation).
        Note: No fixed range for the color intensity values of the given images is assumed. (colors do not have to be within the range [0,255].)
        Specified by:
        calculateParameter in interface IParamCalculator
        Parameters:
        image - a 2D array representing the input image for which the parameter should be computed.
        Returns:
        a 2D matrix whose each entry corresponds to the calculated parameter for one particular patch of the image.