© 2006-2007 ETH Zurich

org.ximtec.igesture.algorithm.feature
Class FeatureTool

java.lang.Object
  extended by org.ximtec.igesture.algorithm.feature.FeatureTool

public class FeatureTool
extends Object

Some feature tools.

Version:
1.0 Dec 2006
Author:
Ueli Kurmann, igesture@uelikurmann.ch, Beat Signer, signer@inf.ethz.ch

Constructor Summary
FeatureTool()
           
 
Method Summary
static double computeD1(org.sigtec.ink.Note note)
           
static double computeD2(org.sigtec.ink.Note note)
           
static double computeD3(org.sigtec.ink.Note note)
           
static DoubleVector computeFeatureVector(org.sigtec.ink.Note note, int minDistance, Feature[] featureList)
          Computes the feature vector.
static int computeMinimalNumberOfRequiredPoints(Feature[] list)
          Returns the minimal number of points a note must contain to be processed.
static Feature createFeature(String classname)
          Instantiates a feature of the given full qualified classname.
static List<Feature> createFeatureList(String featureList)
          Creates a list of instantiated features out of a comma delimited list of full qualified feature classnames.
static org.sigtec.ink.Trace createTrace(org.sigtec.ink.Note note)
          Takes a note and returns a single trace containing all points.
static double getAngle(org.sigtec.ink.Point p1, org.sigtec.ink.Point p2)
          Computes the angle of the line p1-p2 in the unit circle.
static double getDeltaT(int i, org.sigtec.ink.Point[] points)
          Returns the difference of the timestamps in point i and i + 1.
static double getDeltaT(org.sigtec.ink.Point p1, org.sigtec.ink.Point p2)
          Returns the difference of the timestamps in point p1 and p2.
static double getDeltaX(int i, org.sigtec.ink.Point[] points)
          Returns the distance in respect to the X axis between point i and i+1.
static double getDeltaY(int i, org.sigtec.ink.Point[] points)
          Returns the distance in respect to the Y axis between point i and i+1.
static List<org.sigtec.ink.Trace> removeShortTraces(List<org.sigtec.ink.Trace> traces, int minNumOfPoints)
          Removes traces from the list with less than minNumOfPoints.
static double roh(int i, org.sigtec.ink.Point[] points)
          Computes the angle in respect to the x axis in point i and i-1.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FeatureTool

public FeatureTool()
Method Detail

createTrace

public static org.sigtec.ink.Trace createTrace(org.sigtec.ink.Note note)
Takes a note and returns a single trace containing all points.

Parameters:
note - the note whose points have to be extracted.
Returns:
the trace containing all points of the note.

getDeltaX

public static double getDeltaX(int i,
                               org.sigtec.ink.Point[] points)
Returns the distance in respect to the X axis between point i and i+1.

Parameters:
i - the ith point.
points - the array of points.
Returns:
the distance in respect to the X axis between point i and i+1.

getDeltaY

public static double getDeltaY(int i,
                               org.sigtec.ink.Point[] points)
Returns the distance in respect to the Y axis between point i and i+1.

Parameters:
i - the ith point.
points - the array of points.
Returns:
the distance in respect to the Y axis between point i and i+1.

getDeltaT

public static double getDeltaT(int i,
                               org.sigtec.ink.Point[] points)
Returns the difference of the timestamps in point i and i + 1.

Parameters:
i - the ith point.
points - the array of points.
Returns:
the time between two points.

getDeltaT

public static double getDeltaT(org.sigtec.ink.Point p1,
                               org.sigtec.ink.Point p2)
Returns the difference of the timestamps in point p1 and p2.

Parameters:
p1 - the point p1.
p2 - the point p2.
Returns:
the time passes between the two given points.

roh

public static double roh(int i,
                         org.sigtec.ink.Point[] points)
Computes the angle in respect to the x axis in point i and i-1.

Parameters:
i - the index of the point to be used in the computation.
points - the set of points.
Returns:
the angle relative to the x axis for point i and i-1.

getAngle

public static double getAngle(org.sigtec.ink.Point p1,
                              org.sigtec.ink.Point p2)
Computes the angle of the line p1-p2 in the unit circle.

Parameters:
p1 - start point of the line.
p2 - end point of the line.
Returns:
the angle.

removeShortTraces

public static List<org.sigtec.ink.Trace> removeShortTraces(List<org.sigtec.ink.Trace> traces,
                                                           int minNumOfPoints)
Removes traces from the list with less than minNumOfPoints.

Parameters:
traces - the list of traces.
minNumOfPoints - the minimal number of points a trace must contain.
Returns:
the filtered list of traces.

createFeatureList

public static List<Feature> createFeatureList(String featureList)
Creates a list of instantiated features out of a comma delimited list of full qualified feature classnames.

Parameters:
featureList - a comma delimited list of full qualified class names.
Returns:
list of feature instances.

createFeature

public static Feature createFeature(String classname)
Instantiates a feature of the given full qualified classname.

Parameters:
classname - the full qualified class name.
Returns:
the instance of the feature.

computeFeatureVector

public static DoubleVector computeFeatureVector(org.sigtec.ink.Note note,
                                                int minDistance,
                                                Feature[] featureList)
                                         throws FeatureException
Computes the feature vector.

Parameters:
note - the note the feature vector has to be computed of.
minDistance - the minimal distance between two points.
featureList - an array of features.
Returns:
the feature vector.
Throws:
FeatureException - if the feature vector cannot be computed.

computeMinimalNumberOfRequiredPoints

public static int computeMinimalNumberOfRequiredPoints(Feature[] list)
Returns the minimal number of points a note must contain to be processed.

Parameters:
list - the list of features.
Returns:
the minimal number of points a note must contain.

computeD1

public static double computeD1(org.sigtec.ink.Note note)

computeD2

public static double computeD2(org.sigtec.ink.Note note)

computeD3

public static double computeD3(org.sigtec.ink.Note note)

© 2006-2007 ETH Zurich

Copyright © 2007-2010 Global Information Systems Group, ETH Zurich. All Rights Reserved.