Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members  

/home/slang/XVision2/src/Tracking/XVTracker.h

00001 // *** BEGIN_XVISION2_COPYRIGHT_NOTICE ***
00002 // *** END_XVISION2_COPYRIGHT_NOTICE ***
00003 
00004 //-----------------------------------------------------------------------------
00005 //
00006 //  XVTracker.h
00007 //
00008 //  Sam Lang - 2.02.01
00009 //
00010 //-----------------------------------------------------------------------------
00011 
00012 #ifndef _XVTRACKER_H_
00013 #define _XVTRACKER_H_
00014 
00015 #define DEFAULT_ITERATIONS 1
00016 
00017 #include <XVInteractive.h>
00018 #include <XVDrawable.h>
00019 #include <Video.h>
00020 #include <XVWindow.h>
00021 #include <XVException.h>
00022 #include <XVFeature.h>
00023 
00024 class XVTrackerException : public XVException { protected:
00025   XVTrackerException() : XVException("XVTracker Expection") {} 
00026   XVTrackerException( char * err ) : XVException(err) {} };  
00027 
00028 template <class SRCTYPE, class FEATURETYPE>
00029 class XVTracker {
00030 
00031   typedef typename FEATURETYPE::STATE STATE;
00032 
00033  protected:
00034 
00035   SRCTYPE     & source;
00036   FEATURETYPE & feature;
00037   
00038   int stepsPerFrame;
00039   int frameNum;
00040 
00041  public:
00042 
00043   XVTracker(SRCTYPE & s, FEATURETYPE & f, int pf = DEFAULT_ITERATIONS) 
00044     : source(s), feature(f), stepsPerFrame(pf), frameNum(0) {};
00045   
00046   virtual typename FEATURETYPE::STATE init() = 0;
00047   virtual void track() throw (XVTrackerException) = 0;
00048   virtual typename FEATURETYPE::STATE nextState() throw (XVTrackerException) = 0;
00049 };
00050 
00051 template <class SRCTYPE, class WINTYPE, class FEATURETYPE>
00052 class XVDisplayTracker : public XVTracker<SRCTYPE, FEATURETYPE> {
00053 
00054  protected:
00055 
00056   WINTYPE & window;
00057 
00058  public:
00059 
00060   XVDisplayTracker(SRCTYPE & s, WINTYPE & w, FEATURETYPE & f, int pf = DEFAULT_ITERATIONS) 
00061     : XVTracker<SRCTYPE, FEATURETYPE>(s, f, pf), window(w) {}
00062 
00063   virtual typename FEATURETYPE::STATE init();
00064   virtual void track() throw (XVTrackerException);
00065   virtual typename FEATURETYPE::STATE nextState() throw (XVTrackerException);
00066 };
00067 
00068 #include <XVTracker.icc>
00069 
00070 
00071 #include <config.h>
00072 #include <XVWindowX.h>
00073 #include <XVImageRGB.h>
00074 #include <XVImageScalar.h>
00075 
00076 #define _REGISTER_XVTRACKER_(_FEATURE_TYPE_, _SRC_PIX_) \
00077 template class XVTracker<Video< _SRC_PIX_ >, _FEATURE_TYPE_ >;
00078 
00079 #define _REGISTER_XVDISPLAYTRACKER_(_FEATURE_TYPE_, _SRC_PIX_, _WIN_PIX_) \
00080 template class XVTracker<Video< _SRC_PIX_ >, _FEATURE_TYPE_>; \
00081 template class XVDisplayTracker<Video< _SRC_PIX_ >, XVInteractWindowX< _WIN_PIX_ >, _FEATURE_TYPE_>;
00082 
00083   
00084 #endif

Generated at Thu Mar 29 22:37:28 2001 for XVision by doxygen1.2.0 written by Dimitri van Heesch, © 1997-2000