12345678910111213141516171819202122232425262728293031 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using bbiwarg.Recognition.Tracking;
- namespace bbiwarg.Recognition.PalmRecognition
- {
- class PalmTracker : Tracker<Palm, TrackedPalm>
- {
- public List<Palm> Palms { get { return getCurrentObjectsWithState(TrackingState.Tracked); } }
- public List<Palm> OptimizedPalms { get { return getOptimizedPalms(); } }
- protected override TrackedPalm createTrackedObject(Palm detectedPalm)
- {
- return new TrackedPalm(idPool.getNextUnusedID(), detectedPalm, Parameters.PalmTrackerNumFramesDetectedUntilTracked, Parameters.PalmTrackerNumFramesLostUntilDeleted);
- }
- private List<Palm> getOptimizedPalms()
- {
- List<Palm> optimizedPalms = new List<Palm>();
- foreach (TrackedPalm tp in TrackedObjects)
- {
- if (tp.CurrentState == TrackingState.Tracked)
- optimizedPalms.Add(tp.OptimizedPalm);
- }
- return optimizedPalms;
- }
- }
- }
|