1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using bbiwarg.Recognition.Tracking;
- using bbiwarg.Utility;
- namespace bbiwarg.Recognition.FingerRecognition
- {
- class FingerTracker : Tracker<Finger>
- {
- public List<Finger> Fingers { get { return TrackedObjects; } }
- public FingerTracker()
- : base(Constants.FingerNumFramesDetectedUntilTracked, Constants.FingerNumFramesLostUntilDeleted, Constants.FingerMinSimilarityForTracking)
- {
- }
- protected override void onDetect(object sender, EventArgs e)
- {
- TrackableObjectHistory<Finger> history = (TrackableObjectHistory<Finger>)sender;
- if (history.NumFramesInCurrentState == 1)
- Logger.log("Finger #" + history.ID.ToString() + " detected", LogSubject.FingerTracker);
- }
- protected override void onTrack(object sender, EventArgs e)
- {
- TrackableObjectHistory<Finger> history = (TrackableObjectHistory<Finger>)sender;
- if (history.NumFramesInCurrentState == 1)
- Logger.log("Finger #" + history.ID.ToString() + " tracked", LogSubject.FingerTracker);
- }
- protected override void onRetrack(object sender, EventArgs e)
- {
- TrackableObjectHistory<Finger> history = (TrackableObjectHistory<Finger>)sender;
- if (history.NumFramesInCurrentState == 1)
- Logger.log("Finger #" + history.ID.ToString() + " retracked", LogSubject.FingerTracker);
- }
- protected override void onLoose(object sender, EventArgs e)
- {
- TrackableObjectHistory<Finger> history = (TrackableObjectHistory<Finger>)sender;
- if (history.NumFramesInCurrentState == 1)
- Logger.log("Finger #" + history.ID.ToString() + " lost", LogSubject.FingerTracker);
- }
- protected override void onDelete(object sender, EventArgs e)
- {
- TrackableObjectHistory<Finger> history = (TrackableObjectHistory<Finger>)sender;
- if (history.NumFramesInCurrentState == 1)
- Logger.log("Finger #" + history.ID.ToString() + " deleted", LogSubject.FingerTracker);
- }
- }
- }
|