Mercurial Hosting > traffic-intelligence
changeset 506:13d4eb96a751
added needed parameters
author | Nicolas Saunier <nicolas.saunier@polymtl.ca> |
---|---|
date | Mon, 28 Apr 2014 18:18:14 -0400 |
parents | 41a72146685e |
children | 081a9da6f85b |
files | c/Parameters.cpp c/feature-based-tracking.cpp include/Parameters.hpp tracking.cfg |
diffstat | 4 files changed, 21 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/c/Parameters.cpp Mon Apr 28 17:32:33 2014 -0400 +++ b/c/Parameters.cpp Mon Apr 28 18:18:14 2014 -0400 @@ -29,6 +29,9 @@ ("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") ("mask-filename", po::value<string>(&maskFilename), "filename of the mask image (where features are detected)") ("load-features", po::value<bool>(&loadFeatures), "load features from database") ("display", po::value<bool>(&display), "display trajectories on the video") @@ -125,7 +128,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; }
--- a/c/feature-based-tracking.cpp Mon Apr 28 17:32:33 2014 -0400 +++ b/c/feature-based-tracking.cpp Mon Apr 28 18:18:14 2014 -0400 @@ -59,7 +59,6 @@ }; inline void saveFeatures(vector<FeatureTrajectoryPtr>& features, TrajectoryDBAccess<Point2f>& db, const string& positionsTableName, const string& velocitiesTableName) { - /// \todo smoothing BOOST_FOREACH(FeatureTrajectoryPtr f, features) f->write(db, positionsTableName, velocitiesTableName); features.clear(); }
--- a/include/Parameters.hpp Mon Apr 28 17:32:33 2014 -0400 +++ b/include/Parameters.hpp Mon Apr 28 18:18:14 2014 -0400 @@ -4,6 +4,7 @@ /// \todo Class for parameters, with utilities to save and load from configuration files #include <string> +#include <vector> namespace boost{ namespace program_options { @@ -19,6 +20,9 @@ std::string videoFilename; std::string databaseFilename; std::string homographyFilename; + std::string intrinsicCameraFilename; + std::vector<float> distortionCoefficients; + float undistortedImageMultiplication; std::string maskFilename; bool loadFeatures; bool display;
--- a/tracking.cfg Mon Apr 28 17:32:33 2014 -0400 +++ b/tracking.cfg Mon Apr 28 18:18:14 2014 -0400 @@ -4,6 +4,16 @@ database-filename = laurier.sqlite # filename of the homography matrix homography-filename = laurier-homography.txt +# filename of the homography matrix +intrinsic-camera-filename = intrinsic-camera.txt +# -0.11759321 0.0148536 0.00030756 -0.00020578 -0.00091816 +distortion-coefficients = -0.11759321 +distortion-coefficients = 0.0148536 +distortion-coefficients = 0.00030756 +distortion-coefficients = -0.00020578 +distortion-coefficients = -0.00091816 +# undistorted image multiplication +undistorted-size-multiplication = 1.31 # filename of the mask image (where features are detected) mask-filename = none # load features from database