Example ``TrackerSamplerAlgorithm::addTrackerSamplerAlgorithm`` : ::
//sample usage:
...
...
@@ -164,7 +166,7 @@ Get the name of the specific TrackerSamplerAlgorithm
Specialized TrackerSamplerAlgorithm
===================================
In [AAM]_ table I are described the most known sampling strategies. At moment :ocv:class:`TrackerSamplerCSC` and :ocv:class:`TrackerSamplerCS` are implemented.
In [AAM]_ table I there are described the most known sampling strategies. At moment :ocv:class:`TrackerSamplerCSC` and :ocv:class:`TrackerSamplerCS` are implemented. Beside these, there is :ocv:class:`TrackerSamplerPF`, sampler based on particle filtering.
TrackerSamplerCSC : TrackerSamplerAlgorithm
-------------------------------------------
...
...
@@ -291,3 +293,55 @@ The modes are:
* ``"MODE_POSITIVE = 1"`` -- for the positive sampling
* ``"MODE_NEGATIVE = 2"`` -- for the negative sampling
* ``"MODE_CLASSIFY = 3"`` -- for the sampling in classification step
TrackerSamplerPF : TrackerSamplerAlgorithm
-------------------------------------------
This sampler is based on particle filtering. In principle, it can be thought of as performing some sort of optimization (and indeed, this
tracker uses opencv's ``optim`` module), where tracker seeks to find the rectangle in given frame, which is the most *"similar"* to the initial
rectangle (the one, given through the constructor).
The optimization performed is stochastic and somehow resembles genetic algorithms, where on each new ``image`` received (submitted via ``TrackerSamplerPF::sampling()``) we start with the region bounded by ``boundingBox``, then generate several "perturbed" boxes, take the ones most similar to the original. This selection round is repeated several times. At the end, we hope that only the most promising box remaining, and these are combined to produce the subrectangle of ``image``, which is put as a sole element in array ``sample``.
It should be noted, that the definition of "similarity" between two rectangles is based on comparing their histograms. As experiments show, tracker is *not* very succesfull if target is assumed to strongly change its dimensions.
.. ocv:class:: TrackerSamplerPF
TrackerSamplerPF class::
class CV_EXPORTS_W TrackerSamplerPF : public TrackerSamplerAlgorithm{