added sift index options to dataset for reassosiation of data

release/4.3a0
nsrinivasan7 2015-04-11 10:28:44 -04:00
parent 0a0d2a29f6
commit 226f6ad0ce
2 changed files with 5 additions and 0 deletions

View File

@ -670,6 +670,7 @@ bool readBundler(const string& filename, SfM_data &data) {
float u, v; float u, v;
is >> cam_idx >> point_idx >> u >> v; is >> cam_idx >> point_idx >> u >> v;
track.measurements.push_back(make_pair(cam_idx, Point2(u, -v))); track.measurements.push_back(make_pair(cam_idx, Point2(u, -v)));
track.siftIndices.push_back(make_pair(cam_idx, point_idx));
} }
data.tracks.push_back(track); data.tracks.push_back(track);

View File

@ -137,11 +137,15 @@ GTSAM_EXPORT GraphAndValues load3D(const std::string& filename);
/// A measurement with its camera index /// A measurement with its camera index
typedef std::pair<size_t, Point2> SfM_Measurement; typedef std::pair<size_t, Point2> SfM_Measurement;
/// SfM_Track
typedef std::pair<size_t, size_t> SIFT_Index;
/// Define the structure for the 3D points /// Define the structure for the 3D points
struct SfM_Track { struct SfM_Track {
Point3 p; ///< 3D position of the point Point3 p; ///< 3D position of the point
float r, g, b; ///< RGB color of the 3D point float r, g, b; ///< RGB color of the 3D point
std::vector<SfM_Measurement> measurements; ///< The 2D image projections (id,(u,v)) std::vector<SfM_Measurement> measurements; ///< The 2D image projections (id,(u,v))
std::vector<SIFT_Index> siftIndices;
size_t number_measurements() const { size_t number_measurements() const {
return measurements.size(); return measurements.size();
} }