Facemorph.mdl
Class MDL2D

java.lang.Object
  extended by Facemorph.Powell
      extended by Facemorph.mdl.MDL2D

public class MDL2D
extends Powell

Attempt at minimum description length based alignment


Field Summary
 
Fields inherited from class Facemorph.Powell
TINY
 
Constructor Summary
MDL2D(int w, int h, java.awt.image.BufferedImage bimg, double[] currentParams, java.util.ArrayList<java.awt.image.BufferedImage> images, java.util.ArrayList<double[]> params, double shapeError, double colourError)
          Constructor for MDL
 
Method Summary
 double func(double[] params)
          Func should be overrided to calculate the error given the parameters params
static void main(java.lang.String[] args)
          Main method used for testing
 void onIteration(double[] params)
          onIteration is called once per complete itrations to show the best current guess.
static void readImagesAndTemplates(java.lang.String listFile, java.util.ArrayList<java.awt.image.BufferedImage> images, java.util.ArrayList<Template> templates)
          Read the images and Template from a list file
 
Methods inherited from class Facemorph.Powell
linmin, optimiseGA, powell, powell, spsa, spsa2
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MDL2D

public MDL2D(int w,
             int h,
             java.awt.image.BufferedImage bimg,
             double[] currentParams,
             java.util.ArrayList<java.awt.image.BufferedImage> images,
             java.util.ArrayList<double[]> params,
             double shapeError,
             double colourError)
Constructor for MDL

Parameters:
w - width
h - height
bimg - the BufferedImage
currentParams - the current parameters
images - the image list
params - initial parameters for each image
shapeError - shape error weighting
colourError - colour error weighting
Method Detail

func

public double func(double[] params)
Description copied from class: Powell
Func should be overrided to calculate the error given the parameters params

Specified by:
func in class Powell
Parameters:
params - the parameters to evaluate
Returns:
returns the error

onIteration

public void onIteration(double[] params)
Description copied from class: Powell
onIteration is called once per complete itrations to show the best current guess. It can be implemented with an empty body if not needed

Specified by:
onIteration in class Powell
Parameters:
params - the current params of the model

readImagesAndTemplates

public static void readImagesAndTemplates(java.lang.String listFile,
                                          java.util.ArrayList<java.awt.image.BufferedImage> images,
                                          java.util.ArrayList<Template> templates)
                                   throws java.io.FileNotFoundException,
                                          java.io.IOException
Read the images and Template from a list file

Parameters:
listFile - the list file to use
images - the array of images to put the image in
templates - the array of templates to put the templates in
Throws:
java.io.FileNotFoundException
java.io.IOException

main

public static void main(java.lang.String[] args)
                 throws java.io.FileNotFoundException,
                        java.io.IOException
Main method used for testing

Parameters:
args - args[0] = list of images and templates
Throws:
java.io.FileNotFoundException
java.io.IOException