Dytex.hpp

00001 /**************************************************
00002 
00003   Dytex class
00004 
00005   Antoni Chan,
00006   City University of Hong Kong, Copyright 2014
00007   libdt - OpenCV library for Dynamic Textures - version 1.0
00008 
00009 ***************************************************/
00010 
00011 #ifndef DYTEX_HPP
00012 #define DYTEX_HPP
00013 
00014 using namespace cv;
00015 using namespace std;
00016 
00025 class Dytex
00026 {
00027 
00028 public: 
00029         
00030   // DT options  
00031   DytexOptions dtopt;   
00033   // DT parameters
00034   Mat          Ymean,    
00035                A,        
00036                C,        
00037                mu0;      
00038   CovMatrix    R,        
00039                Q,        
00040                S0;       
00042   // video parameters (for synthesizing)
00043   // set to 0,0 if unknown
00044   int vrows,  
00045       vcols;  
00047   bool isempty; 
00048   Mat Cvs;      
00049   bool isCvs;   
00051   // functions
00052   
00057   Dytex(const DytexOptions &dtopt);
00060   Dytex();
00061   virtual ~Dytex();
00062 
00067   void setRegularizer(const DytexRegOptions &dtreg);  
00068   
00072   void regularize(bool regA=false);
00073   void regularizeA();
00074 
00080   void learnLeastSquares(const vector<Mat> &videos); // learn from multiple video
00081   
00087   void learnLeastSquares(const Mat &video);          // learn from one video
00088 
00102   Mat  synthesize(RNG &rng, int tau, bool video_output = true, bool display_video = false,
00103                   double fps=30.0, double alpha=1.0, double beta=0.0);
00104 
00105   // helper functions
00106   
00117   void processVideoTraining(const Mat &vin, Mat &Yout, Mat &Yout_mean);
00118   
00126   void processVideoTesting(const Mat &vin, Mat &Yout) const;
00127   
00128   // debugging
00129   
00133   friend ostream& operator <<(ostream &output, const Dytex &dt);
00134   
00136   virtual void dump_matlab(ostream &output) const;
00137 
00139   virtual void dump(ostream & output) const;
00140 
00141 private:
00142   //void doInit();
00143 };
00144 
00145 #endif

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