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
impl Detail_TrackerSamplerPF
Sourcepub fn new(
chosen_rect: &impl MatTraitConst,
parameters: &impl Detail_TrackerSamplerPF_ParamsTraitConst,
) -> Result<Detail_TrackerSamplerPF>
pub fn new( chosen_rect: &impl MatTraitConst, parameters: &impl Detail_TrackerSamplerPF_ParamsTraitConst, ) -> Result<Detail_TrackerSamplerPF>
Sourcepub fn new_def(
chosen_rect: &impl MatTraitConst,
) -> Result<Detail_TrackerSamplerPF>
pub fn new_def( chosen_rect: &impl MatTraitConst, ) -> Result<Detail_TrackerSamplerPF>
Trait Implementations§
Source§impl Boxed for Detail_TrackerSamplerPF
impl Boxed for Detail_TrackerSamplerPF
Source§unsafe fn from_raw(
ptr: <Detail_TrackerSamplerPF as OpenCVFromExtern>::ExternReceive,
) -> Self
unsafe fn from_raw( ptr: <Detail_TrackerSamplerPF as OpenCVFromExtern>::ExternReceive, ) -> Self
Source§fn into_raw(
self,
) -> <Detail_TrackerSamplerPF as OpenCVTypeExternContainer>::ExternSendMut
fn into_raw( self, ) -> <Detail_TrackerSamplerPF as OpenCVTypeExternContainer>::ExternSendMut
Source§fn as_raw(
&self,
) -> <Detail_TrackerSamplerPF as OpenCVTypeExternContainer>::ExternSend
fn as_raw( &self, ) -> <Detail_TrackerSamplerPF as OpenCVTypeExternContainer>::ExternSend
Source§fn as_raw_mut(
&mut self,
) -> <Detail_TrackerSamplerPF as OpenCVTypeExternContainer>::ExternSendMut
fn as_raw_mut( &mut self, ) -> <Detail_TrackerSamplerPF as OpenCVTypeExternContainer>::ExternSendMut
Source§impl Debug for Detail_TrackerSamplerPF
impl Debug for Detail_TrackerSamplerPF
Source§impl Detail_TrackerContribSamplerAlgorithmTraitConst for Detail_TrackerSamplerPF
impl Detail_TrackerContribSamplerAlgorithmTraitConst for Detail_TrackerSamplerPF
fn as_raw_Detail_TrackerContribSamplerAlgorithm(&self) -> *const c_void
Source§fn get_class_name(&self) -> Result<String>
fn get_class_name(&self) -> Result<String>
Source§impl Detail_TrackerSamplerAlgorithmTraitConst for Detail_TrackerSamplerPF
impl Detail_TrackerSamplerAlgorithmTraitConst for Detail_TrackerSamplerPF
fn as_raw_Detail_TrackerSamplerAlgorithm(&self) -> *const c_void
Source§impl Detail_TrackerSamplerPFTrait for Detail_TrackerSamplerPF
impl Detail_TrackerSamplerPFTrait for Detail_TrackerSamplerPF
fn as_raw_mut_Detail_TrackerSamplerPF(&mut self) -> *mut c_void
Source§impl Detail_TrackerSamplerPFTraitConst for Detail_TrackerSamplerPF
impl Detail_TrackerSamplerPFTraitConst for Detail_TrackerSamplerPF
fn as_raw_Detail_TrackerSamplerPF(&self) -> *const c_void
Source§impl Drop for Detail_TrackerSamplerPF
impl Drop for Detail_TrackerSamplerPF
Source§impl From<Detail_TrackerSamplerPF> for Detail_TrackerContribSamplerAlgorithm
impl From<Detail_TrackerSamplerPF> for Detail_TrackerContribSamplerAlgorithm
Source§fn from(s: Detail_TrackerSamplerPF) -> Self
fn from(s: Detail_TrackerSamplerPF) -> Self
Source§impl From<Detail_TrackerSamplerPF> for Detail_TrackerSamplerAlgorithm
impl From<Detail_TrackerSamplerPF> for Detail_TrackerSamplerAlgorithm
Source§fn from(s: Detail_TrackerSamplerPF) -> Self
fn from(s: Detail_TrackerSamplerPF) -> Self
impl Send for Detail_TrackerSamplerPF
Auto Trait Implementations§
impl Freeze for Detail_TrackerSamplerPF
impl RefUnwindSafe for Detail_TrackerSamplerPF
impl !Sync for Detail_TrackerSamplerPF
impl Unpin for Detail_TrackerSamplerPF
impl UnwindSafe for Detail_TrackerSamplerPF
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<Mat> ModifyInplace for Matwhere
Mat: Boxed,
impl<Mat> ModifyInplace for Matwhere
Mat: Boxed,
Source§unsafe fn modify_inplace<Res>(
&mut self,
f: impl FnOnce(&Mat, &mut Mat) -> Res,
) -> Res
unsafe fn modify_inplace<Res>( &mut self, f: impl FnOnce(&Mat, &mut Mat) -> Res, ) -> Res
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