Jafar
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
tracksList.hpp
00001 /* $Id$ */
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; // features list is stored as a vector of interest points
00040   
00041       public :
00042   
00043   // Constructor, Destructor
00044   track();
00045   track( jafar::fdetect::InterestFeature *pIP );
00046   
00047   // Add a point
00052   void add (jafar::fdetect::InterestFeature *pIP);
00053   
00063   void exportBinaryFile (std::ofstream& outfile);
00064   
00065   // Accessor and modifior of id
00066   
00071   void setId (unsigned int m_id); // must diffuse to all elements of fl the new ID    
00072   inline unsigned int getId () {return id;};    
00073 
00074   // Return length
00075   unsigned int length () {return fl.size();};
00076 
00081   jafar::fdetect::InterestFeature* isVisible ( unsigned int indView );
00082 
00083   // Return the vInterestFeature
00084   jafar::fdetect::vInterestFeatures* getTrack()
00085   { return &fl; }
00086   
00087 
00088       private :
00089   
00090   unsigned int id;
00091   
00092       }; // end class track
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       }; // end struct TrackListRemovePred       
00110 
00111       
00112       std::vector<jafar::gfm::tracks::track*> tl; // tracks list is stored as a vector of track
00113       
00114     public : 
00115       
00116       // Constructor, Destructor
00117       tracks(const jafar::fdetect::vInterestFeatures &vIP);
00118       
00125       void add (jafar::fdetect::vInterestFeatures &vIP);
00126 
00127       // Export to file
00128       // If the second arguments is given, a clean-up is ran first 
00129       // to erase tracks with a smaller length
00130 
00143       void exportBinaryFile (std::string filename, unsigned int minLength=0);
00144 
00150       void makeStatistics ();
00151 
00152       // Return length
00153       unsigned int length () {return tl.size();};
00154 
00155       // Return the vector of interest points which are visible in view given in argument
00156       jafar::fdetect::vInterestFeatures* featuresInView (unsigned int indView);
00157       
00158       // Returm the vector of InterestFeatures corresponding to the indObj Features
00159       jafar::fdetect::vInterestFeatures* getTrack (unsigned int indObj);                     
00160       
00161     private :
00162       
00166       void removeShorterTracks (unsigned int minLength);
00167       
00168     }; // end class tracks
00169            
00170   } // end namespace gfm
00171   
00172 } // end namespace jafar
00173 
00174 #endif
00175 
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated on Wed Oct 15 2014 00:37:20 for Jafar by doxygen 1.7.6.1
LAAS-CNRS