private void RecognizeGesture() { Gesture candidate = new Gesture(points.ToArray()); string gestureClass = ""; string recognizer = ""; switch (cbRecognizer.SelectedIndex) { case 0: recognizer = "$P"; gestureClass = PointCloudRecognizer.Classify(candidate, trainingSet); break; case 1: recognizer = "$P+"; gestureClass = PointCloudRecognizerPlus.Classify(candidate, trainingSet); break; case 2: recognizer = "$Q"; QPointCloudRecognizer.UseEarlyAbandoning = chkUseEarlyAbandoning.Checked; QPointCloudRecognizer.UseLowerBounding = chkUseLowerBounding.Checked; gestureClass = QPointCloudRecognizer.Classify(candidate, trainingSet); break; } MessageBox.Show("Recognized as: " + gestureClass, recognizer); }
private void RecognizeGesture() { Gesture candidate = new Gesture(points.ToArray()); string gestureClass = ""; switch (cbRecognizer.SelectedIndex) { case 0: gestureClass = PointCloudRecognizer.Classify(candidate, trainingSet); break; case 1: gestureClass = PointCloudRecognizerPlus.Classify(candidate, trainingSet); break; } MessageBox.Show("Recognized as: " + gestureClass); }
private static PassStuff ClassifyScore(Gesture candidate, float maxDistance) { PassStuff ps = null; switch (currentClassifier) { case ClassifierClass.PointCloud: if (showDebugMsg) { Debug.Log("Point cloud"); } ps = PointCloudRecognizer.ClassifyScore(candidate, gestureSet); break; case ClassifierClass.PointCloudPlus: if (showDebugMsg) { Debug.Log("Point cloud PLUS"); } ps = PointCloudRecognizerPlus.ClassifyScore(candidate, gestureSet); break; case ClassifierClass.QPointCloud: if (showDebugMsg) { Debug.Log("Quick cloud"); } ps = QPointCloudRecognizer.ClassifyScore(candidate, gestureSet); break; default: throw new System.Exception("No such class!"); } if (ps.score > maxDistance) { return(null); } return(ps); }