public Result Recognize(Gesture gesture) { Result result = new Result(); float distance = float.MaxValue; for (int i = 0; i < Gestures.Count; i++) { Debug.Log(Gestures[i].Name); distance = GreedyCloudMatch(gesture.NormalizedPoints, Gestures[i].NormalizedPoints); if (distance < result.Score) { result.Set(Gestures[i].Name, distance); } } return(result); }
public Result Recognize(Gesture gesture) { Result result = new Result(); float distance = float.MaxValue; // Compare gesture against all others for (int i = 0; i < Gestures.Count; i++) { distance = GreedyCloudMatch(gesture.NormalizedPoints, Gestures[i].NormalizedPoints); if (distance < result.Score) { result.Set(Gestures[i].Name, distance); } } // Normalize score result.Score = Mathf.Max((2f - result.Score) / 2f, 0f); return(result); }