Facemorph.psm
Class DiagonalEMFeature

java.lang.Object
  extended by Facemorph.psm.DiagonalEMFeature
All Implemented Interfaces:
Feature

public class DiagonalEMFeature
extends java.lang.Object
implements Feature

DiagonalEMFeature implementation


Constructor Summary
DiagonalEMFeature()
          DiagonalEMFeature constructor
 
Method Summary
 void addSample(int featureIndex, java.awt.geom.Point2D.Float p)
          Add a sample when training the patches
 double[] getFeatureVector(java.awt.geom.Point2D.Float p)
          Get the feature vector at the location specified
 FloatImage getProbability(int featureIndex)
          Get the probability image for a particular feature
 void normalise()
          Normalise the feature models if needed at the end of training
 void read(java.io.StreamTokenizer st, java.lang.String folder, boolean url)
          Read a feature from a file or url
 void setFeatureCount(int count)
          Sets the number of features
 void setImage(java.awt.Image img)
          Set the image to use
 void write(java.io.PrintStream out, java.lang.String folder)
          Write teh feature to a PrintStream
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DiagonalEMFeature

public DiagonalEMFeature()
DiagonalEMFeature constructor

Method Detail

setFeatureCount

public void setFeatureCount(int count)
Description copied from interface: Feature
Sets the number of features

Specified by:
setFeatureCount in interface Feature
Parameters:
count - the number of features

getFeatureVector

public double[] getFeatureVector(java.awt.geom.Point2D.Float p)
Description copied from interface: Feature
Get the feature vector at the location specified

Specified by:
getFeatureVector in interface Feature
Parameters:
p - the point to sample
Returns:
the feature vector (meaning is implementation dependent)

setImage

public void setImage(java.awt.Image img)
Description copied from interface: Feature
Set the image to use

Specified by:
setImage in interface Feature
Parameters:
img - the image to use

addSample

public void addSample(int featureIndex,
                      java.awt.geom.Point2D.Float p)
Description copied from interface: Feature
Add a sample when training the patches

Specified by:
addSample in interface Feature

normalise

public void normalise()
Description copied from interface: Feature
Normalise the feature models if needed at the end of training

Specified by:
normalise in interface Feature

read

public void read(java.io.StreamTokenizer st,
                 java.lang.String folder,
                 boolean url)
          throws java.io.IOException
Description copied from interface: Feature
Read a feature from a file or url

Specified by:
read in interface Feature
Parameters:
st - the StreamTokenizer to use
folder - useful for writing parts in separate files (maybe?)
url - is this a URL you're writing to
Throws:
java.io.IOException

write

public void write(java.io.PrintStream out,
                  java.lang.String folder)
Description copied from interface: Feature
Write teh feature to a PrintStream

Specified by:
write in interface Feature
Parameters:
out - the output stream
folder - the folder to write (this and child nodes) to

getProbability

public FloatImage getProbability(int featureIndex)
Description copied from interface: Feature
Get the probability image for a particular feature

Specified by:
getProbability in interface Feature
Parameters:
featureIndex - the feature number
Returns:
the probability image