|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectfr.lri.swingstates.gestures.AbstractClassifier
fr.lri.swingstates.gestures.rubine.RubineClassifier
public class RubineClassifier
A classifier that implements rubine's algorithm to classify gestures.
| Field Summary | |
|---|---|
static java.lang.String[] |
NAME_FEATURES
|
static int |
PF_ATH
index of sum of absolute values of angles traversed) in a vector of features. |
static int |
PF_BB_LEN
index of length of bounding box diagonal in a vector of features. |
static int |
PF_BB_TH
index of angle of bounding box diagonal in a vector of features. |
static int |
PF_DUR
index of path duration in a vector of features. |
static int |
PF_INIT_COS
index of cosinus initial angle (angle between first and third points) in a vector of features. |
static int |
PF_INIT_SIN
index of sinus initial angle (angle between first and third points) in a vector of features. |
static int |
PF_LEN
index of arc length of path in a vector of features. |
static int |
PF_MAXV
index of maximum speed in a vector of features. |
static int |
PF_SE_COS
index of cosinus of angle between start and end points in a vector of features. |
static int |
PF_SE_LEN
index of length between start and end points in a vector of features. |
static int |
PF_SE_SIN
index of sinus of angle between start and end points in a vector of features. |
static int |
PF_SQTH
index of sum of squares of angles traversed) in a vector of features. |
static int |
PF_TH
index of total angle traversed in a vector of features. |
| Constructor Summary | |
|---|---|
RubineClassifier()
|
|
| Method Summary | |
|---|---|
int |
addClass(java.lang.String className)
Adds a class of gestures to this classifier. |
void |
addExample(java.lang.String className,
Gesture example)
Adds a gesture example to this classifier. |
java.lang.String |
classify(Gesture g)
Recognizes a gesture. |
double |
getCurrentDistance()
|
java.util.Vector<Gesture> |
getExamples(java.lang.String className)
Returns the vector of gesture examples for a given class. |
static java.util.Vector<java.lang.Double> |
getFeatures(Gesture g)
Computes the vector of features for a gesture. |
java.util.Vector<java.lang.Double> |
getFeatures(java.lang.String className)
Computes the vector of features for a given class of gestures. |
static java.util.Vector<java.lang.Double> |
getFeatures(java.util.Vector<java.awt.geom.Point2D> points)
Computes the vector of features for a list of points. |
int |
getMaximumDistance()
|
int |
getNbGestureExamples(java.lang.String className)
|
CPolyLine |
getRepresentative(java.lang.String className)
Returns a graphical representation for a given class of gestures. |
static RubineClassifier |
newClassifier(java.io.File filename)
Builds a new classifier by loading its definition in a file. |
static RubineClassifier |
newClassifier(java.lang.String file)
Builds a new classifier by loading its definition in a file. |
static RubineClassifier |
newClassifier(java.net.URL url)
Builds a new classifier by loading its definition in a url. |
void |
removeClass(java.lang.String className)
Removes a class of gestures from this classifier. |
void |
removeExample(Gesture gesture)
Removes a gesture example from this classifier. |
void |
renameClass(java.lang.String previousClassName,
java.lang.String newClassName)
Renames a class of gestures. |
void |
reset()
Resets this classifier (i.e. |
void |
setMaximumDistance(int dist)
Sets a maximum distance threshold for recognition. |
java.util.Vector<Score> |
sortedClasses(Gesture g)
Computes a sorted list of classes contained in this recognizer from the best match to the the worst match given a gesture. |
| Methods inherited from class fr.lri.swingstates.gestures.AbstractClassifier |
|---|
getClassesNames, getTemplate, getTemplates, save, setTemplate |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static int PF_INIT_COS
public static int PF_INIT_SIN
public static int PF_BB_LEN
public static int PF_BB_TH
public static int PF_SE_LEN
public static int PF_SE_COS
public static int PF_SE_SIN
public static int PF_LEN
public static int PF_TH
public static int PF_ATH
public static int PF_SQTH
public static int PF_DUR
public static final int PF_MAXV
public static java.lang.String[] NAME_FEATURES
| Constructor Detail |
|---|
public RubineClassifier()
| Method Detail |
|---|
public static RubineClassifier newClassifier(java.lang.String file)
file - The name of the file containing the definition of the
classifier.
public static RubineClassifier newClassifier(java.net.URL url)
url - The url containing the definition of the classifier.
public static RubineClassifier newClassifier(java.io.File filename)
filename - The name of the file containing the definition of the
classifier.
public void reset()
reset in class AbstractClassifierpublic void removeClass(java.lang.String className)
removeClass in class AbstractClassifierclassName - The name of the class of gestures to remove.public CPolyLine getRepresentative(java.lang.String className)
getRepresentative in class AbstractClassifierclassName - the name of the gesture class.
className.public java.lang.String classify(Gesture g)
classify in class AbstractClassifierg - The gesture to recognize
public int addClass(java.lang.String className)
addClass in class AbstractClassifierclassName - The name of the class of gestures to add.
public java.util.Vector<java.lang.Double> getFeatures(java.lang.String className)
className - The name of the class of gesture.
className class of
gestures, null if this class does not exist.public int getNbGestureExamples(java.lang.String className)
className - The name of the class of gesture.
className class of
gestures, -1 if this class does not exist..public double getCurrentDistance()
public void setMaximumDistance(int dist)
classify returns null). By default, this distance is set
to 1000.
dist - The maximum distance to the average vector of recognized
class.public int getMaximumDistance()
public java.util.Vector<Score> sortedClasses(Gesture g)
sortedClasses in class AbstractClassifierg - The gesture
public static java.util.Vector<java.lang.Double> getFeatures(Gesture g)
g - The gesture
public static java.util.Vector<java.lang.Double> getFeatures(java.util.Vector<java.awt.geom.Point2D> points)
points - The list of points
public void removeExample(Gesture gesture)
removeExample in class AbstractClassifiergesture - the gesture to remove
public void addExample(java.lang.String className,
Gesture example)
addExample in class AbstractClassifierclassName - the gesture example's classexample - the gesture example
public void renameClass(java.lang.String previousClassName,
java.lang.String newClassName)
renameClass in class AbstractClassifierpreviousClassName - The current name of this class of gesturesnewClassName - The new name of this class of gestures
public java.util.Vector<Gesture> getExamples(java.lang.String className)
throws java.lang.UnsupportedOperationException
getExamples in class AbstractClassifierclassName - The name of the class
className.
java.lang.UnsupportedOperationException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||