00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00020 #ifndef CMotion2DPyramid_h
00021 #define CMotion2DPyramid_h
00022
00023
00024
00025 #ifdef __SunOS_
00026 # include <iostream.h>
00027 #else
00028 # include <iostream>
00029 #endif
00030
00031 #include <Motion2D.h>
00032
00033 using namespace std;
00034
00035 #if defined (WIN32)
00036 # if defined MOTION2D_DLL_EXPORTS
00037 # define MOTION2D_API __declspec( dllexport )
00038 # elif defined MOTION2D_DLL_IMPORTS
00039 # define MOTION2D_API __declspec( dllimport )
00040 # else
00041 # define MOTION2D_API
00042 # endif
00043 #else
00044 # define MOTION2D_API
00045 #endif
00046
00050 typedef enum {
00051 PYR_NO_ERROR = 0,
00052 PYR_NOT_ALLOCATED = -1,
00053 PYR_LEVEL_NOT_ACCESSIBLE = -2,
00054 PYR_TOO_MUCH_LEVELS = -3,
00055 PYR_ALLOCATION_DONE = -4,
00056 PYR_NOT_ENOUGH_MEMORY = -5,
00057 PYR_NOT_BUILD = -6
00058 } TPyramidError;
00059
00061
00063
00064 {
00065 public:
00066 enum {
00067 NLEVELS_MAX = 10
00068 };
00069
00070 public:
00071 CMotion2DPyramid();
00072 CMotion2DPyramid(const CMotion2DPyramid & pyramid);
00073 ~CMotion2DPyramid();
00074
00075 TPyramidError allocate(int nrows, int ncols, int nlevels);
00076 TPyramidError build(const unsigned char *image);
00077 TPyramidError build(const unsigned char *image, int nrows, int ncols, int nlevels);
00078 TPyramidError build(const short *image);
00079 TPyramidError build(const short *image, int nrows, int ncols, int nlevels);
00080 void destroy();
00081
00082 int getNumberOfLevels() const ;
00083 TPyramidError getNumberOfRows(int & rows, int level=0) const ;
00084 TPyramidError getNumberOfCols(int & ncols, int level=0) const ;
00085
00086 float *getRowsSpatialGradientDataAddress(TPyramidError &error, int level=0);
00087 float *getColsSpatialGradientDataAddress(TPyramidError &error, int level=0);
00088 short *getGaussianImageDataAddress(TPyramidError &error, int level=0);
00089
00090 CMotion2DPyramid & exchange(CMotion2DPyramid & pyramid);
00091
00092 private:
00093 void __panic(char *message);
00094
00095 private:
00096 int nlevels;
00097 int nrows;
00098 int ncols;
00099
00100 public:
00101
00102 TImageShort pyr_ima[NLEVELS_MAX];
00103 TImageFloat pyr_gx [NLEVELS_MAX];
00104 TImageFloat pyr_gy [NLEVELS_MAX];
00105
00106 bool allocated;
00107
00108 };
00109
00110 #endif