DytexMix Class Reference

Mixture of dynamic texture class. More...

#include <DytexMix.hpp>

Collaboration diagram for DytexMix:
[legend]

List of all members.

Public Member Functions

 DytexMix ()
 default constructor.
 DytexMix (DytexOptions opt)
 initialize a DT mixture with a given DytexOptions.
void learnWithSplitting (std::vector< Mat > &Yin, EMOptions emopt)
 learn a DTM uisng EM given a set of patches
DytexMix reduceWithSplitting (HEMOptions)
 reduce current dytex mixture using HEM.
void getClasses (std::vector< Mat > Y, std::vector< int > &classes)
 Get classes for new patches given current DTM.
void getClasses (std::vector< Mat > Y, Mat &LLm)
 Get log likelihhod for new patches given current DTM.
void setupKFB (int tau)
 create cached Kalman filter for all DTs in the mixture.
void runEM (const std::vector< Mat > &Yin, const EMOptions &emopt)
 run EM for a mixture of DT
void runHEM (DytexMix &hembest, HEMOptions &hopt, std::vector< int > &classes)
 run iterations of HEM for a mixture of DT
Mat convertmovie (Mat Y, int &sx, int &sy, int &sc, int &cnorm)
 convert a movie or video clip into a 2d matrix
Dytex initcluster_doretto (const std::vector< Mat > &Y, const DytexOptions &param)
 use suboptimal method to learn a single DT from a set of videos
std::vector< Mat > extractY (const Mat &Yin, std::vector< int > inds)
 extract patches at inds locations from a single Mat format
void dytex_mix_split (DytexSplitParams splitopt, int &ctg, int &csp)
 splits a component in current DT mixture
void dytex_perturb (Dytex &dtp, double pert, DytexSplitParams::Split_mode mode, DytexSplitParams::Split_vars vars)
 custom perturbation of C based on max variance of S0
void ppertC (Mat &C, Mat S0, double pert)
 custom perturbation of C; normalize S0 by the lengths of C
Dytex init_multiple_dt ()
 initialize a single DT from current mixture

Static Public Member Functions

static Mat logtrick (Mat lA)
 calculate log(sum(A)) using only log(A)
static bool IsGT2 (int i)
 checks schedule growth is not more than double while splitting

Public Attributes

DytexOptions opt
 EM options.
std::vector< Dytex > dt
 DT components in the mixture.
std::vector< double > alpha
 DT components priors.
std::vector< int > classes
 Class of each training video.
std::vector< DytexKalmanFilter > kfb
 DytexKalmanFilter cache bank for computing log likelihood of new patches given this DTM.

Detailed Description

Mixture of dynamic texture class.

This class implements: 1) Learning a dytex mixture (DTM) using several runs of component splitting EM 2) reducing a DTM using HEM 3) computing log-likelihood under dytex mixture (with caching)

See also:
Dytex | DytexKalmanFilter

Definition at line 25 of file DytexMix.hpp.


Constructor & Destructor Documentation

DytexMix::DytexMix (  ) 

default constructor.

initializes an emply Dytex Mixture.

See also:
DytexMix::DytexMix(DytexOptions op)

Definition at line 40 of file DytexMix.cpp.

DytexMix::DytexMix ( DytexOptions  op  ) 

initialize a DT mixture with a given DytexOptions.

Parameters:
opt options for a DTM.
See also:
DytexOptions | DytexMix::DytexMix()

Definition at line 54 of file DytexMix.cpp.


Member Function Documentation

Mat DytexMix::convertmovie ( Mat  Y,
int &  sx,
int &  sy,
int &  sc,
int &  cnorm 
)

convert a movie or video clip into a 2d matrix

Parameters:
Y movie or video clip
sx original size x of movie
sy original size y of movie
sc color space of movie
cnorm color space of movie
Returns:
converted video

convert 3D/4D to column vectors

Remarks:
used by runEM
See also:
runEM | extractY

Definition at line 1378 of file DytexMix.cpp.

Here is the caller graph for this function:

void DytexMix::dytex_mix_split ( DytexSplitParams  splitopt,
int &  ctg,
int &  csp 
)

splits a component in current DT mixture

Parameters:
splitopt options for which component to split and how to split
ctg the index of the new component.
csp the component that was split
See also:
ppertC

Definition at line 1496 of file DytexMix.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void DytexMix::dytex_perturb ( Dytex &  dtp,
double  pert,
DytexSplitParams::Split_mode  mode,
DytexSplitParams::Split_vars  vars 
)

custom perturbation of C based on max variance of S0

Parameters:
dtp Dt to perturb
pert pert value
mode perturbation mode;
vars variables to perturb
Remarks:
only perturbation based on scale up principal axis and varialble C is implemented
See also:
dytex_mix_split | ppertC

Definition at line 1687 of file DytexMix.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

std::vector< Mat > DytexMix::extractY ( const Mat &  Yin,
std::vector< int >  inds 
)

extract patches at inds locations from a single Mat format

Parameters:
Yin patches in Yit format.
inds ids of patches to get.
Returns:
individual patches
See also:
Separate items with the '|' character.

