picture.math
Class KLT

java.lang.Object
  |
  +--picture.math.KLT

public class KLT
extends java.lang.Object

Karhunen-Loeve-Tranformation


Constructor Summary
KLT(double[][] vecs)
          Inititializes a Karhunen-Loeve-Object.
 
Method Summary
static double[] denormal(double[] v, double[] mean)
          Return the denormalization of the given vector v with the mean vector.
 double[] getEigenValues()
          Returns the Eigenvalues of this transformation by descending magnitude.
 double[][] getEigenVectors()
          Returns the Eigenvectors of this transformation.
 double[] inverseTransform(double[] x)
          Inverse transform a vector.
 double[] inverseTransform(double[] x, double[] weights)
          Inverse transform a vector after adjusting weights.
static void main(java.lang.String[] args)
           
static double[] normal(double[] v, double[] mean)
          Return the normalization of the given vector v with the mean vector.
static double[][] normalize(double[][] vecs, double[] mean)
          Normalizes a bunch of vectors, it returns a normalized version and the mean values in the array mean
 void printBase()
          Outputs the transformation base to stderr.
 double[] transform(double[] x)
          Tranforms a vector.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

KLT

public KLT(double[][] vecs)
    throws PictureException
Inititializes a Karhunen-Loeve-Object. Therefore it needs an array of double[]s, which are used to build the basis transformation matrice. It assumes that the double[]s are normalized, i.e. their mean value is {0.0, 0.0, ..., 0.0}.
Parameters:
vecs - array of double[]s which holds the normalized vectors of the input.
Method Detail

getEigenValues

public double[] getEigenValues()
Returns the Eigenvalues of this transformation by descending magnitude.

getEigenVectors

public double[][] getEigenVectors()
Returns the Eigenvectors of this transformation.

transform

public double[] transform(double[] x)
Tranforms a vector.

inverseTransform

public double[] inverseTransform(double[] x)
Inverse transform a vector.

inverseTransform

public double[] inverseTransform(double[] x,
                                 double[] weights)
Inverse transform a vector after adjusting weights.

printBase

public void printBase()
Outputs the transformation base to stderr.

normalize

public static double[][] normalize(double[][] vecs,
                                   double[] mean)
Normalizes a bunch of vectors, it returns a normalized version and the mean values in the array mean

normal

public static double[] normal(double[] v,
                              double[] mean)
Return the normalization of the given vector v with the mean vector.

denormal

public static double[] denormal(double[] v,
                                double[] mean)
Return the denormalization of the given vector v with the mean vector.

main

public static void main(java.lang.String[] args)