HandInput.Engine.GestureRecognitionEngine.Update C# (CSharp) Method

Update() public method

Synchronized method. Updates gesture recognition with the current input.
public Update ( TrackingResult result, bool visualize = false ) : String
result TrackingResult
visualize bool
return String
        public String Update(TrackingResult result, bool visualize = false)
        {
            String gesture = "";
              if (result.RightHandRelPos.IsSome && result.DepthBoundingBoxes.Count > 0) {
            var pos = result.RightHandRelPos.Value;
            var image = result.DepthImage;
            var skin = result.ColorImage;
            image.ROI = result.DepthBoundingBoxes.Last();
            lock (this) {
              gesture = processor.Update((float)pos.X, (float)pos.Y, (float)pos.Z, image.Ptr,
                                      skin.Ptr, visualize);
              reset = false;
            }
            image.ROI = Rectangle.Empty;
              } else {
            // No hand detected (hand may be out of field of view).
            if (!reset) {
              reset = true;
              lock (this) {
            processor.Reset();
              }
            }
              }
              return gesture;
        }