00001
00002
00003 #ifndef _APPRENTICE_HPP
00004 #define _APPRENTICE_HPP
00005
00006 #include "kernel/jafarException.hpp"
00007 #include "datareader/DataReader.hpp"
00008 #include "datareader/MonoReader.hpp"
00009 #include "premodeler/sequenceObjectExtractor.hpp"
00010 #include "premodeler/offlineEngine.hpp"
00011 #include "premodeler/ifManager.hpp"
00012 #include "bundler/modelerAdapter.hpp"
00013 #include "objlocalizer/tsai2d.hpp"
00014 #include "camera/cameraPinhole.hpp"
00015 #include "jmath/jblas.hpp"
00016 #include "bundle/sba.hpp"
00017 #include "geom/t3dEuler.hpp"
00018 namespace jafar {
00019
00020 namespace learner {
00021
00028 class Apprentice {
00029
00030
00031
00032 private:
00033 premodeler::OfflineEngine* pEngine;
00034 premodeler::IFManager* ifManager;
00035 premodeler::SequenceObjectExtractor* extractor;
00036 premodeler::Engine::DetectorType type;
00037 premodeler::IFLists gTracker;
00038 datareader::DataReader* objImgDataReader;
00039 datareader::MonoReader* objImgMonoReader;
00040 std::string sensorName;
00041 bundler::ModelerAdapter* mAdapter;
00042 std::map<int, jblas::vec3> bundledPoints;
00043 bundle::SparseBundleAdjustment* sba;
00044 geom::T3DEuler originToObject;
00045
00046 public:
00047 Apprentice(const premodeler::Engine::DetectorType& _type,
00048 const std::string& _sensorName,
00049 const std::string& _emptySerieName,
00050 const int& _emptySerieNumber,
00051 const std::string& _emptyPath,
00052 const std::string& _filledSerieName,
00053 const int& _filledSerieNumber,
00054 const std::string& _filledPath);
00055
00056 Apprentice(const premodeler::Engine::DetectorType& _type,
00057 const std::string& _sensorName,
00058 datareader::DataReader* _emptyImagesDataReader,
00059 datareader::DataReader* _filledImagesDataReader);
00060
00061
00062 ~Apprentice();
00063
00064 void extractObject(const int& _objectImagesSerieNumber = -1,
00065 const std::string& _objectImagesSeriesName = "",
00066 const std::string& _objectImagesPath = "",
00067 int begin = -1,
00068 int end = -1,
00069 int proceedStep = -1);
00070
00071 void extractFeatures(int begin = -1,
00072 int end = -1,
00073 int proceedStep = -1);
00074
00075 void bundleOnFeatures(int begin = -1,
00076 int end = -1,
00077 int proceedStep = -1);
00078
00079 void improveModel();
00080
00081 void computeObjectReference();
00082
00083 void expressInObjectReference();
00084
00085 void generate3dModel();
00086 };
00087
00088 }
00089
00090 }
00091
00092 #endif