|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectfrog.GestureHMM
public class GestureHMM
GestureHMM is a modeling class that represents a gesture. As a model, it requires data (gesture instances) as well as parameters for training. GestureHMM utilizes a statistical HMM (as its name suggests) model as well as a Baum-Welch training method.
| Field Summary |
|---|
| Fields inherited from interface frog.GestureModel |
|---|
GESTUREHMM, NUM_TYPES_SUPPORTED |
| Constructor Summary | |
|---|---|
GestureHMM(String n)
Constructs a GestureHMM with a name and default training parameters. |
|
GestureHMM(String n,
byte[] iconBuf)
Constructs a GestureHMM with a name and image. |
|
GestureHMM(String n,
GestureHMMParameters gParams)
Constructs a GestureHMM with a name and training parameters. |
|
GestureHMM(String n,
GestureHMMParameters gParams,
byte[] iconBuf)
Constructs a GestureHMM with a name, training parameters, and an image. |
|
GestureHMM(String n,
GestureHMMParameters gParams,
KmeansParameters kParams)
Constructs a GestureHMM with a name, training parameters, and quantizer parameters (Kmeans in particular). |
|
GestureHMM(String n,
GestureHMMParameters gParams,
KmeansParameters kParams,
byte[] iconBuf)
Constructs a GestureHMM with a name, training parameters, a gesture set, and an image. |
|
GestureHMM(String n,
GestureHMMParameters gParams,
KmeansParameters kParams,
Vector<Vector<Accel3D>> instances)
Constructs a GestureHMM with a name, training parameters, quantizer parameters (Kmeans in particular), and a training set. |
|
GestureHMM(String n,
GestureHMMParameters gParams,
KmeansParameters kParams,
Vector<Vector<Accel3D>> instances,
byte[] iconBuf)
Constructs a GestureHMM with a name, training parameters, a gesture set, and an image. |
|
GestureHMM(String n,
GestureHMMParameters gParams,
Vector<Vector<Accel3D>> instances)
Constructs a GestureHMM with a name, training parameters, as well as a gesture set. |
|
GestureHMM(String n,
GestureHMMParameters gParams,
Vector<Vector<Accel3D>> instances,
byte[] iconBuf)
Constructs a GestureHMM with a name, training parameters, a gesture set, and an image. |
|
GestureHMM(String n,
Vector<Vector<Accel3D>> instances)
Constructs a GestureHMM with a name and gesture set as well as default training parameters. |
|
| Method Summary | |
|---|---|
boolean |
addAccel(int inum,
Accel3D acc)
Adds an additional Accel3D to the end of a gesture instance. |
void |
addInstance(Vector<Accel3D> instance)
Adds an entire gesture instance to the gesture set. |
void |
clearStats()
Clears all saved statistics associated with this GestureModel |
void |
correct()
Signifies a correct recognition event to the GestureModel. |
double |
getAverageRecognitionProbability()
Returns the average certainty currently associated with this GestureModel. |
double |
getDefaultProbability()
For GestureHMM, default probability is obtained by averaging the probabilities with which each instance in the set used to create this model match the model. |
BufferedImage |
getIcon()
Returns the icon of this gesture as a BufferedImage. |
String |
getName()
Returns the name associated with this GestureModel. |
int |
getNumCorrect()
Accessor for the number correct statistic. |
int |
getNumIncorrect()
Accessor for the number incorrect statistic. |
int |
getNumNotRecognized()
Accessor for the number not recognized statistic. |
int |
getNumStates()
Returns the number of hidden states in this GestureHMM. |
double |
getProbability(Vector<Accel3D> instance)
For GestureHMM, probability is computed using the forward algorithm. |
Vector<Vector<Accel3D>> |
getTrainingSet()
Accessor for the training set of gesture instances associated with this GestureModel |
double |
getTrainingThreshold()
Returns the training threshold of this GestureHMM. |
int |
getType()
Accessor for the GestureModel type index. |
void |
incorrect()
Signifies an incorrect recognition event to the GestureModel. |
void |
matchedWithProbability(double prob)
Signifies a recognition event that occurred with a given probability. |
void |
notRecognized()
Signifies an unrecognized recognition event to the GestureModel. |
boolean |
removeAccel(int inum,
int anum)
Removes an acceleration value from the gesture set. |
boolean |
removeInstance(int inum)
Removes a gesture instance from the gesture set. |
void |
setIcon(byte[] imageBuffer)
Associates a byte array image with the GestureModel |
void |
setName(String n)
Associates a representative name with this GestureModel |
boolean |
train()
Trains the GestureModel, constructing everything necessary for recognition to take place. |
boolean |
train(GestureHMMParameters gParams)
Trains the GestureHMM with a specified set of training parameters. |
boolean |
train(GestureHMMParameters gParams,
KmeansParameters kParams)
Trains the GestureHMM with a specified set of training parameters as well as a specified set of quantizer parameters. |
boolean |
train(KmeansParameters params)
Trains the GestureHMM with a specified set of quantizer parameters. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public GestureHMM(String n)
n - a name to associate with the GestureHMM
public GestureHMM(String n,
Vector<Vector<Accel3D>> instances)
n - a name to associate with the GestureHMMinstances - the gesture set for training the GestureHMM
public GestureHMM(String n,
GestureHMMParameters gParams)
n - a name to associate with the GestureHMMgParams - HMM parameters for training
public GestureHMM(String n,
GestureHMMParameters gParams,
Vector<Vector<Accel3D>> instances)
n - a name to associate with the GestureHMMgParams - HMM parameters for traininginstances - the gesture set for training the GestureHMM
public GestureHMM(String n,
GestureHMMParameters gParams,
KmeansParameters kParams)
n - a name to associate with the GestureHMMgParams - HMM parameters for trainingkParams - Kmeans parameters for training the quantizer
public GestureHMM(String n,
GestureHMMParameters gParams,
KmeansParameters kParams,
Vector<Vector<Accel3D>> instances)
n - a name to associate with the GestureHMMgParams - HMM parameters for trainingkParams - Kmeans parameters for training the quantizerinstances - the gesture set for training the GestureHMM
public GestureHMM(String n,
byte[] iconBuf)
throws IOException
n - a name to associate with the GestureHMMiconBuf - the byte array image to associate with the GestureHMM
IOException - thrown if image reading fails
public GestureHMM(String n,
GestureHMMParameters gParams,
byte[] iconBuf)
throws IOException
n - a name to associate with the GestureHMMgParams - HMM parameters for trainingiconBuf - the byte array image to associate with the GestureHMM
IOException - thrown if image reading fails
public GestureHMM(String n,
GestureHMMParameters gParams,
Vector<Vector<Accel3D>> instances,
byte[] iconBuf)
throws IOException
n - a name to associate with the GestureHMMgParams - HMM parameters for traininginstances - the gesture set for training the GestureHMMiconBuf - the byte array image to associate with the GestureHMM
IOException - thrown if image reading fails
public GestureHMM(String n,
GestureHMMParameters gParams,
KmeansParameters kParams,
byte[] iconBuf)
throws IOException
n - a name to associate with the GestureHMMgParams - HMM parameters for trainingkParams - Kmeans parameters for training the quantizericonBuf - the byte array image to associate with the GestureHMM
IOException - thrown if image reading fails
public GestureHMM(String n,
GestureHMMParameters gParams,
KmeansParameters kParams,
Vector<Vector<Accel3D>> instances,
byte[] iconBuf)
throws IOException
n - a name to associate with the GestureHMMgParams - HMM parameters for trainingkParams - Kmeans parameters for training the quantizerinstances - the gesture set for training the GestureHMMiconBuf - the byte array image to associate with the GestureHMM
IOException - thrown if image reading fails| Method Detail |
|---|
public boolean addAccel(int inum,
Accel3D acc)
GestureModel
addAccel in interface GestureModelinum - The index of the gesture instance to modifyacc - The Accel3D to insert
public void addInstance(Vector<Accel3D> instance)
GestureModel
addInstance in interface GestureModelinstance - The instance to insertpublic void clearStats()
GestureModel
clearStats in interface GestureModelpublic void correct()
GestureModel
correct in interface GestureModelpublic double getDefaultProbability()
getDefaultProbability in interface GestureModelpublic BufferedImage getIcon()
GestureModel
getIcon in interface GestureModelnull if the gesture
has no icon.public String getName()
GestureModel
getName in interface GestureModelpublic int getNumCorrect()
GestureModelGestureModel.correct()
getNumCorrect in interface GestureModelpublic int getNumIncorrect()
GestureModelGestureModel.incorrect()
getNumIncorrect in interface GestureModelpublic int getNumNotRecognized()
GestureModelGestureModel.notRecognized()
getNumNotRecognized in interface GestureModelpublic int getNumStates()
public double getProbability(Vector<Accel3D> instance)
getProbability in interface GestureModelinstance - the series of acceleration vectors representing a
single gesture instance
public Vector<Vector<Accel3D>> getTrainingSet()
GestureModel
getTrainingSet in interface GestureModelpublic double getTrainingThreshold()
public void incorrect()
GestureModel
incorrect in interface GestureModelpublic void notRecognized()
GestureModel
notRecognized in interface GestureModel
public boolean removeAccel(int inum,
int anum)
GestureModel
removeAccel in interface GestureModelinum - the index of the instance to accessanum - the index of the acceleration to remove
public boolean removeInstance(int inum)
GestureModel
removeInstance in interface GestureModelinum - the index of the instance to remove
public void setName(String n)
GestureModel
setName in interface GestureModeln - the name to associatepublic boolean train()
GestureModel
train in interface GestureModelpublic boolean train(GestureHMMParameters gParams)
gParams - the training parameters
public boolean train(GestureHMMParameters gParams,
KmeansParameters kParams)
gParams - the training parameterskParams - the Kmeans parameters
public boolean train(KmeansParameters params)
params - The K-means parameters.
public void setIcon(byte[] imageBuffer)
throws IOException
GestureModel
setIcon in interface GestureModelimageBuffer - the byte array image
IOException - thrown if image reading failspublic double getAverageRecognitionProbability()
GestureModelGestureModel.matchedWithProbability(double).
getAverageRecognitionProbability in interface GestureModelpublic void matchedWithProbability(double prob)
GestureModelGestureModel.getAverageRecognitionProbability()
matchedWithProbability in interface GestureModelprob - the probability (0-1) with which the match occurredpublic int getType()
GestureModel
getType in interface GestureModel
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||