|
||||||||||
| 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.shapeMatching.ShapeMatchingClassifier
public class ShapeMatchingClassifier
A very simple recognizer that performs simple shape matching based on a single example per class (one template):
| Constructor Summary | |
|---|---|
ShapeMatchingClassifier()
|
|
| Method Summary | |
|---|---|
void |
addClass(java.lang.String className,
java.util.Vector<java.awt.geom.Point2D> template)
Adds a class and set the template for this class. |
void |
addExample(java.lang.String className,
Gesture example)
Adds a gesture example to this classifier. |
java.lang.String |
classify(Gesture g)
Recognizes a gesture. |
NamedGesture |
classifyAndResample(Gesture g)
Classifies a gesture and return the collection of resampled points for the input gesture. |
java.util.Vector<Gesture> |
getExamples(java.lang.String className)
Returns the vector of gesture examples for a given class. |
int |
getMinimumStrokeLength()
|
int |
getNbPoints()
|
CPolyLine |
getRepresentative(java.lang.String className)
Returns a graphical representation for a given class of gestures. |
double |
getSizeScaleToSquare()
|
double |
getThreshold()
|
static ShapeMatchingClassifier |
newClassifier(java.io.File filename)
Builds a new classifier by loading its definition in a file. |
static ShapeMatchingClassifier |
newClassifier(java.lang.String file)
Builds a new classifier by loading its definition in a file. |
static ShapeMatchingClassifier |
newClassifier(java.net.URL url)
Builds a new classifier by loading its definition in a url. |
void |
removeExample(Gesture gesture)
Removes a gesture example from this classifier. |
void |
save(java.io.File filename)
Saves the definition of this classifier in a file. |
void |
setMinimumStrokeLength(int minimumStrokeLength)
|
void |
setSizeScaleToSquare(int size)
The side size of the bounding box to which the gesture is scaled after having being resampled. |
void |
setTemplate(java.lang.String className,
java.util.Vector<java.awt.geom.Point2D> template)
Sets the template gesture for a given existing class of gestures in this classifier. |
void |
setThreshold(double maximumDistance)
|
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 |
|---|
addClass, getClassesNames, getTemplate, getTemplates, removeClass, renameClass, reset |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ShapeMatchingClassifier()
| Method Detail |
|---|
public java.lang.String classify(Gesture g)
classify in class AbstractClassifierg - The gesture to recognize
public NamedGesture classifyAndResample(Gesture g)
g - The input gesture.
public static ShapeMatchingClassifier newClassifier(java.lang.String file)
file - The name of the file containing the definition of the
classifier.
public static ShapeMatchingClassifier newClassifier(java.io.File filename)
filename - The name of the file containing the definition of the
classifier.
public static ShapeMatchingClassifier newClassifier(java.net.URL url)
url - The url containing the definition of the classifier.
public void addClass(java.lang.String className,
java.util.Vector<java.awt.geom.Point2D> template)
className - The name of the class to addtemplate - The template for the class classNamepublic java.util.Vector<Score> sortedClasses(Gesture g)
sortedClasses in class AbstractClassifierg - The gesture
public int getNbPoints()
public double getSizeScaleToSquare()
public void save(java.io.File filename)
save in class AbstractClassifierfilename - The name of the file where to write the definition of the
classifier.public CPolyLine getRepresentative(java.lang.String className)
getRepresentative in class AbstractClassifierclassName - the name of the gesture class.
className.
public void removeExample(Gesture gesture)
throws java.lang.UnsupportedOperationException
removeExample in class AbstractClassifiergesture - the gesture to remove
java.lang.UnsupportedOperationException
public void addExample(java.lang.String className,
Gesture example)
throws java.lang.UnsupportedOperationException
addExample in class AbstractClassifierclassName - the gesture example's classexample - the gesture example
java.lang.UnsupportedOperationException
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.UnsupportedOperationExceptionpublic void setSizeScaleToSquare(int size)
size - The side size of the bounding box
public void setTemplate(java.lang.String className,
java.util.Vector<java.awt.geom.Point2D> template)
setTemplate in class AbstractClassifierclassName - the name of the class of gestures.template - the template for the class className.public double getThreshold()
public void setThreshold(double maximumDistance)
public int getMinimumStrokeLength()
public void setMinimumStrokeLength(int minimumStrokeLength)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||