00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00020 #ifndef CMotion2D_h
00021 #define CMotion2D_h
00022
00023
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;
00076 CMotion2DImage<unsigned char> S;
00077 CMotion2DImage<short> B;
00078 CMotion2DImage<unsigned char> W;
00079 CMotion2DEstimator estimator;
00080 CMotion2DModel model;
00081 CMotion2DPyramid pyramid1;
00082 CMotion2DPyramid pyramid2;
00083 CMotion2DWarping warping;
00084
00085 string ipath ;
00086 string filename;
00087 string rpath;
00088 string opath;
00089 string bpath;
00090 string wpath;
00091 string dpath;
00092 string spath;
00093 string Fpath;
00094
00095 long unsigned niter ;
00096 int step;
00097 unsigned char label;
00098 int slabel;
00099 string model_id;
00100 bool var_light;
00101 bool model_orig_fixed;
00102 double model_row_orig;
00103 double model_col_orig ;
00104 unsigned pyr_nlevels;
00105 unsigned pyr_stop_level;
00106 bool verbose;
00107 bool support_empty;
00108
00109 int b_ncols, b_nrows;
00110 int b_col_orig, b_row_orig;
00111 bool compute_covariance;
00112 unsigned nbsubsample;
00113
00114 unsigned long frame;
00115 double multfactor;
00116 unsigned raw_nrows;
00117 unsigned raw_ncols;
00118 bool useModelAsInitialization;
00119
00120 CReader *Ireader;
00121 CReader *Sreader;
00122 CWriter *writer;
00123 };
00124
00125 #endif