Detail_TrackerSamplerPF

Struct Detail_TrackerSamplerPF 

Source
pub struct Detail_TrackerSamplerPF { /* private fields */ }
Expand 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.

Implementations§

Source§

impl Detail_TrackerSamplerPF

Source

pub fn new( chosen_rect: &impl MatTraitConst, parameters: &impl Detail_TrackerSamplerPF_ParamsTraitConst, ) -> Result<Detail_TrackerSamplerPF>

Constructor

§Parameters
  • chosenRect: Initial rectangle, that is supposed to contain target we’d like to track.
  • parameters:
§C++ default parameters
  • parameters: TrackerSamplerPF::Params()
Source

pub fn new_def( chosen_rect: &impl MatTraitConst, ) -> Result<Detail_TrackerSamplerPF>

Constructor

§Parameters
  • chosenRect: Initial rectangle, that is supposed to contain target we’d like to track.
  • parameters:
§Note

This alternative version of [new] function uses the following default values for its arguments:

  • parameters: TrackerSamplerPF::Params()

Trait Implementations§

Source§

impl Boxed for Detail_TrackerSamplerPF

Source§

unsafe fn from_raw( ptr: <Detail_TrackerSamplerPF as OpenCVFromExtern>::ExternReceive, ) -> Self

Wrap the specified raw pointer Read more
Source§

fn into_raw( self, ) -> <Detail_TrackerSamplerPF as OpenCVTypeExternContainer>::ExternSendMut

Return the underlying raw pointer while consuming this wrapper. Read more
Source§

fn as_raw( &self, ) -> <Detail_TrackerSamplerPF as OpenCVTypeExternContainer>::ExternSend

Return the underlying raw pointer. Read more
Source§

fn as_raw_mut( &mut self, ) -> <Detail_TrackerSamplerPF as OpenCVTypeExternContainer>::ExternSendMut

Return the underlying mutable raw pointer Read more
Source§

impl Debug for Detail_TrackerSamplerPF

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Detail_TrackerContribSamplerAlgorithmTrait for Detail_TrackerSamplerPF

Source§

fn as_raw_mut_Detail_TrackerContribSamplerAlgorithm(&mut self) -> *mut c_void

Source§

fn sampling( &mut self, image: &impl MatTraitConst, bounding_box: Rect, sample: &mut Vector<Mat>, ) -> Result<bool>

Computes the regions starting from a position in an image. Read more
Source§

impl Detail_TrackerContribSamplerAlgorithmTraitConst for Detail_TrackerSamplerPF

Source§

fn as_raw_Detail_TrackerContribSamplerAlgorithm(&self) -> *const c_void

Source§

fn get_class_name(&self) -> Result<String>

Get the name of the specific TrackerContribSamplerAlgorithm
Source§

impl Detail_TrackerSamplerAlgorithmTrait for Detail_TrackerSamplerPF

Source§

fn as_raw_mut_Detail_TrackerSamplerAlgorithm(&mut self) -> *mut c_void

Source§

fn sampling( &mut self, image: &impl MatTraitConst, bounding_box: Rect, sample: &mut Vector<Mat>, ) -> Result<bool>

Computes the regions starting from a position in an image. Read more
Source§

impl Detail_TrackerSamplerAlgorithmTraitConst for Detail_TrackerSamplerPF

Source§

impl Detail_TrackerSamplerPFTrait for Detail_TrackerSamplerPF

Source§

impl Detail_TrackerSamplerPFTraitConst for Detail_TrackerSamplerPF

Source§

impl Drop for Detail_TrackerSamplerPF

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

impl From<Detail_TrackerSamplerPF> for Detail_TrackerContribSamplerAlgorithm

Source§

fn from(s: Detail_TrackerSamplerPF) -> Self

Converts to this type from the input type.
Source§

impl From<Detail_TrackerSamplerPF> for Detail_TrackerSamplerAlgorithm

Source§

fn from(s: Detail_TrackerSamplerPF) -> Self

Converts to this type from the input type.
Source§

impl TryFrom<Detail_TrackerContribSamplerAlgorithm> for Detail_TrackerSamplerPF

Source§

type Error = Error

The type returned in the event of a conversion error.
Source§

fn try_from(s: Detail_TrackerContribSamplerAlgorithm) -> Result<Self>

Performs the conversion.
Source§

impl Send for Detail_TrackerSamplerPF

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<Mat> ModifyInplace for Mat
where Mat: Boxed,

Source§

unsafe fn modify_inplace<Res>( &mut self, f: impl FnOnce(&Mat, &mut Mat) -> Res, ) -> Res

Helper function to call OpenCV functions that allow in-place modification of a Mat or another similar object. By passing a mutable reference to the Mat to this function your closure will get called with the read reference and a write references to the same Mat. This is unsafe in a general case as it leads to having non-exclusive mutable access to the internal data, but it can be useful for some performance sensitive operations. One example of an OpenCV function that allows such in-place modification is imgproc::threshold. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.