using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using bbiwarg.Recognition.Tracking; using bbiwarg.Input.InputHandling; using bbiwarg.Utility; namespace bbiwarg.Recognition.HandRecognition { class HandTracker : Tracker { public HandTracker(ImageSize imageSize) : base(imageSize) { } public void trackHands(FrameData frameData) { trackObjects(frameData.DetectedHands); frameData.TrackedHands = getCurrentObjectsWithState(TrackingState.Tracked); } public override float calculateSimilarity(TrackedHand trackedHand, Hand detectedHand) { return getPositionSimilarity(trackedHand.CentroidPrediction, detectedHand.Centroid, Parameters.HandTrackerMaxCentroidRelativeMove); } protected override TrackedHand createTrackedObject(Hand detectedObject) { return new TrackedHand(idPool.getNextUnusedID(), detectedObject, Parameters.HandTrackerNumFramesDetectedUntilTracked, Parameters.HandTrackerNumFramesLostUntilDeleted); } } }