Class ObjectTrackerBase<T>
- Namespace
- AiDotNet.ComputerVision.Tracking
- Assembly
- AiDotNet.dll
Base class for object trackers.
public abstract class ObjectTrackerBase<T>
Type Parameters
TThe numeric type used for calculations.
- Inheritance
-
ObjectTrackerBase<T>
- Derived
- Inherited Members
Constructors
ObjectTrackerBase(TrackingOptions<T>)
Creates a new object tracker.
protected ObjectTrackerBase(TrackingOptions<T> options)
Parameters
optionsTrackingOptions<T>
Fields
FrameCount
protected int FrameCount
Field Value
NextTrackId
protected int NextTrackId
Field Value
NumOps
protected readonly INumericOperations<T> NumOps
Field Value
- INumericOperations<T>
Options
protected readonly TrackingOptions<T> Options
Field Value
Tracks
protected readonly List<Track<T>> Tracks
Field Value
Properties
Name
Name of this tracker.
public abstract string Name { get; }
Property Value
Methods
ComputeCosineSimilarity(Tensor<T>, Tensor<T>)
Computes cosine similarity between two feature vectors.
protected double ComputeCosineSimilarity(Tensor<T> a, Tensor<T> b)
Parameters
aTensor<T>bTensor<T>
Returns
ComputeIoU(BoundingBox<T>, BoundingBox<T>)
Computes IoU between two bounding boxes.
protected double ComputeIoU(BoundingBox<T> a, BoundingBox<T> b)
Parameters
aBoundingBox<T>bBoundingBox<T>
Returns
CreateTrack(Detection<T>)
Creates a new track from detection.
protected Track<T> CreateTrack(Detection<T> detection)
Parameters
detectionDetection<T>
Returns
- Track<T>
GetConfirmedTracks()
Gets confirmed tracks only.
public List<Track<T>> GetConfirmedTracks()
Returns
HungarianAssignment(double[,])
Solves linear assignment problem (Hungarian algorithm).
protected int[] HungarianAssignment(double[,] costMatrix)
Parameters
costMatrixdouble[,]
Returns
- int[]
PredictNextPosition(Track<T>)
Predicts track position for next frame using velocity.
protected BoundingBox<T> PredictNextPosition(Track<T> track)
Parameters
trackTrack<T>
Returns
- BoundingBox<T>
Reset()
Resets the tracker state.
public virtual void Reset()
Update(List<Detection<T>>)
Updates tracks with new detections.
public abstract TrackingResult<T> Update(List<Detection<T>> detections)
Parameters
Returns
- TrackingResult<T>
Tracking result with updated tracks.
Update(List<Detection<T>>, Tensor<T>)
Updates tracks with new detections and image for appearance features.
public virtual TrackingResult<T> Update(List<Detection<T>> detections, Tensor<T> image)
Parameters
detectionsList<Detection<T>>Detections from the current frame.
imageTensor<T>Current frame image.
Returns
- TrackingResult<T>
Tracking result with updated tracks.
UpdateTrack(Track<T>, Detection<T>)
Updates a track with a matched detection.
protected void UpdateTrack(Track<T> track, Detection<T> detection)