Public Types | Public Member Functions | Protected Member Functions | Protected Attributes
vpdt_mog_sg_updater< mog_type > Class Template Reference

A mixture of Gaussians adaptive updater based on Stauffer-Grimson. More...

#include <vpdt_update_mog.h>

Inheritance diagram for vpdt_mog_sg_updater< mog_type >:
Inheritance graph
[legend]

List of all members.

Public Types

typedef mog_type::component_type gaussian_type
typedef gaussian_type::field_type F
typedef vpdt_field_traits< F >
::scalar_type 
T
typedef mog_type distribution_type
typedef mog_type::field_type field_type

Public Member Functions

 vpdt_mog_sg_updater (const gaussian_type &init_gaussian, unsigned int max_cmp=5, T g_thresh=T(2.5), T alpha=T(0.1), T init_weight=T(0.1), T min_stdev=T(0.16))
 Constructor.
void operator() (mog_type &mix, const F &sample) const
 The main function.

Protected Member Functions

void update (mog_type &mix, const F &sample, T alpha) const
 Update the mixture with sample using learning rate alpha.
void insert (mog_type &mixture, const F &sample, T init_weight) const
 insert a sample in the mixture.
unsigned int match (const mog_type &mix, const F &sample, const T &gt2, T &sqr_dist) const
 Return the index of the first Gaussian within the threshold distance.

Protected Attributes

T gt2_
 Squared Gaussian Mahalanobis distance threshold.
T alpha_
 The learning rate.
T init_weight_
 The initial weight for added Gaussians.
T min_var_
 Minimum variance allowed in each Gaussian component.
gaussian_type init_gaussian_
 A model for new Gaussians inserted.
unsigned int max_components_
 The maximum number of components in the mixture.

Detailed Description

template<class mog_type>
class vpdt_mog_sg_updater< mog_type >

A mixture of Gaussians adaptive updater based on Stauffer-Grimson.

Using the S-G approximation to prior probabilities This algorithm is based on: C. Stauffer and W.E.L. Grimson, "Adaptive background mixture models for real-time tracking", CVPR 1999

Definition at line 97 of file vpdt_update_mog.h.


Member Typedef Documentation

template<class mog_type >
typedef mog_type vpdt_mog_updater< mog_type >::distribution_type [inherited]

Definition at line 25 of file vpdt_update_mog.h.

template<class mog_type >
typedef gaussian_type::field_type vpdt_mog_sg_updater< mog_type >::F

Reimplemented from vpdt_mog_updater< mog_type >.

Definition at line 101 of file vpdt_update_mog.h.

template<class mog_type >
typedef mog_type::field_type vpdt_mog_updater< mog_type >::field_type [inherited]

Definition at line 26 of file vpdt_update_mog.h.

template<class mog_type >
typedef mog_type::component_type vpdt_mog_sg_updater< mog_type >::gaussian_type

Reimplemented from vpdt_mog_updater< mog_type >.

Definition at line 100 of file vpdt_update_mog.h.

template<class mog_type >
typedef vpdt_field_traits<F>::scalar_type vpdt_mog_sg_updater< mog_type >::T

Reimplemented from vpdt_mog_updater< mog_type >.

Definition at line 102 of file vpdt_update_mog.h.


Constructor & Destructor Documentation

template<class mog_type >
vpdt_mog_sg_updater< mog_type >::vpdt_mog_sg_updater ( const gaussian_type init_gaussian,
unsigned int  max_cmp = 5,
T  g_thresh = T(2.5),
T  alpha = T(0.1),
T  init_weight = T(0.1),
T  min_stdev = T(0.16) 
) [inline]

Constructor.

Definition at line 105 of file vpdt_update_mog.h.


Member Function Documentation

template<class mog_type >
void vpdt_mog_updater< mog_type >::insert ( mog_type &  mixture,
const F sample,
T  init_weight 
) const [inline, protected, inherited]

insert a sample in the mixture.

Parameters:
sampleA Gaussian is inserted with a mean of sample and a covariance from init_gaussian_
init_weightThe normalized weight the resulting sample should have after insertion

Definition at line 44 of file vpdt_update_mog.h.

template<class mog_type >
unsigned int vpdt_mog_updater< mog_type >::match ( const mog_type &  mix,
const F sample,
const T gt2,
T sqr_dist 
) const [inline, protected, inherited]

Return the index of the first Gaussian within the threshold distance.

The threshold gt2 is on the square distance. The computed square distance is returned by reference in sqr_dist If there are no matches return the number of components (last index + 1)

Definition at line 72 of file vpdt_update_mog.h.

template<class mog_type >
void vpdt_mog_sg_updater< mog_type >::operator() ( mog_type &  mix,
const F sample 
) const [inline]

The main function.

Definition at line 116 of file vpdt_update_mog.h.

template<class mog_type >
void vpdt_mog_sg_updater< mog_type >::update ( mog_type &  mix,
const F sample,
T  alpha 
) const [inline, protected]

Update the mixture with sample using learning rate alpha.

Definition at line 124 of file vpdt_update_mog.h.


Member Data Documentation

template<class mog_type >
T vpdt_mog_sg_updater< mog_type >::alpha_ [protected]

The learning rate.

Definition at line 152 of file vpdt_update_mog.h.

template<class mog_type >
T vpdt_mog_sg_updater< mog_type >::gt2_ [protected]

Squared Gaussian Mahalanobis distance threshold.

Definition at line 150 of file vpdt_update_mog.h.

template<class mog_type >
gaussian_type vpdt_mog_updater< mog_type >::init_gaussian_ [mutable, protected, inherited]

A model for new Gaussians inserted.

Definition at line 86 of file vpdt_update_mog.h.

template<class mog_type >
T vpdt_mog_sg_updater< mog_type >::init_weight_ [protected]

The initial weight for added Gaussians.

Definition at line 154 of file vpdt_update_mog.h.

template<class mog_type >
unsigned int vpdt_mog_updater< mog_type >::max_components_ [protected, inherited]

The maximum number of components in the mixture.

Definition at line 88 of file vpdt_update_mog.h.

template<class mog_type >
T vpdt_mog_sg_updater< mog_type >::min_var_ [protected]

Minimum variance allowed in each Gaussian component.

Definition at line 156 of file vpdt_update_mog.h.


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