Mixture of dynamic texture class. More...
#include <DytexMix.hpp>
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 ¶m) |
| 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. | |
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)
Definition at line 25 of file DytexMix.hpp.
| DytexMix::DytexMix | ( | ) |
default constructor.
initializes an emply Dytex Mixture.
Definition at line 40 of file DytexMix.cpp.
| DytexMix::DytexMix | ( | DytexOptions | op | ) |
initialize a DT mixture with a given DytexOptions.
| opt | options for a DTM. |
Definition at line 54 of file DytexMix.cpp.
| Mat DytexMix::convertmovie | ( | Mat | Y, | |
| int & | sx, | |||
| int & | sy, | |||
| int & | sc, | |||
| int & | cnorm | |||
| ) |
convert a movie or video clip into a 2d matrix
| 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 |
convert 3D/4D to column vectors
Definition at line 1378 of file DytexMix.cpp.
| void DytexMix::dytex_mix_split | ( | DytexSplitParams | splitopt, | |
| int & | ctg, | |||
| int & | csp | |||
| ) |
splits a component in current DT mixture
| splitopt | options for which component to split and how to split | |
| ctg | the index of the new component. | |
| csp | the component that was split |
Definition at line 1496 of file DytexMix.cpp.
| 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
| dtp | Dt to perturb | |
| pert | pert value | |
| mode | perturbation mode; | |
| vars | variables to perturb |
Definition at line 1687 of file DytexMix.cpp.
| std::vector< Mat > DytexMix::extractY | ( | const Mat & | Yin, | |
| std::vector< int > | inds | |||
| ) |
extract patches at inds locations from a single Mat format
| Yin | patches in Yit format. | |
| inds | ids of patches to get. |
Definition at line 1457 of file DytexMix.cpp.
| void DytexMix::getClasses | ( | std::vector< Mat > | Y, | |
| Mat & | LLm | |||
| ) |
Get log likelihhod for new patches given current DTM.
| 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)
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.
| 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)
Definition at line 280 of file DytexMix.cpp.
| Dytex DytexMix::init_multiple_dt | ( | ) |
initialize a single DT from current mixture
Definition at line 1758 of file DytexMix.cpp.
| 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
| Y | Input patches. | |
| param | DT learning options. |
Definition at line 1433 of file DytexMix.cpp.
| bool DytexMix::IsGT2 | ( | int | i | ) | [static] |
checks schedule growth is not more than double while splitting
| i | value to compare |
Definition at line 1870 of file DytexMix.cpp.
| void DytexMix::learnWithSplitting | ( | std::vector< Mat > & | Yin, | |
| EMOptions | emopt | |||
| ) |
learn a DTM uisng EM given a set of patches
| Yin | cell array of video | |
| emopt | EM learning options. |
Learns a dytex mixture using several runs of EM with component splitting procedure:
Definition at line 77 of file DytexMix.cpp.
| Mat DytexMix::logtrick | ( | Mat | lA | ) | [static] |
calculate log(sum(A)) using only log(A)
| lA | column vector of log values |
Definition at line 1842 of file DytexMix.cpp.
| void DytexMix::ppertC | ( | Mat & | C, | |
| Mat | S0, | |||
| double | pert | |||
| ) |
custom perturbation of C; normalize S0 by the lengths of C
| C | current C. | |
| S0 | parameter S0 of DT. | |
| pert | perturbation amount. |
Definition at line 1726 of file DytexMix.cpp.
| DytexMix DytexMix::reduceWithSplitting | ( | HEMOptions | hopt | ) |
reduce current dytex mixture using HEM.
| hopt | HEM learning options |
Learns a new dytex mixture using several runs of HEM with component splitting procedure
Definition at line 164 of file DytexMix.cpp.
| void DytexMix::runEM | ( | const std::vector< Mat > & | Yin, | |
| const EMOptions & | emopt | |||
| ) |
run EM for a mixture of DT
| Yin | cell array of video | |
| emopt | EM learning options |
Definition at line 404 of file DytexMix.cpp.
| void DytexMix::runHEM | ( | DytexMix & | hembest, | |
| HEMOptions & | hopt, | |||
| std::vector< int > & | classes | |||
| ) |
run iterations of HEM for a mixture of DT
| hembest | input DT mixture. | |
| hopt | learning option for HEM. | |
| classes | Class of each input DT that is ID of the new DT |
Definition at line 954 of file DytexMix.cpp.
| void DytexMix::setupKFB | ( | int | tau | ) |
create cached Kalman filter for all DTs in the mixture.
| tau | length to compute. |
Definition at line 373 of file DytexMix.cpp.
| std::vector<Dytex> DytexMix::dt |
1.6.1