Skip to content

legacy_Tracker

trackingclassOpenCV 5.0.0
import { legacy_Tracker } from '@banou/opencv-wasm'

Use after await initOpenCV(). See the initialization and named imports guide.

ARGUMENTSConstructor or factory
CLASSlegacy_Tracker
RETURN TYPEOwned native handle
Call structure. A void return can still write to destination arguments. The parameter descriptions define inputs, outputs and ownership.

Native object: release it with using or delete(). Factories can return null; check before calling methods. Inherits Algorithm.

Tracker Base Class *********************************** Base abstract class for the long-term tracker:

Constructors and members

clone

Create another handle to the same native object. This retains the object without copying its pixels or algorithm state; dispose both handles separately.

clone(): this;
Returns

The this result.

init

Initialize the tracker with a known bounding box that surrounded the target

init(image: Mat, boundingBox: Rect2d): boolean;
image

The initial frame

boundingBox

The initial bounding box

Returns

True if initialization went succesfully, false otherwise

update

Update the tracker, find the new most likely bounding box for the target

update(image: Mat): legacy_Tracker_updateResult;
image

The current frame

Returns

True means that target was located and false means that tracker cannot locate target in current frame. Note, that latter does not imply that tracker has failed, maybe target is indeed missing from the frame (say, out of sight) Scalar output parameters are returned as named fields in this object. Release returned native handles with using or delete(), including handles nested in results.

These signatures describe this package. Upstream documentation can mention optional backends that are absent from this build. Check runtime compatibility before choosing a backend or file format.