public void RecalculatePointNumber()
    {
        string    symbolName = dropDownList.options[dropDownList.value].text;
        MhGesture gest       = MhGestureManager.FindGesture(symbolName);

        var interpolatedPointArray = MhPointPatternMath.GetInterpolatedPointArray(gest.points, (int)recalculatePointNumber.value, gest);

        gest.points = new List <Vector2>(interpolatedPointArray);
        ClearSymbol();
        DrawSymbol();
    }
 public void DrawSymbol()
 {
     ClearSymbol();
     if (dropDownList.options.Count > 0)
     {
         string    symbolName = dropDownList.options[dropDownList.value].text;
         MhGesture gest       = MhGestureManager.FindGesture(symbolName);
         if (gest == null)
         {
             Debug.LogError("Symbol with name " + symbolName + " was not found");
             return;
         }
         gestureInput.DrawSymbol(gest);
     }
 }
Beispiel #3
0
    public KeyValuePair <MhGesture, float> CompareGesture()
    {
        MhGesture currentGesture = GetCurrentgesture();
        var       results        = MhGestureManager.analyzer.GetPointPatternMatchResults(currentGesture.Points);
        var       results2       = MhGestureManager.analyzer.GetPointPatternMatchResultsAdv(currentGesture.Points);

        if (results.Length == 0)
        {
            return(new KeyValuePair <MhGesture, float>());
        }

        var topResult = results[0];

        Debug.Log("Best Match: " + topResult.Name + " , Probability: " + topResult.Probability);
        Debug.Log("Advance Comparison Best Match: " + results2[0].Name + " , Probability: " + results2[0].Probability);

        return(new KeyValuePair <MhGesture, float>(MhGestureManager.FindGesture(topResult.Name), (float)topResult.Probability));
    }