Class ImageMoments

Object
ImageMoments

public class ImageMoments extends Object
The first moment (mean) and eigenvalues of the second moments (covariance) from a matrix of points.

See Image Moment on Wikipedia

Author:
Owen Feehan
  • Constructor Summary

    Constructors
    Constructor
    Description
    ImageMoments(cern.colt.matrix.DoubleMatrix2D matrixPoints, boolean suppressZ, boolean sortAscending)
    Calculates the second-moments from the covariance of a matrix of points.
  • Method Summary

    Modifier and Type
    Method
    Description
    Creates a deep-copy of the current object.
    get(int axis)
    Get an eigenvalue and corresponding eigenvector for a particular axis.
    double
    getMean(int axis)
    Get the mean-value for a particular axis.
    void
    Removes the entry that is closest to having an eigenVector in direction (0,0,1).

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • ImageMoments

      public ImageMoments(cern.colt.matrix.DoubleMatrix2D matrixPoints, boolean suppressZ, boolean sortAscending)
      Calculates the second-moments from the covariance of a matrix of points.

      Steps: 1. Constructs first and the second-moments matrix of some input points 2. Calculates an eigenvalue-decomposition of the second-moment matrix

      Parameters:
      matrixPoints - a matrix where each row represents a point (n x 3) and each column an axis
      suppressZ - iff true the z-dimension is ignored
      sortAscending - if true, eigenValues are sorted in ascendingOrder, if false in descending order
  • Method Details

    • get

      public EigenvalueAndVector get(int axis)
      Get an eigenvalue and corresponding eigenvector for a particular axis.
      Parameters:
      axis - axis 0 for X, 1 for Y, 2 for Z.
      Returns:
      the corresponding to EigenvalueAndVector as used internally.
    • getMean

      public double getMean(int axis)
      Get the mean-value for a particular axis.
      Parameters:
      axis - 0 for X, 1 for Y, 2 for Z.
      Returns:
      the mean for the corresponding axis.
    • removeClosestToUnitZ

      public void removeClosestToUnitZ()
      Removes the entry that is closest to having an eigenVector in direction (0,0,1).
    • duplicate

      public ImageMoments duplicate()
      Creates a deep-copy of the current object.
      Returns:
      a deep copy.