comparison c/Parameters.cpp @ 231:249d65ff6c35

merged modifications for windows
author Nicolas Saunier <nicolas.saunier@polymtl.ca>
date Mon, 02 Jul 2012 23:49:39 -0400
parents bc4ea09b1743 6e73b112370b
children f21ef87f98f1
comparison
equal deleted inserted replaced
230:bc4ea09b1743 231:249d65ff6c35
7 7
8 namespace po = boost::program_options; 8 namespace po = boost::program_options;
9 using namespace std; 9 using namespace std;
10 10
11 KLTFeatureTrackingParameters::KLTFeatureTrackingParameters(const int argc, char* argv[]) { 11 KLTFeatureTrackingParameters::KLTFeatureTrackingParameters(const int argc, char* argv[]) {
12 std::string configurationFilename; 12 string configurationFilename;
13 po::options_description onlyCmdLine("Command line only"); 13 po::options_description onlyCmdLine("Command line only");
14 po::options_description cmdLineAndFile("Command line and configuration file"); 14 po::options_description cmdLineAndFile("Command line and configuration file");
15 15
16 // configuration filename 16 // configuration filename
17 onlyCmdLine.add_options() 17 onlyCmdLine.add_options()
31 ("homography-filename", po::value<string>(&homographyFilename), "filename of the homography matrix") 31 ("homography-filename", po::value<string>(&homographyFilename), "filename of the homography matrix")
32 ("mask-filename", po::value<string>(&maskFilename), "filename of the mask image (where features are detected)") 32 ("mask-filename", po::value<string>(&maskFilename), "filename of the mask image (where features are detected)")
33 ("load-features", po::value<bool>(&loadFeatures), "load features from database") 33 ("load-features", po::value<bool>(&loadFeatures), "load features from database")
34 ("display", po::value<bool>(&display), "display trajectories on the video") 34 ("display", po::value<bool>(&display), "display trajectories on the video")
35 ("video-fps", po::value<float>(&videoFPS), "original video frame rate") 35 ("video-fps", po::value<float>(&videoFPS), "original video frame rate")
36 ("frame1", po::value<int>(&frame1), "first frame to process") 36 ("frame1", po::value<unsigned int>(&frame1), "first frame to process")
37 ("nframes", po::value<int>(&nFrames), "number of frame to process") 37 ("nframes", po::value<unsigned int>(&nFrames), "number of frame to process")
38 // feature tracking 38 // feature tracking
39 ("max-nfeatures", po::value<int>(&maxNFeatures), "maximum number of features added at each frame") 39 ("max-nfeatures", po::value<int>(&maxNFeatures), "maximum number of features added at each frame")
40 ("feature-quality", po::value<float>(&featureQuality), "quality level of the good features to track") 40 ("feature-quality", po::value<float>(&featureQuality), "quality level of the good features to track")
41 ("min-feature-distanceklt", po::value<float>(&minFeatureDistanceKLT), "minimum distance between features") 41 ("min-feature-distanceklt", po::value<float>(&minFeatureDistanceKLT), "minimum distance between features")
42 ("window-size", po::value<int>(&windowSize), "size of the search window at each pyramid level") 42 ("window-size", po::value<int>(&windowSize), "size of the search window at each pyramid level")
93 } 93 }
94 } 94 }
95 95
96 string KLTFeatureTrackingParameters::getParameterDescription(po::options_description& options, const po::variables_map& vm, const string& separator /* = " " */) const { 96 string KLTFeatureTrackingParameters::getParameterDescription(po::options_description& options, const po::variables_map& vm, const string& separator /* = " " */) const {
97 stringstream stream; 97 stringstream stream;
98 std::vector<boost::shared_ptr<po::option_description> > optionsVec = options.options(); 98 vector<boost::shared_ptr<po::option_description> > optionsVec = options.options();
99 for (unsigned int i=0; i<optionsVec.size(); ++i) { 99 for (unsigned int i=0; i<optionsVec.size(); ++i) {
100 boost::any value = vm[optionsVec[i]->long_name()].value(); 100 boost::any value = vm[optionsVec[i]->long_name()].value();
101 if (value.type() == typeid(bool)) 101 if (value.type() == typeid(bool))
102 stream << boost::any_cast<bool>(value) << separator; 102 stream << boost::any_cast<bool>(value) << separator;
103 else if (value.type() == typeid(int)) 103 else if (value.type() == typeid(int))