Class MultiTrackerAlt
- Namespace
- OpenCvSharp.Tracking.Legacy
- Assembly
- OpenCvSharp.dll
Base class for objects that own a single native OpenCV pointer through an OpenCvSafeHandle. The SafeHandle is the single source of truth for the native handle value and is responsible for releasing it (including from its own finalizer when the managed object is dropped without Dispose()).
public class MultiTrackerAlt : CvObject, IDisposable
- Inheritance
-
MultiTrackerAlt
- Implements
- Derived
- Inherited Members
Remarks
Unlike MultiTracker, cv::legacy::MultiTracker_Alt does not derive from
cv::Algorithm and has no create() factory - it is a plain, directly-constructed
C++ class with public fields, so this wrapper follows the direct-allocation
(CvObject-based) pattern instead of the CvPtrObject/cv::Ptr
factory pattern used elsewhere in this module.
Constructors
MultiTrackerAlt()
Constructor for Multitracker.
public MultiTrackerAlt()
Properties
BoundingBoxes
Bounding boxes list for Multi-Object-Tracker.
public Rect2d[] BoundingBoxes { get; }
Property Value
- Rect2d[]
TargetNum
Current number of targets in tracking-list.
public int TargetNum { get; }
Property Value
Methods
AddTarget(Mat, Rect2d, LegacyTracker)
Add a new target to a tracking-list and initialize the tracker with a known bounding box that surrounded the target.
public bool AddTarget(Mat image, Rect2d boundingBox, LegacyTracker trackerAlgorithm)
Parameters
imageMatThe initial frame
boundingBoxRect2dThe initial bounding box of target
trackerAlgorithmLegacyTrackerMulti-tracker algorithm
Returns
- bool
True if new target initialization went successfully, false otherwise
DisposeUnmanaged()
Releases unmanaged resources
protected override void DisposeUnmanaged()
Update(Mat)
Update all trackers from the tracking-list, find a new most likely bounding boxes for the targets.
public bool Update(Mat image)
Parameters
imageMatThe current frame
Returns
- bool
True means that all targets were located and false means that tracker couldn't locate one of the targets in the current frame. Note that the latter does not imply that tracker has failed - the target may indeed be missing from the frame (say, out of sight).