Dynamic Texture class. More...
#include <Dytex.hpp>
Public Member Functions | |
| Dytex (const DytexOptions &dtopt) | |
| allocate a new dynamic texture. | |
| Dytex () | |
| allocate a new empty dynamic texture. | |
| void | setRegularizer (const DytexRegOptions &dtreg) |
| set the regularization method. | |
| void | regularize (bool regA=false) |
| apply regularization to the DT. | |
| void | regularizeA () |
| void | learnLeastSquares (const vector< Mat > &videos) |
| estimate DT parameters from a set of videos. | |
| void | learnLeastSquares (const Mat &video) |
| estimate DT parameters from a single video. | |
| Mat | synthesize (RNG &rng, int tau, bool video_output=true, bool display_video=false, double fps=30.0, double alpha=1.0, double beta=0.0) |
| synthesize a video from the DT. | |
| void | processVideoTraining (const Mat &vin, Mat &Yout, Mat &Yout_mean) |
| pre-process a video for training a DT. | |
| void | processVideoTesting (const Mat &vin, Mat &Yout) const |
| pre-process a video for a learned DT. | |
| virtual void | dump_matlab (ostream &output) const |
| debugging: dump the Dytex to a Matlab-readable string (dt struct). | |
| virtual void | dump (ostream &output) const |
| debugging: dump information about the DT. | |
Public Attributes | |
| DytexOptions | dtopt |
| options for the Dytex | |
| Mat | Ymean |
| observation mean | |
| Mat | A |
| transition matrix | |
| Mat | C |
| observation matrix | |
| Mat | mu0 |
| initial state mean | |
| CovMatrix | R |
| observation noise covariance | |
| CovMatrix | Q |
| state noise covariance | |
| CovMatrix | S0 |
| initial state covariance | |
| int | vrows |
| for synthesis, number of rows in a frame (0 if unknown). | |
| int | vcols |
| for synthesis, number of columns in a frame (0 if unknown). | |
| bool | isempty |
| indicates am empty Dt | |
| Mat | Cvs |
| Cvs precomputed value. | |
| bool | isCvs |
| Cvs computed. | |
Friends | |
| ostream & | operator<< (ostream &output, const Dytex &dt) |
| debugging: dump the Dytex to an output stream. | |
Dynamic Texture class.
This is the class for a standard dynamic texture. It serves as the base class for the online version of the DT. It includes functions for: 1) estimating parameters; 2) regularizing; 3) synthesizing video; 4) pre-processing video for usage with DT (for other classes).
Definition at line 25 of file Dytex.hpp.
| Dytex::Dytex | ( | const DytexOptions & | dtopt | ) |
| void Dytex::dump | ( | ostream & | output | ) | const [virtual] |
| void Dytex::dump_matlab | ( | ostream & | output | ) | const [virtual] |
| void Dytex::learnLeastSquares | ( | const Mat & | video | ) |
| void Dytex::learnLeastSquares | ( | const vector< Mat > & | videos | ) |
estimate DT parameters from a set of videos.
Uses Doretto's sub-optimal fast least-squares method to estimate parameters from a set of videos.
| videos | set of videos |
Definition at line 226 of file Dytex.cpp.
| void Dytex::processVideoTesting | ( | const Mat & | vin, | |
| Mat & | Yout | |||
| ) | const |
pre-process a video for a learned DT.
Given a learned DT, convert a Mat video to a vector time-series, and subtract the DT mean. This function is used by DytexKalmanFilter to pre-process the video.
| vin | the Mat video input | |
| Yout | the mean-subtracted vectorized video. |
Definition at line 173 of file Dytex.cpp.
| void Dytex::processVideoTraining | ( | const Mat & | vin, | |
| Mat & | Yout, | |||
| Mat & | Yout_mean | |||
| ) |
pre-process a video for training a DT.
Converts a Mat video into a vector time-series (of type OPT_MAT_TYPE). If the DT will model Ymean, then subtracts the empirical mean of the video. This function is used to pre-process video for learnLeastSquares.
| vin | the training Mat video | |
| Yout | the mean-subtracted vectorized video. | |
| Yout_mean | the empirical mean of vectorized vin. |
Definition at line 114 of file Dytex.cpp.
| void Dytex::regularize | ( | bool | regA = false |
) |
apply regularization to the DT.
Definition at line 71 of file Dytex.cpp.
| void Dytex::setRegularizer | ( | const DytexRegOptions & | dtreg | ) |
set the regularization method.
| dtreg | the regularization options |
Definition at line 65 of file Dytex.cpp.
| Mat Dytex::synthesize | ( | RNG & | rng, | |
| int | tau, | |||
| bool | video_output = true, |
|||
| bool | display_video = false, |
|||
| double | fps = 30.0, |
|||
| double | alpha = 1.0, |
|||
| double | beta = 0.0 | |||
| ) |
synthesize a video from the DT.
Generates a tau-length sample from the DT, and return or display it. When displaying the video sample, the pixel values are scaled as alpha*pix+beta, and played at fps frames-per-second.
| rng | the random-number generator | |
| tau | the number of frames to sample | |
| video_output | if true, output a Mat video. If false, output a vectorized video (column vectors). | |
| display_video | if true, display the video during synthesis (supresses output). | |
| fps | frames per second for display | |
| alpha | scale factor | |
| beta | scale constant |
Definition at line 519 of file Dytex.cpp.
| ostream& operator<< | ( | ostream & | output, | |
| const Dytex & | dt | |||
| ) | [friend] |
| int Dytex::vcols |
| int Dytex::vrows |
1.6.1