[−][src]Struct opencv::tracking::TrackerSamplerPF
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
impl TrackerSamplerPF
[src]
pub fn as_raw_TrackerSamplerPF(&self) -> *const c_void
[src]
pub fn as_raw_mut_TrackerSamplerPF(&mut self) -> *mut c_void
[src]
impl TrackerSamplerPF
[src]
pub fn new(
chosen_rect: &Mat,
parameters: &TrackerSamplerPF_Params
) -> Result<TrackerSamplerPF>
[src]
chosen_rect: &Mat,
parameters: &TrackerSamplerPF_Params
) -> Result<TrackerSamplerPF>
Constructor
Parameters
- chosenRect: Initial rectangle, that is supposed to contain target we'd like to track.
- parameters:
C++ default parameters
- parameters: TrackerSamplerPF::Params()
Trait Implementations
impl Boxed for TrackerSamplerPF
[src]
unsafe fn from_raw(ptr: *mut c_void) -> Self
[src]
fn into_raw(self) -> *mut c_void
[src]
fn as_raw(&self) -> *const c_void
[src]
fn as_raw_mut(&mut self) -> *mut c_void
[src]
impl Drop for TrackerSamplerPF
[src]
impl Send for TrackerSamplerPF
[src]
impl TrackerSamplerAlgorithm for TrackerSamplerPF
[src]
fn as_raw_TrackerSamplerAlgorithm(&self) -> *const c_void
[src]
fn as_raw_mut_TrackerSamplerAlgorithm(&mut self) -> *mut c_void
[src]
fn sampling(
&mut self,
image: &Mat,
bounding_box: Rect,
sample: &mut Vector<Mat>
) -> Result<bool>
[src]
&mut self,
image: &Mat,
bounding_box: Rect,
sample: &mut Vector<Mat>
) -> Result<bool>
fn get_class_name(&self) -> Result<String>
[src]
impl TrackerSamplerPFTrait for TrackerSamplerPF
[src]
fn as_raw_TrackerSamplerPF(&self) -> *const c_void
[src]
fn as_raw_mut_TrackerSamplerPF(&mut self) -> *mut c_void
[src]
Auto Trait Implementations
impl RefUnwindSafe for TrackerSamplerPF
impl !Sync for TrackerSamplerPF
impl Unpin for TrackerSamplerPF
impl UnwindSafe for TrackerSamplerPF
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,