|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.ObjectFacemorph.aam.AAM
public class AAM
Active Appearance Model Implementation
| Field Summary | |
|---|---|
static int |
APPEARANCE
Specifies the algorithm with the pre-calculated derivatives and Hessian, but in which the appearance is updated each iteration |
static int |
CAAM
Specifies to use the correlated active appearance model (NCC) algorithm |
static int |
CAAMSHAPE
NCC fiting with pre-calculated derivatives and Hessian |
static int |
SIMULTANEOUS
Specifies to use a variation on the simultaneuous (derivative and Hessian regularly updated) algorithm |
static int |
SPAN
Specifies the algorithm with precaculated derivatives and Hessian and the appearance variation projected out. |
| Constructor Summary | |
|---|---|
AAM(MaskInterface mask,
ASM asm,
PCI pci,
int type,
int warpType)
Creates a new instance of AAM |
|
| Method Summary | |
|---|---|
float[] |
analyseAppearance(FloatImage[] data)
reconstructs an image given the component weightings, using avrg instead of the built in average |
void |
buildAAMappearance(int warpType)
Builds an AAM for the appearance algorithm |
void |
buildAAMspan(int warpType)
Builds an AAM for the projected out appearance algorithm |
void |
buildCAAM(int warpType)
Builds a Correlated Active Appearance Model |
double[] |
convertFloatImage(FloatImage[] img)
Converts a FloatImage to a double array |
Template |
fitAAM(java.awt.Image subject,
Template template,
float scale,
int maxIts,
int maxLoops,
int start)
Attempt at fitting an AAM to an image using the currently selected method |
Template |
fitAAMappearance(java.awt.Image subject,
Template template,
float scale,
int maxIts,
int start)
Attempt at fitting an AAM to an image using the APPEARANCE method |
Template |
fitAAMSimultaneous(java.awt.Image subject,
Template template,
float scale,
int maxIts,
int maxLoops,
int start)
Attempt at fitting an AAM to an image using the SIMULTANEOUS method |
Template |
fitAAMspan(java.awt.Image subject,
Template template,
float scale,
int maxIts,
int start)
Attempt at fitting an AAM to an image using the SPAN method |
Template |
fitCAAM(java.awt.Image subject,
Template template,
float scale,
int maxIts,
int maxLoops,
int start)
Attempt at fitting an AAM to an image using the CAAM method |
Template |
fitCAAMshape(java.awt.Image subject,
Template template,
float scale,
int maxIts,
int start)
Attempt at fitting an AAM to an image using the CAAMSHAPE method |
static void |
main(java.lang.String[] args)
Main method for testing |
void |
projectOut(FloatImage[] diffImg,
PCI pci,
FloatImage mask)
Projects the appearance variation out the derivative image |
void |
readAAM(java.lang.String file)
Reads an AAM as created in psychomorph |
FloatImage[] |
reconstructAppearance(float[] params)
reconstructs an image given the component weightings, using avrg instead of the built in average |
void |
test(java.lang.String imageList,
java.lang.String resultsFile,
java.lang.String outDir)
Run a set of tests. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int APPEARANCE
public static final int SPAN
public static final int CAAM
public static final int SIMULTANEOUS
public static final int CAAMSHAPE
| Constructor Detail |
|---|
public AAM(MaskInterface mask,
ASM asm,
PCI pci,
int type,
int warpType)
mask - MaskInterface file to restrict changes to one part of the faceasm - Active shape model data (Template, Principal Component Analysis (PCA) and Image) shape datapci - PCA image datatype - Indicates the algorithm to usewarpType - the type of warp to useWarp.createWarp(int, int, int, int, int, boolean)| Method Detail |
|---|
public void buildAAMappearance(int warpType)
warpType - the type of warp to useWarp.createWarp(int, int, int, int, int, boolean)public void buildAAMspan(int warpType)
warpType - the type of warp to useWarp.createWarp(int, int, int, int, int, boolean)
public void projectOut(FloatImage[] diffImg,
PCI pci,
FloatImage mask)
diffImg - The derivative to remove appearance variation frompci - The PCA image datamask - The mask to applypublic void readAAM(java.lang.String file)
file - Name of file to load
public Template fitAAM(java.awt.Image subject,
Template template,
float scale,
int maxIts,
int maxLoops,
int start)
throws java.lang.RuntimeException
template - Initial point configurationmaxIts - maximum number of iterations to performmaxLoops - maximum number of recalculations of the derivatives and Hessian (if supported by the algorithm)start - Start value of counter for debuggingsubject - The image to fit tooscale - the scale todo this search at (should be 1!)
java.lang.RuntimeException - Exception thrown if the AAM is not correctly initialised
public Template fitAAMappearance(java.awt.Image subject,
Template template,
float scale,
int maxIts,
int start)
throws java.lang.RuntimeException
template - Initial point configurationmaxIts - maximum number of iterations to performstart - Start value of counter for debuggingsubject - The image to fit tooscale - the scale todo this search at (should be 1!)
java.lang.RuntimeException - Exception thrown if the AAM is not correctly initialised
public Template fitAAMspan(java.awt.Image subject,
Template template,
float scale,
int maxIts,
int start)
throws java.lang.RuntimeException
template - Initial point configurationmaxIts - maximum number of iterations to performstart - Start value of counter for debuggingsubject - The image to fit tooscale - the scale todo this search at (should be 1!)
java.lang.RuntimeException - Exception thrown if the AAM is not correctly initialisedpublic FloatImage[] reconstructAppearance(float[] params)
params - the component weightings
public float[] analyseAppearance(FloatImage[] data)
data - The image to analyse
public void buildCAAM(int warpType)
warpType - the type of warp to useWarp.createWarp(int, int, int, int, int, boolean)
public Template fitCAAM(java.awt.Image subject,
Template template,
float scale,
int maxIts,
int maxLoops,
int start)
throws java.lang.RuntimeException
template - Initial point configurationmaxIts - maximum number of iterations to performmaxLoops - maximum number of recalculations of the derivatives and Hessian (if supported by the algorithm)start - Start value of counter for debuggingsubject - The image to fit tooscale - the scale todo this search at (should be 1!)
java.lang.RuntimeException - Exception thrown if the AAM is not correctly initialised
public Template fitCAAMshape(java.awt.Image subject,
Template template,
float scale,
int maxIts,
int start)
throws java.lang.RuntimeException
template - Initial point configurationmaxIts - maximum number of iterations to performstart - Start value of counter for debuggingsubject - The image to fit tooscale - the scale todo this search at (should be 1!)
java.lang.RuntimeException - Exception thrown if the AAM is not correctly initialised
public Template fitAAMSimultaneous(java.awt.Image subject,
Template template,
float scale,
int maxIts,
int maxLoops,
int start)
throws java.lang.RuntimeException
template - Initial point configurationmaxIts - maximum number of iterations to performmaxLoops - maximum number of recalculations of the derivatives and Hessian (if supported by the algorithm)start - Start value of counter for debuggingsubject - The image to fit tooscale - the scale todo this search at (should be 1!)
java.lang.RuntimeException - Exception thrown if the AAM is not correctly initialisedpublic double[] convertFloatImage(FloatImage[] img)
img - The image to convert
public static void main(java.lang.String[] args)
args - The parameters
public void test(java.lang.String imageList,
java.lang.String resultsFile,
java.lang.String outDir)
imageList - The text file listing the images and templates to test onresultsFile - The name of a CSV file to write the error histogram tooutDir - The name of the directory to write the adapted templates to.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||