Facemorph
Class PCW

java.lang.Object
  extended by Facemorph.PCW

public class PCW
extends java.lang.Object

Principal component wavelets class


Constructor Summary
PCW()
          Creates a new instance of PCW
 
Method Summary
 double[] analyse(Pyramid pyr)
          Finds the best weights for the given Pyramid
 double[] analyseMasked(Pyramid pyr, FloatImage mask)
          Finds the weights of this Pyramid after masking
 Pyramid getAverage()
          Get the mean pyramid
 Pyramid getComponent(int i)
          Get the ith component
 int getCount()
          Get the number of components
static void main(java.lang.String[] args)
          Main method used for testing
 void read(java.lang.String file, int maxComp)
          Reads PCI data from a directory
 Pyramid reconstruct(double[] w)
          Build a Pyramid using the weights given
 Pyramid reconstruct(float[] w)
          Build a Pyramid using the weights given
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PCW

public PCW()
Creates a new instance of PCW

Method Detail

getCount

public int getCount()
Get the number of components

Returns:
returns the number of components

getAverage

public Pyramid getAverage()
Get the mean pyramid

Returns:
The mean Pyramid

getComponent

public Pyramid getComponent(int i)
Get the ith component

Parameters:
i - the index of the required component
Returns:
returns the requested component

read

public void read(java.lang.String file,
                 int maxComp)
Reads PCI data from a directory

Parameters:
file - The text file containing the names of the image component files and their variance
maxComp - The maximum number of components to read

reconstruct

public Pyramid reconstruct(double[] w)
Build a Pyramid using the weights given

Parameters:
w - the weights parameter
Returns:
returns the reconstructed component

reconstruct

public Pyramid reconstruct(float[] w)
Build a Pyramid using the weights given

Parameters:
w - the weights parameter
Returns:
returns the reconstructed component

analyse

public double[] analyse(Pyramid pyr)
Finds the best weights for the given Pyramid

Parameters:
pyr - the Pyramid to analyse
Returns:
returns the optimal weights in this PCW model

analyseMasked

public double[] analyseMasked(Pyramid pyr,
                              FloatImage mask)
Finds the weights of this Pyramid after masking

Parameters:
pyr - The Pyramid to analyse
mask - the mask to use
Returns:
return the weightings

main

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

Parameters:
args -