frog
Interface GestureModel

All Known Implementing Classes:
GestureHMM

public interface GestureModel

GestureModel is an interface for classes that attempt to serve as a model structure for gestures. "Gestures" are understood in terms of acceleration data. In particular, GestureModel is based on a 3D-acceleration based approach to reading gestures. GestureModel's must be able to train with data, recognize against gesture instances, as well as record statistics relevant to measuring effectiveness of training/recognition.

Author:
Team Better Recognize

Field Summary
static int GESTUREHMM
          This is the GestureModel type index for GestureHMM models
static int NUM_TYPES_SUPPORTED
          This is the number of GestureModel implementations currently supported by GestureModel.
 
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()
          Returns a value that represents the default probability associated with this GestureModel.
 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.
 double getProbability(Vector<Accel3D> instance)
          Computes and returns the probability with which the given gesture instance matches with this GestureModel.
 Vector<Vector<Accel3D>> getTrainingSet()
          Accessor for the training set of gesture instances associated with this GestureModel
 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.
 

Field Detail

GESTUREHMM

static final int GESTUREHMM
This is the GestureModel type index for GestureHMM models

See Also:
Constant Field Values

NUM_TYPES_SUPPORTED

static final int NUM_TYPES_SUPPORTED
This is the number of GestureModel implementations currently supported by GestureModel.

See Also:
Constant Field Values
Method Detail

addAccel

boolean addAccel(int inum,
                 Accel3D acc)
Adds an additional Accel3D to the end of a gesture instance.

Parameters:
inum - The index of the gesture instance to modify
acc - The Accel3D to insert
Returns:
a boolean signifying success or failure of the insertion

addInstance

void addInstance(Vector<Accel3D> instance)
Adds an entire gesture instance to the gesture set.

Parameters:
instance - The instance to insert

clearStats

void clearStats()
Clears all saved statistics associated with this GestureModel


correct

void correct()
Signifies a correct recognition event to the GestureModel. Statistics for the model are updated accordingly.


getAverageRecognitionProbability

double getAverageRecognitionProbability()
Returns the average certainty currently associated with this GestureModel. The average certainty is calculated based on all calls made to matchedWithProbability(double).

Returns:
the average recognition probability (certainty)

getDefaultProbability

double getDefaultProbability()
Returns a value that represents the default probability associated with this GestureModel. This is useful, for example, in Bayesian classification.

Returns:
the default probability of this model.

getIcon

BufferedImage getIcon()
Returns the icon of this gesture as a BufferedImage.

Returns:
the icon of this gesture; or null if the gesture has no icon.

getName

String getName()
Returns the name associated with this GestureModel. (e.g. a model for a circle might appropriately be named "Circle")

Returns:
the name of the GestureModel.

getNumCorrect

int getNumCorrect()
Accessor for the number correct statistic. This value is entirely dependent on calls to correct()

Returns:
the saved number of correct recognition events.

getNumIncorrect

int getNumIncorrect()
Accessor for the number incorrect statistic. This value is entirely dependent on calls to incorrect()

Returns:
the saved number of incorrect recognition events.

getNumNotRecognized

int getNumNotRecognized()
Accessor for the number not recognized statistic. This value is entirely dependent on calls to notRecognized()

Returns:
the saved number of unrecognized recognition events.

getProbability

double getProbability(Vector<Accel3D> instance)
Computes and returns the probability with which the given gesture instance matches with this GestureModel.

Parameters:
instance - the series of acceleration vectors representing a single gesture instance
Returns:
the probability that the instance matches this model

getType

int getType()
Accessor for the GestureModel type index. Should return the value as specified in the GestureModel interface.

Returns:
the GestureModel type index.

getTrainingSet

Vector<Vector<Accel3D>> getTrainingSet()
Accessor for the training set of gesture instances associated with this GestureModel

Returns:
the model's gesture set

incorrect

void incorrect()
Signifies an incorrect recognition event to the GestureModel. Statistics for the model are updated accordingly.


matchedWithProbability

void matchedWithProbability(double prob)
Signifies a recognition event that occurred with a given probability. This updates the average recognition probability of the GestureModel, as accessed by getAverageRecognitionProbability()

Parameters:
prob - the probability (0-1) with which the match occurred

notRecognized

void notRecognized()
Signifies an unrecognized recognition event to the GestureModel. Statistics for the model are updated accordingly.


removeAccel

boolean removeAccel(int inum,
                    int anum)
Removes an acceleration value from the gesture set.

Parameters:
inum - the index of the instance to access
anum - the index of the acceleration to remove
Returns:
a boolean signifying success or failure of the deletion

removeInstance

boolean removeInstance(int inum)
Removes a gesture instance from the gesture set.

Parameters:
inum - the index of the instance to remove
Returns:
a boolean signifying success or failure of the deletion

setIcon

void setIcon(byte[] imageBuffer)
             throws IOException
Associates a byte array image with the GestureModel

Parameters:
imageBuffer - the byte array image
Throws:
IOException - thrown if image reading fails

setName

void setName(String n)
Associates a representative name with this GestureModel

Parameters:
n - the name to associate

train

boolean train()
Trains the GestureModel, constructing everything necessary for recognition to take place.