DytexKalmanFilter Class Reference

class for running the Kalman filter for dynamic texture inference. More...

#include <DytexKalmanFilter.hpp>

Collaboration diagram for DytexKalmanFilter:
[legend]

List of all members.

Public Member Functions

 DytexKalmanFilter (Dytex &dt, int tau)
 Create an instance of a pre-computed Kalman Filter for a DT.
void loglike (const vector< Mat > &videos, Mat &lik, bool mahal=false)
 compute log-likelihood of a set of videos using instantiated Kalman filter.
double loglike (const Mat &video, bool mahal=false)
 compute log-likelihood of a video using instantiated Kalman filter.

Static Public Member Functions

static void loglike (const Dytex &dt, const vector< Mat > &videos, Mat &lik, bool mahal=false)
 compute the log-likelihood of a set of videos for the given DT (no caching).
static double loglike (const Dytex &dt, const Mat &video, bool mahal=false)
 compute the log-likelihood of a video for the given DT (no caching).
static void loglike_old (const Dytex &dt, const vector< Mat > &videos, Mat &lik, bool mahal=false)
 old version of loglike.
static void dytex_kalman (Mat Y, Dytex dt, string di3opt, std::vector< Mat > &xt, Mat &Vt, Mat &Vt1, Mat &L)
 conditional state inference using Kalman smoothing filter.

Public Attributes

Mat cache_Kt
 cache for an instantiated Kalman filter: Kalman gain matrices [n x m x tau].
Mat cache_detMt
 cache for an instantiated Kalman filter: determinant term [1 x tau].
Mat cache_invMt
 cache for an instantiated Kalman filter: inverse covariance matrix [m x m x tau].
Dytex * cache_dt
 cache for an instantiated Kalman filter: DT reference (use a pointer).

Private Types

enum  kf_mode { KF_CACHE, KF_COMPUTE_WITH_CACHE, KF_COMPUTE_WITHOUT_CACHE }
 

mode for running loglike_internal.

More...

Static Private Member Functions

static void loglike_internal (const Dytex &dt, const vector< Mat > *videos, Mat *lik, int cache_tau, Mat *cache_Kt, Mat *cache_detMt, Mat *cache_invMt, bool mahal, kf_mode kfmode)
 internal function for calculating log-likelihood.

Detailed Description

class for running the Kalman filter for dynamic texture inference.

There are two ways to use the class: 1) instantiate with a DT to create a Kalman filter where most matrices are pre-computed. The KF instance can then be used for fast inference; 2) use the static functions to compute inference on a DT. In general, the first method should be used if the DT will not change and the KF will be used many times. The second method should be used if inference is required only once before the DT changes.

Definition at line 26 of file DytexKalmanFilter.hpp.


Member Enumeration Documentation

mode for running loglike_internal.

Enumerator:
KF_CACHE 

cache filter matrices.

KF_COMPUTE_WITH_CACHE 

compute LL from cache.

KF_COMPUTE_WITHOUT_CACHE 

compute LL w/o using cache.

Definition at line 86 of file DytexKalmanFilter.hpp.


Constructor & Destructor Documentation

DytexKalmanFilter::DytexKalmanFilter ( Dytex &  dt,
int  tau 
)

Create an instance of a pre-computed Kalman Filter for a DT.

Parameters:
dt the Dytex
tau the maximum video length that will be used
See also:
loglike

Definition at line 47 of file DytexKalmanFilter.cpp.

Here is the call graph for this function:


Member Function Documentation

void DytexKalmanFilter::dytex_kalman ( Mat  Y2,
Dytex  dt,
string  opt,
std::vector< Mat > &  xt,
Mat &  Vt,
Mat &  Vt1,
Mat &  L 
) [static]

conditional state inference using Kalman smoothing filter.

