DytexMix.hpp

00001 
00008 #ifndef DYTEXMIX_HPP
00009 #define DYTEXMIX_HPP
00010 
00011 using namespace std;
00012 using namespace cv;
00013 
00025 class DytexMix
00026 {
00027 public: 
00032         DytexOptions opt;       
00037         std::vector<Dytex> dt;
00041         std::vector<double> alpha;
00045         std::vector<int> classes;
00046         
00047 
00051         std::vector<DytexKalmanFilter> kfb;
00052         
00053         //default construtor
00054         DytexMix();
00055         // initialize a mixture using given options
00056         DytexMix(DytexOptions opt);  
00057         
00058         //learn a DTM uisng EM given a set of patches
00059         void learnWithSplitting(std::vector<Mat> &Yin,EMOptions emopt); 
00060 
00061         //reduce the mixture uisng HEM 
00062         DytexMix reduceWithSplitting(HEMOptions); 
00063 
00064         //Get classes for new patches given current DTM
00065         void getClasses(std::vector<Mat> Y,std::vector<int> &classes);
00066 
00067         //Get likelihood of patches given current DTM
00068         void getClasses(std::vector<Mat> Y,Mat &LLm);   
00069 
00070         //initialize the cache for kalman filter bank
00071         void setupKFB(int tau);
00072         
00073         //****following functions are helper functions and must not be called directly*****/
00074         //****************************************************************//
00075 
00076         //run iterations of EM for a mixture of DT
00077         void runEM(const std::vector<Mat> &Yin,const EMOptions &emopt);    
00078         //run iterations of HEM for a mixture of DT
00079         void runHEM(DytexMix &hembest, HEMOptions &hopt,std::vector<int> &classes);     
00080         //convert a movie or video clip into a 2d matrix
00081         Mat convertmovie(Mat Y,int &sx,int &sy,int &sc,int &cnorm);
00082         //use suboptimal method to learn a single DT from a set of videos
00083         Dytex initcluster_doretto(const std::vector<Mat> &Y,const DytexOptions &param);
00084         //extract patches at inds locations from a single Mat format 
00085         std::vector<Mat> extractY(const Mat &Yin, std::vector<int> inds);
00086         //splits a component in current DT mixture
00087         void dytex_mix_split(DytexSplitParams splitopt,int& ctg,int& csp );     
00088         //perturb a dytex
00089         void dytex_perturb(Dytex &dtp, double pert, DytexSplitParams::Split_mode mode, DytexSplitParams::Split_vars vars);
00090         //custom perturbation of C based on max variance of S0
00091         void ppertC(Mat &C,Mat S0,double pert);
00092         //initialize a single DT from current mixture
00093         Dytex init_multiple_dt();
00094         //calculate log(sum(A)) using only log(A)
00095         static Mat logtrick(Mat lA);
00096         //checks schedule growth is not more than double while splitting
00097         static bool IsGT2 (int i);              
00098         
00099 };
00100 
00101 #endif

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