00001 #ifndef TRV_TRACKER_HPP
00002 #define TRV_TRACKER_HPP
00003 #include "traversability/trv_util.hpp"
00004
00005 #include <fstream>
00006 #include <string>
00007
00008 #include "gfm/Engine.hpp"
00009 #include "gfm/EngineTracking.hpp"
00010 #include "gfm/EngineOfflineTracking.hpp"
00011 #include "fdetect/Detector.hpp"
00012 #include "fdetect/HarrisDetector.hpp"
00013 #include "gfm/GroupsMatcher.hpp"
00014 #include "gfm/Matcher.hpp"
00015 #include "gfm/MatchFocus.hpp"
00016 #include "fdetect/DetectionResult.hpp"
00017 #include "gfm/MatchingResult.hpp"
00018 #include "fdetect/InterestFeature.hpp"
00019 #include "fdetect/SURFDetector.hpp"
00020 #include "fdetect/SIFTDetector.hpp"
00021
00022
00023
00024
00025 #include "klt/klt.hpp"
00026
00027 namespace jafar
00028 {
00029 namespace traversability
00030 {
00031
00043 typedef enum TrackerType
00044 {
00045 TRV_HARRIS,
00046 TRV_SIFT,
00047 TRV_SURF,
00048 TRV_GFM,
00049 TRV_FOCUS,
00050 TRV_KLT,
00051
00052
00053
00054 TRV_NONE
00055 } TrackerType;
00056
00057
00066 class Tracker
00067 {
00068 private:
00069 TrackerType mTrackerType;
00070 float mImScale;
00071 int mFeatures;
00072 int mBufferSize;
00073 int mBufferCnt;
00074
00075 MatchesContainer mMatches;
00076
00077 jafar::gfm::Engine* mGfmEngine;
00078 jafar::gfm::MatchingResult mGfmMr;
00079
00080 jafar::gfm::EngineOfflineTracking* mGfmEngineTr;
00081
00082 MatchesContainer* *mGfmBuffer;
00083
00084
00085
00086
00087
00088 jafar::klt::Klt* mKltEngine;
00089 KLT_TrackingContext mKltTC;
00090 KLT_FeatureList mKltFL;
00091 KLT_FeatureTable mKltFT;
00092
00093 public:
00101 Tracker ( TrackerType tt=TRV_NONE, int nFeautres=1000, int bufferSize=100 );
00102 ~Tracker ( void ) { }
00103
00111 void track ( jafar::image::Image &im0, jafar::image::Image &im1 );
00120 MatchesContainer* matches ( const int idx0=0, const int idx1=1);
00129 MatchesContainer* readMatches ( std::string filename );
00130 TrackerType getTrackerType ( void ) const { return mTrackerType; }
00131 };
00132
00133 }
00134 }
00135
00136 #endif
00137