@ -69,35 +69,57 @@ The following detector types are supported:
Creating Own Tracker
Creating Own Tracker
--------------------
--------------------
If you want create a new tracker, you should follow some simple rules.
If you want create a new tracker, here's what you have to do. First, decide on the name of the class for the tracker (to meet the existing style,
we suggest something with prefix "tracker", e.g. trackerMIL, trackerBoosting) -- we shall refer to this choice as to "classname" in subsequent. Also,
First, your tracker should be inherit from :ocv:class:`Tracker`, so you must implement two method:
you should decide upon the name of the tracker, is it will be known to user (the current style suggests using all capitals, say MIL or BOOSTING) --
we'll call it a "name".
* Tracker: initImpl, it should be called once in the first frame, here you should initialize all structures. The second argument is the initial bounding box of the target.
* Declare your tracker in ``include/opencv2/tracking/tracker.hpp``.
* Tracker:updateImpl, it should be called at the begin of in loop through video frames. Here you should overwrite the bounding box with new location.
Your tracker should inherit from :ocv:class:`Tracker` (please, see the example below). You should declare the specialized ``Param``
structure, where you probably will want to put the data, needed to initialize your tracker. Also don't forget to put the
Example of creating specialized Tracker ``TrackerMIL`` : ::
BOILERPLATE_CODE(name,classname) macro inside the class declaration. That macro will generate static ``createTracker()`` function, which
we'll talk about later. You should get something similar to ::