Class cv::detail::tracking::TrackerSamplerPF#

This sampler is based on particle filtering. View details

Collaboration diagram for cv::detail::tracking::TrackerSamplerPF:

Public Member Functions#

Public Member Functions inherited from cv::detail::tracking::TrackerContribSamplerAlgorithm

Return

Name

Description

~TrackerContribSamplerAlgorithm()

Destructor.

String

getClassName()

Get the name of the specific TrackerContribSamplerAlgorithm.

bool

sampling(
    const Mat & image,
    const Rect & boundingBox,
    std::vector< Mat > & sample )

Computes the regions starting from a position in an image.

Public Member Functions inherited from cv::detail::tracking::TrackerSamplerAlgorithm

Return

Name

Description

~TrackerSamplerAlgorithm()

bool

sampling(
    const Mat & image,
    const Rect & boundingBox,
    std::vector< Mat > & sample )

Computes the regions starting from a position in an image.

Static Public Member Functions#

Static Public Member Functions inherited from cv::detail::tracking::TrackerContribSamplerAlgorithm

Return

Name

Description

static Ptr< TrackerContribSamplerAlgorithm >

create(const String & trackerSamplerType)

Create TrackerContribSamplerAlgorithm by tracker sampler type.

Additional Inherited Members#

Protected Member Functions inherited from cv::detail::tracking::TrackerContribSamplerAlgorithm
Protected Attributes inherited from cv::detail::tracking::TrackerContribSamplerAlgorithm

Return

Name

Description

String

className

Detailed Description#

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.

Constructor & Destructor Documentation#

TrackerSamplerPF()#

cv::detail::tracking::TrackerSamplerPF::TrackerSamplerPF(
const Mat & chosenRect,
const TrackerSamplerPF::Params & parameters = TrackerSamplerPF::Params() )

Constructor.

Parameters

  • chosenRect — Initial rectangle, that is supposed to contain target we’d like to track.

  • parameters

Member Function Documentation#

samplingImpl()#

bool cv::detail::tracking::TrackerSamplerPF::samplingImpl(
const Mat & image,
Rect boundingBox,
std::vector< Mat > & sample )

Member Data Documentation#

_function#

Ptr< MinProblemSolver::Function > cv::detail::tracking::TrackerSamplerPF::_function

_solver#

Ptr< MinProblemSolver > cv::detail::tracking::TrackerSamplerPF::_solver

params#

Params cv::detail::tracking::TrackerSamplerPF::params

Source file#

The documentation for this class was generated from the following file: