public static string Classify(bool useRubine, float duration, bool righthandedness, List<float> SpeakerAngles, PointCollection pointHist, StylusPointCollection S, List<List<int>> hist, List<List<int>> ihist)
{
// Convert all parameters to format used in GestureTests
List<Vector2> InterpretedPoints = new List<Vector2>();
List<Vector2> StylusPoints = new List<Vector2>();
List<Vector2> VelocityHistory = new List<Vector2>();
List<Vector2> InverseVelocityHistory = new List<Vector2>();
foreach(Point P in pointHist)
InterpretedPoints.Add(new Vector2((float)P.X,(float)P.Y));
foreach(StylusPoint P in S)
StylusPoints.Add(new Vector2((float)P.X,(float)P.Y));
for (int i = 0; i < hist[0].Count; i++)
{
VelocityHistory.Add(new Vector2(hist[0][i], hist[1][i]));
InverseVelocityHistory.Add(new Vector2(ihist[0][i], ihist[1][i]));
}
// Create a new Sample, compute the features, and classify
GS = new GestureSample(GestureTests.Types.GestureType.unknown, righthandedness,duration,SpeakerAngles,InterpretedPoints,StylusPoints,VelocityHistory,InverseVelocityHistory);
GS.ComputeFeatures(GestureFeatures.PointsStroke);
if (useRubine)
return EC.Recognizer.Classify(GS).ToString();
WriteARFF();
Instances test = new Instances(new java.io.FileReader("outfile.arff"));
test.setClassIndex(0);
double clsLabel = cls.classifyInstance(test.instance(0));
test.instance(0).setClassValue(clsLabel);
// Return the appropriate label
return ((GestureType2D)((int)clsLabel+1)).ToString();
}