Class AbstractMoment<T>

    • Constructor Detail

      • AbstractMoment

        public AbstractMoment()
    • Method Detail

      • imageToMatrix

        protected abstract boolean[][] imageToMatrix​(T img)
        Takes an image of type T and returns a boolean matrix that can be used for moments
        Parameters:
        img - the image to convert
        Returns:
        the boolean matrix representing the image
      • check

        protected abstract boolean check​(T img)
        Hook method for performing checks on the image.
        Parameters:
        img - the image to check
        Returns:
        true if successful
      • doCalculate

        protected abstract double doCalculate​(boolean[][] img)
        Performs the actual calculation.
        Parameters:
        img - the image to process
        Returns:
        the calculated moment
      • calculate

        public double calculate​(T img)
        Calculates the moment.
        Parameters:
        img - the image to process
        Returns:
        the calculated moment