Vista     Main Page   Class List   Function List   File List   Examples  


CMotion2D.h

Go to the documentation of this file.
00001 /*
 00002 
 00003   Copyright (c) 1995-2005 by INRIA.
 00004   All Rights Reserved.
 00005 
 00006   This software was developed at:
 00007   IRISA/INRIA Rennes
 00008   Campus Universitaire de Beaulieu
 00009   35042 Rennes Cedex
 00010 
 00011   http://www.irisa.fr
 00012 
 00013 */
 00014 
 00020 #ifndef CMotion2D_h
 00021 #define CMotion2D_h
 00022 
 00023 // Include for Motion2D
 00024 #include "CMotion2DImage.h"
 00025 #include "CMotion2DEstimator.h"
 00026 #include "CMotion2DPyramid.h"
 00027 #include "CMotion2DModel.h"
 00028 #include "CMotion2DWarping.h"
 00029 #include "CReader.h"
 00030 #include "CWriter.h"
 00031 
 00032 
 00033 #define GETOPTARGS "a:b:c:d:e:f:ghi:j:k:l:m:n:o:p:q:r:s:t:u:vw:x:y:z?C:F:IR:"
 00034 #define max(a,b) (a>b?a:b)
 00035 
 00036 #if defined (WIN32)
 00037 #  if defined MOTION2D_DLL_EXPORTS
 00038 #     define MOTION2D_API __declspec( dllexport )
 00039 #  elif defined MOTION2D_DLL_IMPORTS
 00040 #     define MOTION2D_API __declspec( dllimport )
 00041 #  else
 00042 #     define MOTION2D_API
 00043 #  endif
 00044 #else
 00045 #     define MOTION2D_API
 00046 #endif
 00047 
 00048 
 00049 
 00050 class MOTION2D_API CMotion2D {
 00051 
 00052  public:
 00053   CMotion2D();
 00054   ~CMotion2D();
 00055   void printHeaderResults(FILE *output, CMotion2DModel model,
 00056                           double multfactor);
 00057   void printResults(FILE *output, unsigned long i1, unsigned long i2,
 00058                     CMotion2DModel model, double support_size,
 00059                     unsigned nbsubsample, double multfactor);
 00060   void printVresResults(FILE * output, CMotion2DImage<float> &Vres,
 00061                         CMotion2DImage<unsigned char> &Map, string dpath,
 00062                         int frame);
 00063   int  getoption (int argc, char** argv, char* pszValidOpts, char** ppszParam);
 00064   void getoptions(int argc, char **argv);
 00065   int  main(int argc, char **argv);
 00066   int  testReader(int argc, char **argv);
 00067   void usage(char *name, char *badparam);
 00068   void setReader(CReader *);
 00069   void getVres(CMotion2DImage<float>&,CMotion2DImage<unsigned char>&, int);
 00070   void free();
 00071   unsigned getNbSubsample();
 00072   CMotion2DModel &getMotion2DModel();
 00073 
 00074  private:
 00075   CMotion2DImage<short> I;              // Image
 00076   CMotion2DImage<unsigned char> S;      // Motion estimator support
 00077   CMotion2DImage<short> B;              // Backwarped image
 00078   CMotion2DImage<unsigned char> W;      // M-estimator weights image
 00079   CMotion2DEstimator    estimator;      // Motion estimator
 00080   CMotion2DModel        model;          // Parametric motion model
 00081   CMotion2DPyramid      pyramid1;       // Pyramid on image 1
 00082   CMotion2DPyramid      pyramid2;       // Pyramid on image 2
 00083   CMotion2DWarping      warping;        // Warping
 00084 
 00085   string ipath ;                // Image path
 00086   string filename;              // Complete filename for an image of the video
 00087   string rpath;                 // Result filename to store the model
 00088   string opath;                 // Result filename for residual motion
 00089   string bpath;                 // Back-warped image path
 00090   string wpath;                 // M-estimator weights image path
 00091   string dpath;                 // Residual motion image path
 00092   string spath;                 // Estimation support path
 00093   string Fpath;                 // Optic flow path
 00094 
 00095   long unsigned niter ;         // Number of images to process
 00096   int  step;                    // Step between 2 images
 00097   unsigned char label;          // Value of the motion estimator support
 00098   int slabel;                   // Value of the motion estimator support
 00099   string model_id;              // Parametric motion model ID to estimate
 00100   bool var_light;               // Lighting variation parameter estimation
 00101   bool model_orig_fixed;        // Indicates if an origin is fixed
 00102   double model_row_orig;        // Motion model origin (line coordinate)
 00103   double model_col_orig ;       // Motion model origin (column coordinate)
 00104   unsigned pyr_nlevels;         // Number of levels in a multi-resolution pyr
 00105   unsigned pyr_stop_level;      // Pyramid level where the estimator stops
 00106   bool verbose;                 // Verbose mode
 00107   bool support_empty;           // Indicates if the support is empty.
 00108 
 00109   int b_ncols, b_nrows;         // Back-warped image size
 00110   int b_col_orig, b_row_orig;   // Back-warped origin in image frame
 00111   bool compute_covariance;      // Flag to compute the covariance matrix
 00112   unsigned nbsubsample;         // Images spatial resolution: 0 full, 1 mid...
 00113 
 00114   unsigned long frame;          // Current frame number processed
 00115   double multfactor;            // Multiplier factor for motion parameters
 00116   unsigned raw_nrows;           // Number of rows for RAW8 or RAW16 images
 00117   unsigned raw_ncols;           // Number of cols for RAW8 or RAW16 images
 00118   bool useModelAsInitialization; // How is the estimated model init
 00119 
 00120   CReader *Ireader;             // Image reader
 00121   CReader *Sreader;             // Support reader
 00122   CWriter *writer;              // Image writer
 00123 };
 00124 
 00125 #endif
 

Motion2D is Copyright © 1995-2005 by Inria
This documentation was generated on 31 Jan 2005 by Fabien Spindler for Motion2D 1.3.11 using doxygen1.2.18 written by Dimitri van Heesch, © 1997-2005