Table of Contents

Class ObjectTrackerBase<T>

Namespace
AiDotNet.ComputerVision.Tracking
Assembly
AiDotNet.dll

Base class for object trackers.

public abstract class ObjectTrackerBase<T>

Type Parameters

T

The 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

options TrackingOptions<T>

Fields

FrameCount

protected int FrameCount

Field Value

int

NextTrackId

protected int NextTrackId

Field Value

int

NumOps

protected readonly INumericOperations<T> NumOps

Field Value

INumericOperations<T>

Options

protected readonly TrackingOptions<T> Options

Field Value

TrackingOptions<T>

Tracks

protected readonly List<Track<T>> Tracks

Field Value

List<Track<T>>

Properties

Name

Name of this tracker.

public abstract string Name { get; }

Property Value

string

Methods

ComputeCosineSimilarity(Tensor<T>, Tensor<T>)

Computes cosine similarity between two feature vectors.

protected double ComputeCosineSimilarity(Tensor<T> a, Tensor<T> b)

Parameters

a Tensor<T>
b Tensor<T>

Returns

double

ComputeIoU(BoundingBox<T>, BoundingBox<T>)

Computes IoU between two bounding boxes.

protected double ComputeIoU(BoundingBox<T> a, BoundingBox<T> b)

Parameters

a BoundingBox<T>
b BoundingBox<T>

Returns

double

CreateTrack(Detection<T>)

Creates a new track from detection.

protected Track<T> CreateTrack(Detection<T> detection)

Parameters

detection Detection<T>

Returns

Track<T>

GetConfirmedTracks()

Gets confirmed tracks only.

public List<Track<T>> GetConfirmedTracks()

Returns

List<Track<T>>

HungarianAssignment(double[,])

Solves linear assignment problem (Hungarian algorithm).

protected int[] HungarianAssignment(double[,] costMatrix)

Parameters

costMatrix double[,]

Returns

int[]

PredictNextPosition(Track<T>)

Predicts track position for next frame using velocity.

protected BoundingBox<T> PredictNextPosition(Track<T> track)

Parameters

track Track<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

detections List<Detection<T>>

Detections from the current frame.

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

detections List<Detection<T>>

Detections from the current frame.

image Tensor<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)

Parameters

track Track<T>
detection Detection<T>