Facemorph.aam
Class CAAMSolver

java.lang.Object
  extended by Facemorph.aam.CAAMSolver

public class CAAMSolver
extends java.lang.Object

Utillity class for solving the normalised cross correlation given the current synthetic image and the derivatives with respect to each model parameter.


Constructor Summary
CAAMSolver(double[] f, double[][] df)
          Creates a new instance of CAAMSolver
CAAMSolver(double[] f, double[][] df, BigMat hessian, double[] fdotdf, double fdotf)
          Creates a new instance of CAAMSolver
 
Method Summary
static double dotProduct(double[] a, double[] b)
          Calculates the dot product between two arrays of equal length
static double getMean(double[] v)
          Get the mean of the vector
 CAAMSolver getReduced(double[] weights)
          Get a CAAMSolver with fewer degrees of freedom
 double[] getUpdate(double[] g)
          get the update parameters for the given target data vector
static void main(java.lang.String[] args)
          Main method for testing
static double ncc(double[] a, double[] b)
          Calculates the dot product between two arrays of equal length
 double[] reconstruct(double[] update)
          Reconstructs given the update
static void subtractMean(double[] v, double mean)
          Subtract the mean from the vector
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CAAMSolver

public CAAMSolver(double[] f,
                  double[][] df)
Creates a new instance of CAAMSolver

Parameters:
f - The current model vector
df - the derivatives of the current model

CAAMSolver

public CAAMSolver(double[] f,
                  double[][] df,
                  BigMat hessian,
                  double[] fdotdf,
                  double fdotf)
Creates a new instance of CAAMSolver

Parameters:
f - The current model vector
df - the derivatives of the current model
hessian -
fdotf -
fdotdf -
Method Detail

getReduced

public CAAMSolver getReduced(double[] weights)
Get a CAAMSolver with fewer degrees of freedom

Parameters:
weights - the weights
Returns:
return the reduced CAAMSolver

getMean

public static double getMean(double[] v)
Get the mean of the vector

Parameters:
v - teh input vector
Returns:
return the mean

subtractMean

public static void subtractMean(double[] v,
                                double mean)
Subtract the mean from the vector

Parameters:
v - the input vector
mean - the mean value to subtract

getUpdate

public double[] getUpdate(double[] g)
get the update parameters for the given target data vector

Parameters:
g - vector containing the measured data
Returns:
return the array of update parameters

dotProduct

public static double dotProduct(double[] a,
                                double[] b)
Calculates the dot product between two arrays of equal length

Parameters:
a - first array
b - second array
Returns:
retuns the dot product of the two arrays

ncc

public static double ncc(double[] a,
                         double[] b)
Calculates the dot product between two arrays of equal length

Parameters:
a - first array
b - second array
Returns:
retuns the dot product of the two arrays

reconstruct

public double[] reconstruct(double[] update)
Reconstructs given the update

Parameters:
update - the parameter update
Returns:
returns the reconstructed vector

main

public static void main(java.lang.String[] args)
Main method for testing

Parameters:
args -