Class ImageMoments
Object
ImageMoments
The first moment (mean) and eigenvalues of the second moments (covariance) from a matrix of
points.
- Author:
- Owen Feehan
-
Constructor Summary
ConstructorsConstructorDescriptionImageMoments
(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 TypeMethodDescriptionCreates 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).
-
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 axissuppressZ
- iff true the z-dimension is ignoredsortAscending
- if true, eigenValues are sorted in ascendingOrder, if false in descending order
-
-
Method Details
-
get
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
Creates a deep-copy of the current object.- Returns:
- a deep copy.
-