contrib/gel/vmal/vmal_multi_view_data.h
Go to the documentation of this file.
00001 // This is gel/vmal/vmal_multi_view_data.h
00002 #ifndef vmal_multi_view_data_
00003 #define vmal_multi_view_data_
00004 //--------------------------------------------------------------------------------
00005 //:
00006 // \file
00007 // \brief Class to hold the matched points through multi views
00008 // \author
00009 //   L. Guichard
00010 //--------------------------------------------------------------------------------
00011 #include <vcl_vector.h>
00012 #include <vcl_map.h>
00013 #include <vcl_iosfwd.h>
00014 #include <mvl/NViewMatches.h>
00015 #include <vbl/vbl_ref_count.h>
00016 
00017 template <class T>
00018 class vmal_multi_view_data: public vbl_ref_count
00019 {
00020  public:
00021   vmal_multi_view_data();
00022   vmal_multi_view_data(int nbviews);
00023   // copy constructor - compiler-provided one sets ref_count to nonzero which is wrong -PVr
00024   vmal_multi_view_data(vmal_multi_view_data const& d)
00025     : vbl_ref_count(), nbviews_(d.nbviews_), nbfeatures_(d.nbfeatures_),
00026       size_vect_ft_(d.size_vect_ft_), matchnum_(d.matchnum_),
00027       closed_track_(d.closed_track_), MVM(d.MVM), all_pts(d.all_pts) {}
00028 
00029   ~vmal_multi_view_data();
00030 
00031   void new_track();
00032   void close_track();
00033 
00034   bool get_first_track(vcl_map<int,T,vcl_less<int> > & track);
00035   bool get_next_track(vcl_map<int,T,vcl_less<int> > & track);
00036 
00037   void set_params(int nbviews);
00038   void set(int view_num,int matchnum,T);
00039   void set(int view_num,T);
00040 
00041   void get(int, vcl_vector<T> &);
00042   void get(int, int, vcl_vector<T> &,
00043            vcl_vector<T> &);
00044   void get(int, int, int, vcl_vector<T> &,
00045            vcl_vector<T> &,
00046            vcl_vector<T> &);
00047 
00048   bool get_pred_match(int view_num,T obj,T & res);
00049   int get_nb_views() const { return nbviews_; }
00050 
00051   void remove(int view_num, T match);
00052 
00053   vcl_ostream& print(vcl_ostream& str);
00054 
00055  private:
00056   int nbviews_;
00057   int nbfeatures_; //number of features wishing to be detected
00058   int size_vect_ft_;//the number of features in all images
00059   int matchnum_; //the number of tracks
00060   bool closed_track_;
00061 
00062   NViewMatches MVM;
00063   vcl_vector<T> all_pts;
00064 };
00065 
00066 #endif // vmal_multi_view_data_