summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuillaume Seguin <guillaume@segu.in>2010-06-22 21:24:35 -0400
committerGuillaume Seguin <guillaume@segu.in>2010-06-22 21:24:35 -0400
commit97ae9c454f4ce2a65ce5453924b7747034f0074e (patch)
treea01b182946575491a7fde9c9f13c3766fee70dad
parent4d8601146ee5067a1aae2a9af6cc62b55a7a94f3 (diff)
downloadcmu-97ae9c454f4ce2a65ce5453924b7747034f0074e.tar.gz
cmu-97ae9c454f4ce2a65ce5453924b7747034f0074e.tar.bz2
Add F computation
-rw-r--r--libmoped/src/config.hpp2
-rw-r--r--libmoped/src/sfm/SFM_F.hpp34
-rw-r--r--libmoped/src/util.hpp2
3 files changed, 38 insertions, 0 deletions
diff --git a/libmoped/src/config.hpp b/libmoped/src/config.hpp
index cb7b854..0c222b8 100644
--- a/libmoped/src/config.hpp
+++ b/libmoped/src/config.hpp
@@ -39,6 +39,7 @@
#include <sfm/SFM_TRACKING.hpp>
#include <sfm/SFM_TRACKING_DISPLAY.hpp>
+#include <sfm/SFM_F.hpp>
//#include <sfm/SFM_RECONSTRUCTION.hpp> /* FIXME : TODO */
#include <STATUS_DISPLAY.hpp>
@@ -127,6 +128,7 @@ namespace MopedNS {
pipeline.addAlg( "TRACKING", new SFM_TRACKING() );
pipeline.addAlg( "TRACKING_DISPLAY", new SFM_TRACKING_DISPLAY(DEFAULT_DISPLAY_LEVEL) );
+ pipeline.addAlg( "SFM_F", new SFM_F() );
//pipeline.addAlg( "POSE2_DISPLAY", new POSE_DISPLAY( DEFAULT_DISPLAY_LEVEL ) );
diff --git a/libmoped/src/sfm/SFM_F.hpp b/libmoped/src/sfm/SFM_F.hpp
new file mode 100644
index 0000000..b49d84b
--- /dev/null
+++ b/libmoped/src/sfm/SFM_F.hpp
@@ -0,0 +1,34 @@
+#pragma once
+
+namespace MopedNS {
+
+ class SFM_F:public MopedAlg {
+
+ public:
+
+ SFM_F()
+ {}
+
+ void getConfig (map<string,string> &config) const {
+ }
+
+ void setConfig (map<string,string> &config) {
+ }
+
+ void process(FrameData &frameData) {
+ for( int i=0; i<(int)frameData.images.size(); i++) {
+ vector<Point2f> & new_points = frameData.trackingNewPoints[i];
+ vector<KeyPoint> & key_points = frameData.trackedFeatures[i];
+ vector<int> & old_points_indices = frameData.trackingPrevIndices[i];
+ int points_count = old_points_indices.size ();
+ if (points_count == 0)
+ return;
+ vector<Point2f> points1 (points_count);
+ vector<Point2f> & points2 = new_points;
+ for (int j = 0; j < points_count; ++j)
+ points1[j] = key_points[old_points_indices[j]].pt;
+ frameData.F[i] = findFundamentalMat(points1, points2, FM_RANSAC, 3, 0.99);
+ }
+ }
+ };
+};
diff --git a/libmoped/src/util.hpp b/libmoped/src/util.hpp
index 2937336..77d4b98 100644
--- a/libmoped/src/util.hpp
+++ b/libmoped/src/util.hpp
@@ -54,6 +54,8 @@ namespace MopedNS {
map< int, vector<KeyPoint> > trackedFeatures;
map< int, vector<int> > trackingPrevIndices;
map< int, vector<Point2f> > trackingNewPoints;
+ map<int, Mat> F;
+
map< string, vector< DetectedFeature > > detectedFeatures;
vector< vector< Match > > matches;