00001
00002
00003 #ifndef _LEARNER_HPP
00004 #define _LEARNER_HPP
00005
00006 #include "kernel/jafarException.hpp"
00007 #include "fdetect/InterestFeature.hpp"
00008 #include "gfm/MatchingResult.hpp"
00009 #include "fdetect/Detector.hpp"
00010 #include "premodeler/engine.hpp"
00011 #include "premodeler/ifManager.hpp"
00012 #include "kernel/csvFile.hpp"
00013 #include "jmath/jblas.hpp"
00014
00015 namespace jafar {
00016
00017 namespace premodeler {
00018
00025 class Learner : public kernel::CSVFileSave {
00026
00027 private:
00029 gfm::GroupsMatcher* m_matcher;
00031 fdetect::Detector* m_detector;
00033 premodeler::IFLists interestFeaturesLists;
00035 premodeler::Engine::DetectorType m_type;
00037 std::map<int, jblas::vec3> points;
00041 std::string detectorData(const std::string& separator);
00045 std::string matcherData(const std::string& separator);
00049 std::string featureData(fdetect::InterestFeature *ip,
00050 const std::string& separator);
00051
00052 jblas::vec3 bundled3dPoint(const int& id);
00053
00054 protected:
00055 void saveCSVFile(kernel::CSVFile& csvFile);
00056
00057 public:
00061 Learner() : kernel::CSVFileSave() {};
00066 Learner(const premodeler::Engine::DetectorType& _type,
00067 fdetect::Detector* _detector,
00068 gfm::GroupsMatcher* _matcher,
00069 const premodeler::IFLists& _ifLists,
00070 const std::map<int, jblas::vec3>& _points);
00071
00072 Learner(const premodeler::Engine::DetectorType& _type,
00073 fdetect::Detector* _detector,
00074 gfm::GroupsMatcher* _matcher,
00075 const premodeler::IFLists& _ifLists);
00076
00077
00078
00079
00080
00081
00082
00086 ~Learner();
00089 void setDetector(fdetect::Detector* _detector) {
00090 m_detector = _detector;
00091 }
00094 void setMatcher(gfm::GroupsMatcher* _matcher) {
00095 m_matcher = _matcher;
00096 }
00099 void setInterstFeaturesLists(const premodeler::IFLists& _ifLists){
00100 interestFeaturesLists = _ifLists;
00101 }
00104 void setBundledFeatures(const std::map<int, jblas::vec3>& _points){
00105 points = _points;
00106 }
00108 void setDetectorType(const Engine::DetectorType &_type);
00112 void setEngine(const premodeler::Engine& _engine);
00116 void setIFManager(const premodeler::IFManager& _manager);
00117
00118
00119
00120
00121
00122
00123
00124
00125
00126
00127
00128
00130 inline fdetect::Detector* detector() const {
00131 return m_detector;
00132 }
00134 inline gfm::GroupsMatcher* matcher() const {
00135 return m_matcher;
00136 }
00137
00138 };
00139
00140 }
00141
00142 }
00143
00144 #endif