1234567891011121314151617181920212223242526272829303132333435 |
- 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<Hand, TrackedHand>
- {
- 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);
- }
- }
- }
|