00001
00002
00003 #ifndef _GFM_TRACKS_LIST_HPP_
00004 #define _GFM_TRACKS_LIST_HPP_
00005
00006 #include <stdlib.h>
00007
00008 #include <iostream>
00009 #include <fstream>
00010 #include <algorithm>
00011 #include <vector>
00012
00013 #include "fdetect/InterestFeature.hpp"
00014 #include "fdetect/Detector.hpp"
00015 #include "gfm/GroupsMatcher.hpp"
00016 #include "gfm/EngineOfflineTracking.hpp"
00017
00018 #include "kernel/jafarMacro.hpp"
00019
00020 namespace jafar {
00021
00022 namespace gfm {
00023
00029 class tracks {
00030
00031
00037 class track {
00038
00039 jafar::fdetect::vInterestFeatures fl;
00040
00041 public :
00042
00043
00044 track();
00045 track( jafar::fdetect::InterestFeature *pIP );
00046
00047
00052 void add (jafar::fdetect::InterestFeature *pIP);
00053
00063 void exportBinaryFile (std::ofstream& outfile);
00064
00065
00066
00071 void setId (unsigned int m_id);
00072 inline unsigned int getId () {return id;};
00073
00074
00075 unsigned int length () {return fl.size();};
00076
00081 jafar::fdetect::InterestFeature* isVisible ( unsigned int indView );
00082
00083
00084 jafar::fdetect::vInterestFeatures* getTrack()
00085 { return &fl; }
00086
00087
00088 private :
00089
00090 unsigned int id;
00091
00092 };
00093
00094
00098 struct TrackListRemovePred
00099 {
00100
00101 unsigned int minlength;
00102
00103 TrackListRemovePred(unsigned int minlength_) : minlength(minlength_) {}
00104
00105 bool operator()(track* oneTrack) {
00106 return (oneTrack->length() < minlength);
00107 }
00108
00109 };
00110
00111
00112 std::vector<jafar::gfm::tracks::track*> tl;
00113
00114 public :
00115
00116
00117 tracks(const jafar::fdetect::vInterestFeatures &vIP);
00118
00125 void add (jafar::fdetect::vInterestFeatures &vIP);
00126
00127
00128
00129
00130
00143 void exportBinaryFile (std::string filename, unsigned int minLength=0);
00144
00150 void makeStatistics ();
00151
00152
00153 unsigned int length () {return tl.size();};
00154
00155
00156 jafar::fdetect::vInterestFeatures* featuresInView (unsigned int indView);
00157
00158
00159 jafar::fdetect::vInterestFeatures* getTrack (unsigned int indObj);
00160
00161 private :
00162
00166 void removeShorterTracks (unsigned int minLength);
00167
00168 };
00169
00170 }
00171
00172 }
00173
00174 #endif
00175