|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object Facemorph.psm.PSM
public class PSM
PSM implementation using steerable pyramids (doesn't work very well, the PSMNode class is preferred)
PSMNode
Constructor Summary | |
---|---|
PSM()
PSM constructor |
|
PSM(int start,
BigMat mst,
DiagonalGMM[] appGauss,
DiagonalGaussian[] gauss,
boolean[] visited,
java.util.ArrayList<Filter> filters,
Filter lowpass,
int w,
int h,
int levs)
PSM constructor |
Method Summary | |
---|---|
void |
batchTest(java.lang.String outfold,
java.util.ArrayList<java.lang.String> imageNames,
java.util.ArrayList<java.lang.String> templateNames,
int w)
|
double |
calculateFeatureProbability(SteerablePyramid pyr,
float x,
float y)
Calculate the probability of this feature |
FloatImage |
evaluateProbability(FloatImage source)
Evaluate the probability using Steerable pyramid |
FloatImage |
evaluateProbability(SteerablePyramid pyr)
Evaluate the probability by recursing down and up the tree |
static int |
findBestRoot(BigMat tree,
BigMat graph)
Find the best root of the tree |
java.util.ArrayList<java.awt.geom.Point2D.Float> |
getFeatures()
Get the feature points |
java.util.ArrayList<java.awt.geom.Point2D.Float> |
getFeatures(FloatImage source)
Get the feature points in the image |
void |
getFeatures(int x,
int y,
java.util.ArrayList<java.awt.geom.Point2D.Float> points)
Get the features |
static double[] |
getFeatureVector(SteerablePyramid pyr,
float x,
float y)
Get the feature vector from a steerable pyramid |
static void |
main(java.lang.String[] args)
|
static BigMat |
minimumSpanningTree(BigMat graph)
Calculate the MST |
static double |
ncc(double[] v1,
double[] v2)
The normalised cross correlation |
void |
read(java.io.InputStream in)
Read from an input stream |
void |
read(java.io.StreamTokenizer st)
Read from a StreamTokenizer |
void |
read(java.lang.String fileName)
Read from a file |
static PSM |
train(java.util.ArrayList<java.lang.String> imageNames,
java.util.ArrayList<java.lang.String> templateNames,
int[] pointList,
int w,
java.util.ArrayList<Filter> filters,
Filter lowpass,
int maxLev)
PSM training method |
void |
write(java.io.PrintStream ps)
Write to a PrintStream |
void |
write(java.lang.String fileName)
Write PSM to a file |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public PSM()
public PSM(int start, BigMat mst, DiagonalGMM[] appGauss, DiagonalGaussian[] gauss, boolean[] visited, java.util.ArrayList<Filter> filters, Filter lowpass, int w, int h, int levs)
start
- the start nodemst
- the minimum spanning treeappGauss
- the appearance models for the featuresgauss
- the point distributionsvisited
- indicates which nodes have been visitedfilters
- the filters to use to build the pyramidslowpass
- the lowpass filters to use to build the pyramidsw
- the widthh
- the heightlevs
- the levelsMethod Detail |
---|
public void write(java.lang.String fileName)
fileName
- the file to write topublic void write(java.io.PrintStream ps)
ps
- the PrintStream to write topublic void read(java.lang.String fileName)
fileName
- the file to read frompublic void read(java.io.InputStream in) throws java.io.IOException
in
- the stream to read from
java.io.IOException
public void read(java.io.StreamTokenizer st) throws java.io.IOException
st
- the StreamTokenizer to read from
java.io.IOException
public static PSM train(java.util.ArrayList<java.lang.String> imageNames, java.util.ArrayList<java.lang.String> templateNames, int[] pointList, int w, java.util.ArrayList<Filter> filters, Filter lowpass, int maxLev)
imageNames
- the names of the training imagestemplateNames
- the names of the training templatespointList
- the list of points to use from each templatew
- the training widthfilters
- the filters to use to build the pyramidlowpass
- the low pass filter to use to build the pyramidmaxLev
- the maximum level to build the pyramid to
public static int findBestRoot(BigMat tree, BigMat graph)
tree
- the mstgraph
- the original completed weighted edge graph
public static BigMat minimumSpanningTree(BigMat graph)
graph
- the Graph to find the MST for
public FloatImage evaluateProbability(FloatImage source)
source
- the source image
public static double[] getFeatureVector(SteerablePyramid pyr, float x, float y)
pyr
- the pyramidx
- the x-coorsy
- the y-coord
public double calculateFeatureProbability(SteerablePyramid pyr, float x, float y)
pyr
- the steerable pyramidx
- x-coordy
- y-coord
public FloatImage evaluateProbability(SteerablePyramid pyr)
pyr
- the pyramid to use
public void getFeatures(int x, int y, java.util.ArrayList<java.awt.geom.Point2D.Float> points)
x
- the x-coordy
- the y-coordpoints
- the point list to add the features topublic java.util.ArrayList<java.awt.geom.Point2D.Float> getFeatures(FloatImage source)
source
- the input image
public java.util.ArrayList<java.awt.geom.Point2D.Float> getFeatures()
public static double ncc(double[] v1, double[] v2)
v1
- the first vectorv2
- the second vector
public void batchTest(java.lang.String outfold, java.util.ArrayList<java.lang.String> imageNames, java.util.ArrayList<java.lang.String> templateNames, int w)
outfold
- imageNames
- templateNames
- w
- public static void main(java.lang.String[] args)
args
-
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |