12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152 |
- using BBIWARG.Input.InputHandling;
- using BBIWARG.Recognition.Tracking;
- using BBIWARG.Utility;
- namespace BBIWARG.Recognition.HandRecognition
- {
-
-
-
- internal class HandTracker : Tracker<Hand, TrackedHand>
- {
-
-
-
-
- public HandTracker(ImageSize imageSize)
- : base(imageSize)
- {
- }
-
-
-
-
-
-
- public override float calculateSimilarity(TrackedHand trackedHand, Hand detectedHand)
- {
- return getPositionSimilarity(trackedHand.CentroidPrediction, detectedHand.Centroid, Parameters.HandTrackerMaxCentroidRelativeMove);
- }
-
-
-
-
- public void trackHands(FrameData frameData)
- {
- trackObjects(frameData.DetectedHands);
- frameData.TrackedHands = getCurrentObjectsWithState(TrackingState.Tracked);
- }
-
-
-
-
-
- protected override TrackedHand createTrackedObject(Hand detectedObject)
- {
- return new TrackedHand(idPool.getNextUnusedID(), detectedObject, Parameters.HandTrackerNumFramesDetectedUntilTracked, Parameters.HandTrackerNumFramesLostUntilDeleted);
- }
- }
- }
|