Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
vpdt_mog_lee_updater< mog_type > Class Template Reference

A mixture of Gaussians adaptive updater based on D. More...

#include <vpdt_update_mog.h>

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

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_lee_updater (const gaussian_type &init_gaussian, unsigned int max_cmp=5, T g_thresh=T(2.5), T min_stdev=T(0.16), bool use_wta=false)
 Constructor. More...
 
void operator() (mog_type &mix, const F &sample) const
 The main function. More...
 

Protected Member Functions

T total_num_obs (const mog_type &mix) const
 Count the total number of observations in all components. More...
 
std::vector< std::pair< unsigned int, double > > matches (const mog_type &mix, const F &sample) const
 find all matches within the gt2_ threshold and compute the probability of each. More...
 
void winner_take_all (std::vector< std::pair< unsigned int, double > > &m) const
 Apply a winner-take-all strategy to the matches. More...
 
void update (mog_type &mix, const F &sample, T alpha) const
 Update the mixture with sample using learning rate alpha. More...
 
void insert (mog_type &mixture, const F &sample, T init_weight) const
 insert a sample in the mixture. More...
 
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. More...
 

Protected Attributes

T gt2_
 Squared Gaussian Mahalanobis distance threshold. More...
 
T min_var_
 Minimum variance allowed in each Gaussian component. More...
 
bool use_winner_take_all_
 Use a winner-take_all strategy. More...
 
gaussian_type init_gaussian_
 A model for new Gaussians inserted. More...
 
unsigned int max_components_
 The maximum number of components in the mixture. More...
 

Detailed Description

template<class mog_type>
class vpdt_mog_lee_updater< mog_type >

A mixture of Gaussians adaptive updater based on D.

-S. Lee. Modification of the S-G method. Each Gaussian has its own learning rate that adjusts with the number of observations. This algorithm requires that the Gaussians in the mixture are wrapped in a vpdt_num_obs class to count the number of observations. This algorithm is based on: D.-S. Lee. "Effective gaussian mixture learning for video background subtraction", PAMI, 27:827–832, May 2005.

Definition at line 170 of file vpdt_update_mog.h.

Member Typedef Documentation

◆ distribution_type

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

Definition at line 28 of file vpdt_update_mog.h.

◆ F

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

Definition at line 174 of file vpdt_update_mog.h.

◆ field_type

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

Definition at line 29 of file vpdt_update_mog.h.

◆ gaussian_type

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

Definition at line 173 of file vpdt_update_mog.h.

◆ T

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

Definition at line 175 of file vpdt_update_mog.h.

Constructor & Destructor Documentation

◆ vpdt_mog_lee_updater()

template<class mog_type >
vpdt_mog_lee_updater< mog_type >::vpdt_mog_lee_updater ( const gaussian_type init_gaussian,
unsigned int  max_cmp = 5,
T  g_thresh = T(2.5),
T  min_stdev = T(0.16),
bool  use_wta = false 
)
inline

Constructor.

Definition at line 178 of file vpdt_update_mog.h.

Member Function Documentation

◆ insert()

template<class mog_type >
void vpdt_mog_updater< mog_type >::insert ( mog_type &  mixture,
const F sample,
T  init_weight 
) const
inlineprotectedinherited

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 47 of file vpdt_update_mog.h.

◆ match()

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
inlineprotectedinherited

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 73 of file vpdt_update_mog.h.

◆ matches()

template<class mog_type >
std::vector<std::pair<unsigned int,double> > vpdt_mog_lee_updater< mog_type >::matches ( const mog_type &  mix,
const F sample 
) const
inlineprotected

find all matches within the gt2_ threshold and compute the probability of each.

Definition at line 210 of file vpdt_update_mog.h.

◆ operator()()

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

The main function.

Definition at line 188 of file vpdt_update_mog.h.

◆ total_num_obs()

template<class mog_type >
T vpdt_mog_lee_updater< mog_type >::total_num_obs ( const mog_type &  mix) const
inlineprotected

Count the total number of observations in all components.

Definition at line 197 of file vpdt_update_mog.h.

◆ update()

template<class mog_type >
void vpdt_mog_lee_updater< mog_type >::update ( mog_type &  mix,
const F sample,
T  alpha 
) const
inlineprotected

Update the mixture with sample using learning rate alpha.

Definition at line 261 of file vpdt_update_mog.h.

◆ winner_take_all()

template<class mog_type >
void vpdt_mog_lee_updater< mog_type >::winner_take_all ( std::vector< std::pair< unsigned int, double > > &  m) const
inlineprotected

Apply a winner-take-all strategy to the matches.

Keep only the highest probability match and assign it probability 1

Definition at line 245 of file vpdt_update_mog.h.

Member Data Documentation

◆ gt2_

template<class mog_type >
T vpdt_mog_lee_updater< mog_type >::gt2_
protected

Squared Gaussian Mahalanobis distance threshold.

Definition at line 300 of file vpdt_update_mog.h.

◆ init_gaussian_

template<class mog_type >
gaussian_type vpdt_mog_updater< mog_type >::init_gaussian_
mutableprotectedinherited

A model for new Gaussians inserted.

Definition at line 87 of file vpdt_update_mog.h.

◆ max_components_

template<class mog_type >
unsigned int vpdt_mog_updater< mog_type >::max_components_
protectedinherited

The maximum number of components in the mixture.

Definition at line 89 of file vpdt_update_mog.h.

◆ min_var_

template<class mog_type >
T vpdt_mog_lee_updater< mog_type >::min_var_
protected

Minimum variance allowed in each Gaussian component.

Definition at line 302 of file vpdt_update_mog.h.

◆ use_winner_take_all_

template<class mog_type >
bool vpdt_mog_lee_updater< mog_type >::use_winner_take_all_
protected

Use a winner-take_all strategy.

Definition at line 305 of file vpdt_update_mog.h.


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