Mercurial Hosting > traffic-intelligence
diff c/Parameters.cpp @ 513:dbf4b83afbb9
pulled in and merged the new functionalities to deal with camera distortion (eg GoPro cameras)
author | Nicolas Saunier <nicolas.saunier@polymtl.ca> |
---|---|
date | Wed, 04 Jun 2014 10:57:09 -0400 |
parents | 935430b1d408 |
children | 045d05cef9d0 |
line wrap: on
line diff
--- a/c/Parameters.cpp Wed Jun 04 10:56:12 2014 -0400 +++ b/c/Parameters.cpp Wed Jun 04 10:57:09 2014 -0400 @@ -29,7 +29,12 @@ ("video-filename", po::value<string>(&videoFilename), "filename of the video to process") ("database-filename", po::value<string>(&databaseFilename), "filename of the database where results are saved") ("homography-filename", po::value<string>(&homographyFilename), "filename of the homography matrix") + ("intrinsic-camera-filename", po::value<string>(&intrinsicCameraFilename), "filename of the homography matrix") + ("distortion-coefficients", po::value<std::vector<float> >(&distortionCoefficients)->multitoken(), "") + ("undistorted-size-multiplication", po::value<float>(&undistortedImageMultiplication), "undistorted image multiplication") + ("interpolation-method", po::value<int>(&interpolationMethod), "Interpolation method for remapping image when correcting for distortion: 0 for INTER_NEAREST - a nearest-neighbor interpolation; 1 for INTER_LINEAR - a bilinear interpolation (used by default); 2 for INTER_CUBIC - a bicubic interpolation over 4x4 pixel neighborhood; 3 for INTER_LANCZOS4") ("mask-filename", po::value<string>(&maskFilename), "filename of the mask image (where features are detected)") + ("undistort", po::value<bool>(&undistort), "undistort the video for feature tracking") ("load-features", po::value<bool>(&loadFeatures), "load features from database") ("display", po::value<bool>(&display), "display trajectories on the video") ("video-fps", po::value<float>(&videoFPS), "original video frame rate") @@ -126,7 +131,10 @@ stream << boost::any_cast<float>(value) << separator; else if (value.type() == typeid(string)) stream << boost::any_cast<string>(value) << separator; - else + else if (value.type() == typeid(vector<float>)) { + for (unsigned int j=0; j<boost::any_cast<vector<float> >(value).size(); j++) + stream << boost::any_cast<vector<float> >(value)[j] << separator; + } else cerr << "the type of the option " << optionsVec[i]->long_name() << " (" << i << ") is not int, float or string." << endl; }