コード例 #1
0
        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);
        }
コード例 #2
0
        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);
        }
コード例 #3
0
    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);
    }