Definition at line 1457 of file DytexMix.cpp.

Here is the caller graph for this function:

void DytexMix::getClasses ( std::vector< Mat >  Y,
Mat &  LLm 
)

Get log likelihhod for new patches given current DTM.

Parameters:
Y list of input video patches.
LLm log likelihhod of patches with each mixture component.

Same as the other overload but only calulates LL(logliklihood under each component)

Remarks:
make sure kfb cache is ready and setupKFB is called.
See also:
DytexMix::getClasses(std::vector<Mat> Y,std::vector<int> & classes) | setupKFB

Definition at line 343 of file DytexMix.cpp.

void DytexMix::getClasses ( std::vector< Mat >  Y,
std::vector< int > &  classes 
)

Get classes for new patches given current DTM.

Parameters:
Y list of input video patches.
classes output vector which will have class id for each patch.

Computes classes for patches using log-likelihood of patches under dytex mixture (with caching) using kalman filter bank It calculates LL(logliklihood under each component), Z(posterior probability for each component) and logZ (log of Z)

Remarks:
make sure kfb cache is ready and setupKFB is called.
See also:
getClasses(std::vector<Mat> Y, Mat &LLm) | setupKFB

Definition at line 280 of file DytexMix.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

Dytex DytexMix::init_multiple_dt (  ) 

initialize a single DT from current mixture

Returns:
new DT
See also:
initcluster_doretto

Definition at line 1758 of file DytexMix.cpp.

Here is the caller graph for this function:

Dytex DytexMix::initcluster_doretto ( const std::vector< Mat > &  Y,
const DytexOptions &  param 
)

use suboptimal method to learn a single DT from a set of videos

Parameters:
Y Input patches.
param DT learning options.
Returns:
learned DT
See also:
Dytex

Definition at line 1433 of file DytexMix.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

bool DytexMix::IsGT2 ( int  i  )  [static]

checks schedule growth is not more than double while splitting

Parameters:
i value to compare
Returns:
>2 or not

Definition at line 1870 of file DytexMix.cpp.

Here is the caller graph for this function:

void DytexMix::learnWithSplitting ( std::vector< Mat > &  Yin,
EMOptions  emopt 
)

learn a DTM uisng EM given a set of patches

Parameters:
Yin cell array of video
emopt EM learning options.

Learns a dytex mixture using several runs of EM with component splitting procedure:

Remarks:
After initializing a DTM with DytexOptions, this is the interface function to be called in order to learn a mixture from a set of video patches.
See also:
reduceWithSplitting | EMOptions

Definition at line 77 of file DytexMix.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

Mat DytexMix::logtrick ( Mat  lA  )  [static]

calculate log(sum(A)) using only log(A)

Parameters:
lA column vector of log values
Returns:
log(sum(A))
See also:
runEM

Definition at line 1842 of file DytexMix.cpp.

Here is the caller graph for this function:

void DytexMix::ppertC ( Mat &  C,
Mat  S0,
double  pert 
)

custom perturbation of C; normalize S0 by the lengths of C

Parameters:
C current C.
S0 parameter S0 of DT.
pert perturbation amount.
See also:
dytex_perturb

Definition at line 1726 of file DytexMix.cpp.

Here is the caller graph for this function:

DytexMix DytexMix::reduceWithSplitting ( HEMOptions  hopt  ) 

reduce current dytex mixture using HEM.

Parameters:
hopt HEM learning options
Returns:
reduced dynamic texture mixture.

Learns a new dytex mixture using several runs of HEM with component splitting procedure

Remarks:
After loading or learning a DTM, this is the interface function to be called to reduce a mixture
See also:
learnWithSplitting | HEMOptions

Definition at line 164 of file DytexMix.cpp.

Here is the call graph for this function:

void DytexMix::runEM ( const std::vector< Mat > &  Yin,
const EMOptions &  emopt 
)

run EM for a mixture of DT

Parameters:
Yin cell array of video
emopt EM learning options
Remarks:
in general, this should not be called.use learnWithSplitting instead
See also:
learnWithSplitting | runHEM

Definition at line 404 of file DytexMix.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void DytexMix::runHEM ( DytexMix &  hembest,
HEMOptions &  hopt,
std::vector< int > &  classes 
)

run iterations of HEM for a mixture of DT

Parameters:
hembest input DT mixture.
hopt learning option for HEM.
classes Class of each input DT that is ID of the new DT
Remarks:
in general, this should not be called.use reduceWithSplitting instead
See also:
reduceWithSplitting | HEMOptions

Definition at line 954 of file DytexMix.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void DytexMix::setupKFB ( int  tau  ) 

create cached Kalman filter for all DTs in the mixture.

Parameters:
tau length to compute.
See also:
DytexMix::getClasses(std::vector<Mat> Y,std::vector<int> & classes)

Definition at line 373 of file DytexMix.cpp.

Here is the caller graph for this function:


Member Data Documentation

std::vector<Dytex> DytexMix::dt

DT components in the mixture.

See also:
Dytex

Definition at line 37 of file DytexMix.hpp.

EM options.

See also:
DytexOptions

Definition at line 32 of file DytexMix.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