MultiTracker

Objective-C

@interface MultiTracker : Algorithm

Swift

class MultiTracker : Algorithm

This class is used to track multiple objects using the specified tracker algorithm.

The %MultiTracker is naive implementation of multiple object tracking. It process the tracked objects independently without any optimization accross the tracked objects.

Member of Tracking

Methods

  • Constructor.

    Declaration

    Objective-C

    - (nonnull instancetype)init;

    Swift

    init()
  • Returns a pointer to a new instance of MultiTracker

    Declaration

    Objective-C

    + (nonnull MultiTracker *)create;

    Swift

    class func create() -> MultiTracker
  • Add a new object to be tracked.

    Declaration

    Objective-C

    - (BOOL)add:(nonnull Tracker *)newTracker
              image:(nonnull Mat *)image
        boundingBox:(nonnull Rect2d *)boundingBox;

    Swift

    func add(newTracker: Tracker, image: Mat, boundingBox: Rect2d) -> Bool

    Parameters

    newTracker

    tracking algorithm to be used

    image

    input image

    boundingBox

    a rectangle represents ROI of the tracked object

  • Update the current tracking status.

    Declaration

    Objective-C

    - (BOOL)update:(nonnull Mat *)image
        boundingBox:(nonnull NSMutableArray<Rect2d *> *)boundingBox;

    Swift

    func update(image: Mat, boundingBox: NSMutableArray) -> Bool

    Parameters

    image

    input image

    boundingBox

    the tracking result, represent a list of ROIs of the tracked objects.

  • Returns a reference to a storage for the tracked objects, each object corresponds to one tracker algorithm

    Declaration

    Objective-C

    - (nonnull NSArray<Rect2d *> *)getObjects;

    Swift

    func getObjects() -> [Rect2d]