00001
00002
00003 #ifndef _GFM_ENGINEOFFLINETRACKING_HPP_
00004 #define _GFM_ENGINEOFFLINETRACKING_HPP_
00005
00006 #include <fstream>
00007 #include <image/Image.hpp>
00008
00009 #include "fdetect/InterestFeature.hpp"
00010 #include "fdetect/DetectionResult.hpp"
00011 #include "fdetect/Detector.hpp"
00012 #include "fdetect/Descriptor.hpp"
00013 #include "gfm/Matcher.hpp"
00014 #include "gfm/MatchingResult.hpp"
00015
00016 namespace jafar {
00017
00018 namespace gfm {
00019
00020 class MatchSourceInfo;
00021 class DescriptorFactory;
00022 class Detector;
00023 class Matcher;
00024 class MatchingResult;
00025
00034 class EngineOfflineTracking {
00035
00036 public:
00037
00038 EngineOfflineTracking(jafar::fdetect::Detector* detector,
00039 jafar::gfm::Matcher* matcher,
00040 jafar::fdetect::DescriptorFactory* descriptor = 0) :
00041 nextId(1),
00042 m_detector(detector),
00043 m_descriptorFactory(descriptor),
00044 m_matcher(matcher),
00045 m_sourceInfoRef(0),
00046 optFeatureIdForSequenceTracking(false)
00047 { }
00048
00049 ~EngineOfflineTracking();
00050
00051 public:
00052
00053 const jafar::fdetect::DetectionResult& currentPoints() const;
00054
00058 void initTracking(jafar::image::Image const& image_ref );
00059
00066 MatchingResult nextImage(jafar::image::Image const& image_next, unsigned int indView);
00067
00082 void setOptFeatureIdForSequenceTracking(bool val)
00083 {
00084 optFeatureIdForSequenceTracking = val;
00085 }
00086
00087 protected:
00088
00089 inline MatchSourceInfo* sourceInfoRef() const { return m_sourceInfoRef; }
00090 inline Matcher* matcher() { return m_matcher; }
00091 inline fdetect::DescriptorFactory* descriptorFactory() { return m_descriptorFactory; }
00092 inline fdetect::Detector* detector() { return m_detector; }
00093
00094 private:
00095
00096 unsigned int nextId;
00097 fdetect::Detector* m_detector;
00098 fdetect::DescriptorFactory* m_descriptorFactory;
00099 Matcher* m_matcher;
00100 MatchSourceInfo* m_sourceInfoRef;
00101
00115 bool optFeatureIdForSequenceTracking;
00116 };
00117
00118 }
00119 }
00120
00121 #endif