diff c/Parameters.cpp @ 1002:6c5ce3ec497e

improved handling of path for feature based tracking
author Nicolas Saunier <nicolas.saunier@polymtl.ca>
date Fri, 01 Jun 2018 17:19:24 -0400
parents 045d05cef9d0
children 9fb82fe0156f
line wrap: on
line diff
--- a/c/Parameters.cpp	Wed May 30 14:44:08 2018 -0400
+++ b/c/Parameters.cpp	Fri Jun 01 17:19:24 2018 -0400
@@ -1,11 +1,14 @@
 #include "Parameters.hpp"
 
 #include <boost/program_options.hpp>
+#include <boost/filesystem.hpp>
 
 #include <iostream>
 #include <fstream>
 
 namespace po = boost::program_options;
+namespace fs = boost::filesystem; // soon std
+
 using namespace std;
 
 KLTFeatureTrackingParameters::KLTFeatureTrackingParameters(const int argc, char* argv[]) {
@@ -92,9 +95,10 @@
       cout << cmdLine << endl;
       exit(0);      
     }
-      
+
     cout << "Using configuration file " << configurationFilename << endl;
-
+    parentDirname = fs::path(configurationFilename).parent_path().string();
+    
     ifstream configurationFile(configurationFilename.c_str());
     store(po::parse_config_file(configurationFile, cmdLineAndFile, true), vm);
     notify(vm);