Parameters:
Y cell array of video in format Y(:,i,t) w/ mean subtracted
dt dynamic texture.
di3opt explicitly subtract mean or not.
xt output: state expectation: E(x_t|y_1,...y_tau); (cell array entries for each sequence Y)
Vt state covariance: cov(x_t|y_1,...,y_tau); (3-dim matrix)
Vt1 state covariance: cov(x_t,x_{t-1}|y_1,...,y_tau); (3-dim matrix)
L vector of log-likelihoods of videos in Y
Remarks:
Calculates loglikelihood as well as E-Step statistics
See also:
DytexMix

Definition at line 442 of file DytexKalmanFilter.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

double DytexKalmanFilter::loglike ( const Dytex &  dt,
const Mat &  video,
bool  mahal = false 
) [static]

compute the log-likelihood of a video for the given DT (no caching).

The Kalman filter matrices are not cached for later.

Parameters:
dt the Dytex
video the Mat video
mahal if true, calculate the Mahalanobis distance. Otherwise, calculate the log-likelihood.
Returns:
the log-likelihood of the video

Definition at line 207 of file DytexKalmanFilter.cpp.

Here is the call graph for this function:

void DytexKalmanFilter::loglike ( const Dytex &  dt,
const vector< Mat > &  videos,
Mat &  lik,
bool  mahal = false 
) [static]

compute the log-likelihood of a set of videos for the given DT (no caching).

The Kalman filter matrices are not cached for later.

Parameters:
dt the Dytex
videos the set of Mat videos
lik computed likelihood for each video
mahal if true, calculate the Mahalanobis distance. Otherwise, calculate the log-likelihood.

Definition at line 214 of file DytexKalmanFilter.cpp.

Here is the call graph for this function:

double DytexKalmanFilter::loglike ( const Mat &  video,
bool  mahal = false 
)

compute log-likelihood of a video using instantiated Kalman filter.

Parameters:
video the Mat video
mahal if true, calculate the Mahalanobis distance. Otherwise, calculate the log-likelihood.
Returns:
the log-likelihood of the video

Definition at line 67 of file DytexKalmanFilter.cpp.

Here is the call graph for this function:

void DytexKalmanFilter::loglike ( const vector< Mat > &  videos,
Mat &  lik,
bool  mahal = false 
)

compute log-likelihood of a set of videos using instantiated Kalman filter.

Parameters:
videos the set of Mat videos
lik computed likelihood for each video
mahal if true, calculate the Mahalanobis distance. Otherwise, calculate the log-likelihood.

Definition at line 63 of file DytexKalmanFilter.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void DytexKalmanFilter::loglike_internal ( const Dytex &  dt,
const vector< Mat > *  videos,
Mat *  lik,
int  cache_tau,
Mat *  cache_Kt,
Mat *  cache_detMt,
Mat *  cache_invMt,
bool  mahal,
kf_mode  kfmode 
) [static, private]

internal function for calculating log-likelihood.

do one of the following: 1) compute log-likelihood of videos under dt; 2) cache kalman filter matrices for a dt; 3) compute log-likelihood using kalman filter cache. this follows dytex_kalmanff_ll.m. note: it computes the inverse directly, so not for big videos. this is faster when the videos are small.

Parameters:
dt the Dytex
videos set of Mat videos
lik resulting log-likelihood (1 x size of videos)
cache_tau tau to use for caching
cache_Kt pointer to Kt cache matrix
cache_detMt pointer to detMt cache
cache_invMt pointer to invMt cache
mahal if true, compute Mahalanobis distance instead of LL
kfmode mode for running the function
See also:
loglike

Definition at line 229 of file DytexKalmanFilter.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:


Member Data Documentation

cache for an instantiated Kalman filter: determinant term [1 x tau].

Definition at line 32 of file DytexKalmanFilter.hpp.

cache for an instantiated Kalman filter: DT reference (use a pointer).

Definition at line 34 of file DytexKalmanFilter.hpp.

cache for an instantiated Kalman filter: inverse covariance matrix [m x m x tau].

Definition at line 33 of file DytexKalmanFilter.hpp.

cache for an instantiated Kalman filter: Kalman gain matrices [n x m x tau].

Definition at line 31 of file DytexKalmanFilter.hpp.


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

Generated on 18 Dec 2014 for libdt-OpenCV by  doxygen 1.6.1