OpenCV
4.10.0pre
Open Source Computer Vision

This sampler is based on particle filtering. More...
#include <opencv2/tracking/tracking_internals.hpp>
Classes  
struct  Params 
This structure contains all the parameters that can be varied during the course of sampling algorithm. Below is the structure exposed, together with its members briefly explained with reference to the above discussion on algorithm's working. More...  
Public Member Functions  
TrackerSamplerPF (const Mat &chosenRect, const TrackerSamplerPF::Params ¶meters=TrackerSamplerPF::Params())  
Constructor.  
Public Member Functions inherited from cv::detail::tracking::TrackerContribSamplerAlgorithm  
virtual  ~TrackerContribSamplerAlgorithm () 
Destructor.  
String  getClassName () const 
Get the name of the specific TrackerContribSamplerAlgorithm.  
virtual bool  sampling (const Mat &image, const Rect &boundingBox, std::vector< Mat > &sample) CV_OVERRIDE 
Computes the regions starting from a position in an image.  
Public Member Functions inherited from cv::detail::tracking::TrackerSamplerAlgorithm  
virtual  ~TrackerSamplerAlgorithm () 
Protected Member Functions  
bool  samplingImpl (const Mat &image, Rect boundingBox, std::vector< Mat > &sample) CV_OVERRIDE 
Additional Inherited Members  
Static Public Member Functions inherited from cv::detail::tracking::TrackerContribSamplerAlgorithm  
static Ptr< TrackerContribSamplerAlgorithm >  create (const String &trackerSamplerType) 
Create TrackerContribSamplerAlgorithm by tracker sampler type.  
Protected Attributes inherited from cv::detail::tracking::TrackerContribSamplerAlgorithm  
String  className 
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.
cv::detail::tracking::TrackerSamplerPF::TrackerSamplerPF  (  const Mat &  chosenRect, 
const TrackerSamplerPF::Params &  parameters = TrackerSamplerPF::Params() 

) 
Constructor.
chosenRect  Initial rectangle, that is supposed to contain target we'd like to track. 
parameters 