de.lmu.ifi.mfchords.utils
Class MFCRecognizer

java.lang.Object
  extended by Service
      extended by de.lmu.ifi.mfchords.utils.MFCRecognizer

public class MFCRecognizer
extends Service

The MFCRecognizer is the link between the classifier and the hand model


Constructor Summary
MFCRecognizer()
           
 
Method Summary
 void addMFCRecognizer(MFCListener toAdd)
          register your view to receive MFC events
 void createClassifier()
          create classifier when the calibration process is done.
 void feedClassifier(RelativeMeasurement rm, java.lang.String name)
          feed the RelativeMeasurements to the Classifier if you want to calibrate.
 java.lang.String getClassifiedMFC(RelativeMeasurement rm)
          classifies the RelativeMeasurement using a KNN (N=3)
 HandModel getHandModel()
           
static MFCRecognizer getRecognizer()
          Singleton: access to the recognizer
 boolean isClassifierBuilt()
           
 IBinder onBind(Intent intent)
           
 void onCreate()
           
 int onStartCommand(Intent intent, int flags, int startId)
           
 boolean onTouchEvent(MotionEvent event)
           
 RelativeMeasurement processPoints(java.util.ArrayList<PointF> pointers, boolean isTwoStepPosture)
          processPoints turns an array of touch points (PointF) into a RelativeMeasurement to feed the classifier or to get it classified by the classifier.
 void readInCalibration()
          builds classifier from calibration file (by default saved in external storage "defaultCalibration.txt").
 void wantFeedforward(boolean b)
          if set to 'true' it visualizes a feedforward of hovering fingers
 void writeCalibToFile()
          writes calibration to file
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MFCRecognizer

public MFCRecognizer()
Method Detail

getRecognizer

public static MFCRecognizer getRecognizer()
Singleton: access to the recognizer


addMFCRecognizer

public void addMFCRecognizer(MFCListener toAdd)
register your view to receive MFC events


wantFeedforward

public void wantFeedforward(boolean b)
if set to 'true' it visualizes a feedforward of hovering fingers

Parameters:
wantFeedForward - set this to yes if you want to visualize feedforward about the approximate finger positions of the hovering fingers

onCreate

public void onCreate()

processPoints

public RelativeMeasurement processPoints(java.util.ArrayList<PointF> pointers,
                                         boolean isTwoStepPosture)
processPoints turns an array of touch points (PointF) into a RelativeMeasurement to feed the classifier or to get it classified by the classifier.

Parameters:
pointers - ArrayList of PointF points from the touch events.
isTwoStepPosture - The information of the view if the timing between the two touches of the basis and the third identifying touch is beyond threshold to be interpreted as two-step posture
Returns:
RelativeMeasurement extracted relative measurements from the touch events.

onTouchEvent

public boolean onTouchEvent(MotionEvent event)

createClassifier

public void createClassifier()
create classifier when the calibration process is done.


feedClassifier

public void feedClassifier(RelativeMeasurement rm,
                           java.lang.String name)
feed the RelativeMeasurements to the Classifier if you want to calibrate.


getClassifiedMFC

public java.lang.String getClassifiedMFC(RelativeMeasurement rm)
classifies the RelativeMeasurement using a KNN (N=3)

Parameters:
rm - the relative measurement to classify
Returns:
a String with the name of the classified posture.

getHandModel

public HandModel getHandModel()

readInCalibration

public void readInCalibration()
builds classifier from calibration file (by default saved in external storage "defaultCalibration.txt").


onBind

public IBinder onBind(Intent intent)

onStartCommand

public int onStartCommand(Intent intent,
                          int flags,
                          int startId)

isClassifierBuilt

public boolean isClassifierBuilt()

writeCalibToFile

public void writeCalibToFile()
writes calibration to file