12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455 |
- 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);
- }
- }
- }
|