You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: modules/tracking/doc/common_interfaces_tracker_sampler.rst
+55-1Lines changed: 55 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -87,6 +87,8 @@ The modes available now:
87
87
88
88
* ``"CS"`` -- Current State
89
89
90
+
* ``"PF"`` -- Particle Filtering
91
+
90
92
Example ``TrackerSamplerAlgorithm::addTrackerSamplerAlgorithm`` : ::
91
93
92
94
//sample usage:
@@ -164,7 +166,7 @@ Get the name of the specific TrackerSamplerAlgorithm
164
166
Specialized TrackerSamplerAlgorithm
165
167
===================================
166
168
167
-
In [AAM]_ table I are described the most known sampling strategies. At moment :ocv:class:`TrackerSamplerCSC` and :ocv:class:`TrackerSamplerCS` are implemented.
169
+
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.
168
170
169
171
TrackerSamplerCSC : TrackerSamplerAlgorithm
170
172
-------------------------------------------
@@ -291,3 +293,55 @@ The modes are:
291
293
* ``"MODE_POSITIVE = 1"`` -- for the positive sampling
292
294
* ``"MODE_NEGATIVE = 2"`` -- for the negative sampling
293
295
* ``"MODE_CLASSIFY = 3"`` -- for the sampling in classification step
296
+
297
+
TrackerSamplerPF : TrackerSamplerAlgorithm
298
+
-------------------------------------------
299
+
300
+
This sampler is based on particle filtering. In principle, it can be thought of as performing some sort of optimization (and indeed, this
301
+
tracker uses opencv's ``optim`` module), where tracker seeks to find the rectangle in given frame, which is the most *"similar"* to the initial
302
+
rectangle (the one, given through the constructor).
303
+
304
+
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``.
305
+
306
+
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.
307
+
308
+
.. ocv:class:: TrackerSamplerPF
309
+
310
+
TrackerSamplerPF class::
311
+
312
+
class CV_EXPORTS_W TrackerSamplerPF : public TrackerSamplerAlgorithm{
0 commit comments