00001 #ifndef SNAKE_H 00002 #define SNAKE_H 00003 00004 // OpenCV includes: 00005 #ifdef _CH_ 00006 #pragma package <opencv> 00007 #endif 00008 00009 #ifndef _EiC 00010 #include "cv.h" 00011 #endif 00012 00013 // forwared declarations 00014 class QtCvWrapper; 00015 00017 00028 class Snake 00029 { 00030 public: 00032 Snake(QtCvWrapper* parent, IplImage* inImg); 00033 00035 virtual ~Snake(void); 00036 00038 inline bool setInImg(IplImage* inImg){m_inImg = inImg;}; 00039 00041 inline IplImage* getInImg(){return m_inImg;}; 00042 00044 inline IplImage* getSnakeImage(){return m_snakeImg;}; 00045 00047 void initSnakeCurve(); 00048 00050 void initSnakeCurve(CvPoint* pt); 00051 00053 IplImage* iterateSnakeCurve(int numIterations, bool showIterations); 00054 00055 protected: 00056 00057 private: 00059 QtCvWrapper* m_parent; 00060 IplImage* m_inImg; 00061 IplImage* m_snakeImg; 00062 CvTermCriteria m_crit; 00063 CvPoint* m_snakeCurve; 00064 00065 // some constants 00066 float m_alpha; 00067 float m_beta; 00068 float m_gamma; 00069 CvSize m_winSize; 00070 int m_numSegments; 00071 int m_numIteration; 00072 }; 00073 00074 #endif