Mercurial Hosting > traffic-intelligence
comparison 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 |
comparison
equal
deleted
inserted
replaced
505:35c99776e593 | 513:dbf4b83afbb9 |
---|---|
27 // common to cnnfiguration and command line | 27 // common to cnnfiguration and command line |
28 cmdLineAndFile.add_options() | 28 cmdLineAndFile.add_options() |
29 ("video-filename", po::value<string>(&videoFilename), "filename of the video to process") | 29 ("video-filename", po::value<string>(&videoFilename), "filename of the video to process") |
30 ("database-filename", po::value<string>(&databaseFilename), "filename of the database where results are saved") | 30 ("database-filename", po::value<string>(&databaseFilename), "filename of the database where results are saved") |
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 ("intrinsic-camera-filename", po::value<string>(&intrinsicCameraFilename), "filename of the homography matrix") | |
33 ("distortion-coefficients", po::value<std::vector<float> >(&distortionCoefficients)->multitoken(), "") | |
34 ("undistorted-size-multiplication", po::value<float>(&undistortedImageMultiplication), "undistorted image multiplication") | |
35 ("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") | |
32 ("mask-filename", po::value<string>(&maskFilename), "filename of the mask image (where features are detected)") | 36 ("mask-filename", po::value<string>(&maskFilename), "filename of the mask image (where features are detected)") |
37 ("undistort", po::value<bool>(&undistort), "undistort the video for feature tracking") | |
33 ("load-features", po::value<bool>(&loadFeatures), "load features from database") | 38 ("load-features", po::value<bool>(&loadFeatures), "load features from database") |
34 ("display", po::value<bool>(&display), "display trajectories on the video") | 39 ("display", po::value<bool>(&display), "display trajectories on the video") |
35 ("video-fps", po::value<float>(&videoFPS), "original video frame rate") | 40 ("video-fps", po::value<float>(&videoFPS), "original video frame rate") |
36 ("frame1", po::value<unsigned int>(&frame1), "first frame to process") | 41 ("frame1", po::value<unsigned int>(&frame1), "first frame to process") |
37 ("nframes", po::value<int>(&nFrames), "number of frame to process") | 42 ("nframes", po::value<int>(&nFrames), "number of frame to process") |
124 stream << boost::any_cast<unsigned int>(value) << separator; | 129 stream << boost::any_cast<unsigned int>(value) << separator; |
125 else if (value.type() == typeid(float)) | 130 else if (value.type() == typeid(float)) |
126 stream << boost::any_cast<float>(value) << separator; | 131 stream << boost::any_cast<float>(value) << separator; |
127 else if (value.type() == typeid(string)) | 132 else if (value.type() == typeid(string)) |
128 stream << boost::any_cast<string>(value) << separator; | 133 stream << boost::any_cast<string>(value) << separator; |
129 else | 134 else if (value.type() == typeid(vector<float>)) { |
135 for (unsigned int j=0; j<boost::any_cast<vector<float> >(value).size(); j++) | |
136 stream << boost::any_cast<vector<float> >(value)[j] << separator; | |
137 } else | |
130 cerr << "the type of the option " << optionsVec[i]->long_name() << " (" << i << ") is not int, float or string." << endl; | 138 cerr << "the type of the option " << optionsVec[i]->long_name() << " (" << i << ") is not int, float or string." << endl; |
131 } | 139 } |
132 | 140 |
133 return stream.str(); | 141 return stream.str(); |
134 } | 142 } |