Facemorph.psm
Interface Feature

All Known Implementing Classes:
DiagonalEMFeature, DiagonalGaussianFeature, DiagonalGMMFeature, EMFeature, OESFFeature, PatchFeature

public interface Feature

A generic PSM feature interface


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
 

Method Detail

getProbability

FloatImage getProbability(int featureIndex)
Get the probability image for a particular feature

Parameters:
featureIndex - the feature number
Returns:
the probability image

getFeatureVector

double[] getFeatureVector(java.awt.geom.Point2D.Float p)
Get the feature vector at the location specified

Parameters:
p - the point to sample
Returns:
the feature vector (meaning is implementation dependent)

setImage

void setImage(java.awt.Image img)
Set the image to use

Parameters:
img - the image to use

setFeatureCount

void setFeatureCount(int count)
Sets the number of features

Parameters:
count - the number of features

addSample

void addSample(int featureIndex,
               java.awt.geom.Point2D.Float p)
Add a sample when training the patches

Parameters:
featureIndex -
p -

normalise

void normalise()
Normalise the feature models if needed at the end of training


read

void read(java.io.StreamTokenizer st,
          java.lang.String folder,
          boolean url)
          throws java.io.IOException
Read a feature from a file or url

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

void write(java.io.PrintStream out,
           java.lang.String folder)
Write teh feature to a PrintStream

Parameters:
out - the output stream
folder - the folder to write (this and child nodes) to